Because some unfortunate code in the Windows platform plugin generates expose 
events even when the size has not changed. This is of course wrong. It will be 
corrected by https://codereview.qt-project.org/#/c/103932


Cheers,

Laszlo


________________________________
From: development-bounces+laszlo.agocs=theqtcompany....@qt-project.org 
<development-bounces+laszlo.agocs=theqtcompany....@qt-project.org> on behalf of 
Trent Reed <treed0...@gmail.com>
Sent: Sunday, January 18, 2015 6:04 AM
To: development@qt-project.org
Subject: [Development] Under Windows QWindow receiving QExposeEvent on window 
drag.

I am attempting to animate a QOpenGLWindow, so I'm connecting 
SIGNAL(frameSwapped()) with SLOT(update()) to force update on vsync as 
recommended in the documentation. So far so good, under *nix OSes this works 
fine. (Tested on x64 Ubuntu and OS X)

But on Windows, when dragging a window around, the QExposeEvent gets sent out 
while dragging the window, causing the window to lag noticeably. (This does NOT 
happen on *nix OSes!)

I am able to "hack" a fix by caching the previous QRegion in my derived 
QOpenGLWindow class, and checking to see if the new exposeEvent->region() is 
the same as the cached QRegion. If the cached region is the same, I ignore the 
event. If they are different, I pass it down to QOpenGLWindow. This appears to 
fix the problem.

Here is my change that fixes the problem under my own project: 
https://github.com/TReed0803/QtOpenGL/commit/f243e879b1d639fd838deffd6b2ca095062addc1

I feel I shouldn't have to do this, it seems kind of hacky. Is this a bug?

Thanks,
- Trent Reed
_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to