Skip to content

Commit

Permalink
ecere/gui/drivers/XInterface: (#850) Fixed re-maximized window positi…
Browse files Browse the repository at this point in the history
…on 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).
  • Loading branch information
jerstlouis committed Apr 29, 2014
1 parent a0c0905 commit 2b79321
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ecere/src/gui/drivers/XInterface.ec
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 2b79321

Please sign in to comment.