From: Jerome St-Louis Date: Thu, 10 Jul 2014 02:31:16 +0000 (-0400) Subject: ecere/gui/XInterface: Not 'unmaximizing' on setting initial state X-Git-Tag: 0.44.10PR1~49 X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=commitdiff_plain;h=47ec099c66b434f6437b453f3cc4d62bae3ae5d0 ecere/gui/XInterface: Not 'unmaximizing' on setting initial state - This works around a bug in Gnome Shell, Mutter (#732978), Metacity, Cinnamon... where the reload dialog box from a lower IDE would resurface to the top --- diff --git a/ecere/src/gui/drivers/XInterface.ec b/ecere/src/gui/drivers/XInterface.ec index c5271ea..eac0b95 100644 --- a/ecere/src/gui/drivers/XInterface.ec +++ b/ecere/src/gui/drivers/XInterface.ec @@ -2999,6 +2999,8 @@ class XInterface : Interface void SetRootWindowState(Window window, WindowState state, bool visible) { + WindowState curState = window.state; + *&window.state = state; // Old WM (e.g. TWM), use built-in decorations if(!atomsSupported[_net_wm_state]) window.nativeDecorations = false; @@ -3088,8 +3090,10 @@ class XInterface : Interface if(atomsSupported[_net_wm_state]) { // Maximize / Restore the window - SetNETWMState((X11Window)window.windowHandle, true, state == maximized ? add : remove, - atoms[_net_wm_state_maximized_vert], atoms[_net_wm_state_maximized_horz]); + if(curState != state) + SetNETWMState((X11Window)window.windowHandle, true, state == maximized ? add : remove, + atoms[_net_wm_state_maximized_vert], atoms[_net_wm_state_maximized_horz]); + if(state == maximized) { // Prevent the code in ConfigureNotify to think the window has been unmaximized @@ -3107,6 +3111,7 @@ class XInterface : Interface } //XFlush(xGlobalDisplay); } + *&window.state = curState; } void FlashRootWindow(Window window)