From 1530d97f6d6dd0b8136b63e116f48a7ffece3b20 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Thu, 29 Aug 2013 00:34:33 -0400 Subject: [PATCH] ecere/gui/X11: Further fixes related to #850 - Fixed broken anchors - Fixed restore from maximized --- ecere/src/gui/drivers/XInterface.ec | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/ecere/src/gui/drivers/XInterface.ec b/ecere/src/gui/drivers/XInterface.ec index ac3a426..0146d46 100644 --- a/ecere/src/gui/drivers/XInterface.ec +++ b/ecere/src/gui/drivers/XInterface.ec @@ -1873,6 +1873,8 @@ class XInterface : Interface extents[1] != windowData.decor.right || extents[2] != windowData.decor.top || extents[3] != windowData.decor.bottom; + + bool hadFrameExtents = windowData.gotFrameExtents; windowData.decor = { left = (int)extents[0], right = (int)extents[1], @@ -1881,13 +1883,20 @@ class XInterface : Interface windowData.gotFrameExtents = true; if(change) { - int x, y, w, h; - window.ComputeAnchors( - window.normalAnchor, - window.normalSizeAnchor, - &x, &y, &w, &h); - window.Position(x, y, w, h, true, true, true, true, false, false); - UpdateRootWindow(window); + int x = window.position.x, y = window.position.y, w = window.size.w, h = window.size.h; + if(!hadFrameExtents && window.state != maximized) + { + window.ComputeAnchors( + window.normalAnchor, + window.normalSizeAnchor, + &x, &y, &w, &h); + } + + if(!hadFrameExtents) + { + window.Position(x, y, w, h, true, true, true, true, false, !hadFrameExtents && window.state != maximized); + UpdateRootWindow(window); + } } XFree(data); } -- 1.8.3.1