-
Notifications
You must be signed in to change notification settings - Fork 903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix x11 Window::get_position wrong values #386
Conversation
Some window managers like i3wm will actually nest application windows (like those opened by winit) within other windows to, for example, add decorations. Initially when debugging this method on i3, the x and y positions were always returned as "2". The solution that other xlib abstractions use is to climb up the window hierarchy until just below the root window, and that window must be used to determine the appropriate position. This patch doesn't take into account borders or the window's offset within its parent, but it's much more usable than the original implementation on certain WMs.
Don't we require the parent window at initialization? I feel like this new function is a bit useless? |
@tomaka |
Sorry, I was thinking about the |
@tomaka That function is vital for the new logic implemented here, as it's used to climb the window hierarchy in a loop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks perfect.
In testing this, get_position
used to always return (1, 28)
for me, whereas now it returns accurate values, so this is a big improvement.
Fix rust-windowing#398 This reverts commit 150d270.
Some window managers like i3wm will actually nest application windows (like those opened by winit) within other windows to, for example, add decorations. Initially when debugging this method on i3, the x and y positions were always returned as "2". The solution that other xlib abstractions use is to climb up the window hierarchy until just below the root window, and that window must be used to determine the appropriate position. This patch doesn't take into account borders or the window's offset within its parent, but it's much more usable than the original implementation on certain WMs.
Implement gradient wrap/spread modes in SVG. Closes rust-windowing#386.
Some window managers like i3wm will actually nest application windows
(like those opened by winit) within other windows to, for example, add
decorations. Initially when debugging this method on i3, the x and y
positions were always returned as "2".
The solution that other xlib abstractions use is to climb up the window
hierarchy until just below the root window, and that window must be used
to determine the appropriate position.
This patch doesn't take into account borders or the window's offset
within its parent, but it's much more usable than the original
implementation on certain WMs.