Results 1 to 4 of 4

Thread: QCursor::setPos() fails with x server fatal error

  1. #1
    Join Date
    Oct 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question QCursor::setPos() fails with x server fatal error

    This is my first post as I am new to Qt and to the community (used to code in Delphi).

    I am working on a very simple app which gets a key evt and triggers setPos just like: QCursor::setPos(QCursor:os()+QPoint(0, 10));

    Unfortunatelly, even if I trigger it just once, after 1 or 2 seconds my app crashes and I get a "<unknown>: Fatal IO error 0 (Success) on X server :0.0."

    I'm running Ubuntu 9.04 Desktop on a Toshiba Celeron M/ATI notebook. w/ CompizFusion enabled.

    Any clues?

    Thanks in advance.

  2. #2
    Join Date
    Oct 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QCursor::setPos() fails with x server fatal error

    I tested with Compiz disabled... It wsorked for the first 10 seconds... some mouse movement, but...

    <unknown>: Fatal IO error 11 (resource temporarily unavailable) on X server :0.0.
    Last edited by Arnaldo Diniz; 1st October 2009 at 13:34.

  3. #3
    Join Date
    Dec 2010
    Posts
    1
    Qt products
    Platforms
    Unix/X11

    Default Re: QCursor::setPos() fails with x server fatal error

    Same over here!

    Even though what i am trying to do is the following. I want to continuously display the cursor coordinates relative to a widget. Herefore i start a QThread who gets the cursor and the widget as input and then should update the gui with the coordinates in a while-true-loop.

    But i get the following error on startup:

    ---------------------
    X Error: BadRequest (invalid request code or no such operation) 1
    Major opcode: 0 ()
    Resource id: 0x23
    <unknown>: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
    ---------------------

    If i delay the call for the cursor position method with, e.g. time.sleep(1), The call works ok for around seven times and then crashes again.

    How can avoid that? Or do you have a better idea for continuously displaying the cursor coordinates?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QCursor::setPos() fails with x server fatal error

    Quote Originally Posted by Wes Pipez View Post
    Herefore i start a QThread who gets the cursor and the widget as input and then should update the gui with the coordinates in a while-true-loop.
    ... and you have your answer. Now read the docs about using multiple threads with gui.

    By the way the word "continously" doesn't apply to computers. Think how often do you really need to know the position of the cursor.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    ScumCoder (15th November 2011)

Similar Threads

  1. nmake error during .pro compiling
    By mattia in forum Installation and Deployment
    Replies: 5
    Last Post: 18th June 2008, 10:15
  2. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 13:43
  3. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 02:49
  4. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 12:19
  5. Qt-x11-commercial-src-4.2.0-snapshot-20060824 error
    By DevObject in forum Installation and Deployment
    Replies: 4
    Last Post: 24th August 2006, 23:31

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.