From 33a2b885b525c12281bac279410c610f08123bf6 Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Fri, 25 Mar 2011 16:57:11 -0300 Subject: [PATCH] useless feature --- src/framework/x11platform.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/framework/x11platform.cpp b/src/framework/x11platform.cpp index 5b90b569..f0ad5dde 100644 --- a/src/framework/x11platform.cpp +++ b/src/framework/x11platform.cpp @@ -297,20 +297,27 @@ void Platform::poll() switch(event.type) { case ConfigureNotify: // window resize - if(x11.width != event.xconfigure.width || x11.height != event.xconfigure.height) { + static int oldWidth = -1; + static int oldHeight = -1; + if(oldWidth != event.xconfigure.width || oldHeight != event.xconfigure.height) { + g_engine.onResize(event.xconfigure.width, event.xconfigure.height); + oldWidth = event.xconfigure.width; + oldHeight = event.xconfigure.height; + } + + if(!isWindowMaximized()) { x11.width = event.xconfigure.width; x11.height = event.xconfigure.height; - g_engine.onResize(x11.width, x11.height); - } - // hack to fix x11 windows move gaps - static int gap_x = -1, gap_y = -1; - if(gap_x == -1 && gap_y == -1) { - gap_x = event.xconfigure.x; - gap_y = event.xconfigure.y; + // hack to fix x11 windows move gaps + static int gap_x = -1, gap_y = -1; + if(gap_x == -1 && gap_y == -1) { + gap_x = event.xconfigure.x; + gap_y = event.xconfigure.y; + } + x11.x = event.xconfigure.x - gap_x; + x11.y = event.xconfigure.y - gap_y; } - x11.x = event.xconfigure.x - gap_x; - x11.y = event.xconfigure.y - gap_y; break; case KeyPress: