| Summary: | GetWindowPosition returns wrong position after resize | ||
|---|---|---|---|
| Product: | SDL | Reporter: | cra0zy <cra0zy> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | icculus, jwyatt |
| Version: | 2.0.4 | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Attachments: |
Translate to root window coordinates patch.
Translate to root window coordinates patch 2 |
||
|
Description
cra0zy@gmail.com
2016-02-26 16:46:30 UTC
This also happens for fullscreen windows. I think the issue is that GNOME inserts a parent window above the fullscreen or resized window (check the output of xwininfo -root -tree). SDL seems to just take the coordinates directly from the attributes returned by XGetWindowAttributes - these will be relative to this parent window. Created attachment 2389 [details]
Translate to root window coordinates patch.
I haven't tested this much, however it fixes the resize issue for me.
(In reply to Jason Wyatt from comment #2) > Created attachment 2389 [details] > Translate to root window coordinates patch. > > I haven't tested this much, however it fixes the resize issue for me. Oops, this patch is very incomplete, and won't resolve the issue. Sorry about that. Created attachment 2390 [details] Translate to root window coordinates patch 2 Turns out the coordinates in ConfigureNotify can vary depending on whether it is a synthetic event (relative to root) or a real event (relative to parent). See https://tronche.com/gui/x/icccm/sec-4.html#s-4.1.5 How long will it take for the fix to get merged upstream? (In reply to Jason Wyatt from comment #4) > Turns out the coordinates in ConfigureNotify can vary depending on whether > it is a synthetic event (relative to root) or a real event (relative to > parent). See https://tronche.com/gui/x/icccm/sec-4.html#s-4.1.5 This patch is now https://hg.libsdl.org/SDL/rev/89656c085088, thanks! --ryan. |