It is not guaranteed that the WM will always send a synthetic ConfigureNotify 
event after changing the geometry. As ICCCM 4.1.5 suggests, the WM may not send 
a synthetic configure notify event if the window is resized for real. In that 
case, the client needs to use the TranslateCoordinates() request in order to 
determine the position of its window in the global coordinate space.

However, it does so only with certain WMs. Some digging in the JDK history 
shows that AWT used to assume that synthetic configure notify events are always 
sent, however it was not the case with WMs such as Metacity so the switch 
statement was added. I don't know exactly why the new code path had been 
enabled only with handful of WMs, perhaps it was done to play safe or as an 
optimization. But, in general, as the TODO comment and the ICCCM spec say, this 
code needs to be enabled regardless of the WM.

-------------

Commit messages:
 - 8342785: Make AWT adhere to ICCCM 4.1.5 with all WMs

Changes: https://git.openjdk.org/jdk/pull/21632/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21632&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8342785
  Stats: 22 lines in 1 file changed: 0 ins; 16 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/21632.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21632/head:pull/21632

PR: https://git.openjdk.org/jdk/pull/21632

Reply via email to