From 2b79321f788a9da837e852e0155b7389f431953e Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Tue, 29 Apr 2014 05:09:12 -0400 Subject: [PATCH] ecere/gui/drivers/XInterface: (#850) Fixed re-maximized window position confusion - The problem would occur on Unity after unmaximizing, moving, then maximizing a window, mouse events would then be reported at the wrong location. - This was caused by great convolution regarding the 'x' and 'y' members of XConfigureEvents having a different meaning depending on the value of 'send_event', which the X11 books, tronche.com API reference as well as the man pages said nothing about. Found out the hard way that, as the ICCCM puts it in section 4.1.5 "The general rule is that coordinates in real ConfigureNotify events are in the parent's space; in synthetic events, they are in the root space." - Had previous suspected something like this, as the bool 'offset' variable left in the code shows, but had not fully understood what was going on (understandably, givin how non-sensical this design decision was and the conflicting and all split up documentation). --- ecere/src/gui/drivers/XInterface.ec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ecere/src/gui/drivers/XInterface.ec b/ecere/src/gui/drivers/XInterface.ec index 4e65cf9007..3bc60dc442 100644 --- a/ecere/src/gui/drivers/XInterface.ec +++ b/ecere/src/gui/drivers/XInterface.ec @@ -2174,10 +2174,12 @@ class XInterface : Interface if(x != rootX || y != rootY) { - /*if(event->send_event) - offset = true;*/ - x = rootX; - y = rootY; + if(!event->send_event) + { + // offset = true; + x = rootX; + y = rootY; + } } }