From: Jerome St-Louis Date: Sat, 15 Feb 2014 22:05:14 +0000 (-0800) Subject: ecere/gui: (#992) Fix for coming back from fullscreen on Cinnamon X-Git-Tag: 0.44.09.9~34 X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=commitdiff_plain;h=be0f3024e29b5b3ad45b43cae0e89bf4e2ba4fa4 ecere/gui: (#992) Fix for coming back from fullscreen on Cinnamon - (occasional wrong stacking of windows) --- diff --git a/ecere/src/gui/GuiApplication.ec b/ecere/src/gui/GuiApplication.ec index 74f18c2..3be36b3 100644 --- a/ecere/src/gui/GuiApplication.ec +++ b/ecere/src/gui/GuiApplication.ec @@ -411,12 +411,26 @@ public class GuiApplication : Application // Maximized native decorations windows suffer when we drag the dock around, so remaximize them // It's a little jumpy, but oh well. + + // Made this Windows only as it was causing occasional wrong stacking of windows in X11/Cinnamon + // when switching debugged app from full-screen + for(child = desktop.children.first; child; child = child.next) { if(child.nativeDecorations && child.rootWindow == child && child.state == maximized) { +#if defined(__WIN32__) child.state = normal; child.state = maximized; +#else + if(child.active) + { + child.state = normal; + child.state = maximized; + } + else + child.requireRemaximize = true; +#endif } } /*for(child = desktop.children.first; child; child = child.next) diff --git a/ecere/src/gui/Window.ec b/ecere/src/gui/Window.ec index 3f3c534..110fec7 100644 --- a/ecere/src/gui/Window.ec +++ b/ecere/src/gui/Window.ec @@ -3458,6 +3458,15 @@ private: if(rootWindow == this) Log(active ? "active\n" : "inactive\n"); */ + if(active && requireRemaximize) + { + if(state == maximized) + { + property::state = normal; + property::state = maximized; + } + requireRemaximize = false; + } // Testing this here... if(!parent || parent == guiApp.desktop || parent.active) @@ -9571,6 +9580,7 @@ private: bool nativeDecorations:1; bool manageDisplay:1; bool formDesigner:1; // True if we this is running in the form editor + bool requireRemaximize:1; }; // Checks used internally for them not to take effect in FormDesigner