I'm fighting a particularly vicious bug in Qt: In the animated tiles example, when moving mouse, animation jerks/stops. It is really puzzling me because:
1) Disabling mouse events from intuition doesn't remove the problem (I have tried disabling both MOUSEMOVE, MOUSBUTTONS, ReportMouse, EXTENDEDMOUSE events).
2) Searching for code that reads the MouseX and MouseY variables from screens and windows doesn't turn up anything.
3) Thinking about stuff, that I have changed in the code doesn't give me anything tangible. In particular, turning the "native" stuff off doesn't get rid of the problem.
I'm hoping, that some wise person can enlighten my troubled mind...
1) Disabling mouse events from intuition doesn't remove the problem (I have tried disabling both MOUSEMOVE, MOUSBUTTONS, ReportMouse, EXTENDEDMOUSE events).
I'm not that much of an Intuition expert but I'll have a guess.
"Disabling mouse events" actually means disabling the reporting of mouse events to your application window's IDCMP port. But the events still get reported to Intuition (otherwise things like Workbench couldn't work), so there's always some system overhead associated with the use of the mouse. Plus, the mouse pointer is no longer drawn by a special hardware circuit (as it used to be on the original Amiga). So perhaps the graphic subsystem gets strained too much in the context of your application, causing jerkiness?
The problem is, that it used to work fluently. I have just checked with an earlier version of qt (which had luckily survived on my hd), and it shows no problems jerkiness in that perticular example.
I guess I will have to roll back my changes and reimplement everything to see, if I can track down the bug that way. What a drag...
And yes, I did figure it out at last: When asking for screen dimensions, I used a seemingly very time expensive call to LockPubScreen. Apparently this one example is calling QDesktopWidget::screenDimensions all the time, and this caused the slowness. It is still a bit strange, though, that it only slows down when the mouse is moving, but hey.
Instead I just buffer the screen dims at entry, and woopie, the slowness is gone. Great...
Maybe its not so strange at all... LockPubScreen() locks the screen bitmap, and it does so even for Intuition. If Intuition tries to draw the mouse pointer, it is blocked for the time you hold the lock to the screen.
I dont know much about internal workings, but it seems to me that Intuition (due to its higher priority) first redraws the mouse pointer (and traverses the display refresh lists) before it gives control back to your code.
For Intuition screens its not very wise to get the screen dimensions repeatedly, as long as your program has control over this particular screen. It wont close or change dimensions until you tell Intuition to do so
Maybe some cache mechanism would do the trick, but this might be not as portable as it should be, as most GUI systems lack certain Intuition features...