Skip to content

Commit

Permalink
Window Manager: Only perform resize callback when size changes
Browse files Browse the repository at this point in the history
Let's see if this has any impact on the "recursive repaint" issue on
Windows.
  • Loading branch information
skyjake committed Dec 14, 2012
1 parent 690ce76 commit 1f666d7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions doomsday/engine/src/ui/canvas.cpp
Expand Up @@ -67,6 +67,7 @@ struct Canvas::Instance
{
Canvas* self;
bool initNotified;
QSize currentSize;
void (*initCallback)(Canvas&);
void (*drawCallback)(Canvas&);
void (*resizedCallback)(Canvas&);
Expand Down Expand Up @@ -284,13 +285,19 @@ void Canvas::initializeGL()
Sys_GLConfigureDefaultState();
}

void Canvas::resizeGL(int /*w*/, int /*h*/)
void Canvas::resizeGL(int w, int h)
{
//qDebug() << "Canvas: resized" << w << "x" << h;
QSize newSize(w, h);

if(d->resizedCallback)
// Only react if this is actually a resize.
if(d->currentSize != newSize)
{
d->resizedCallback(*this);
d->currentSize = newSize;

if(d->resizedCallback)
{
d->resizedCallback(*this);
}
}
}

Expand Down

0 comments on commit 1f666d7

Please sign in to comment.