Repository navigation
Fix x11 Window::get_position wrong values - #386
Merged
Merged
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.
Contributor
|
Don't we require the parent window at initialization? I feel like this new function is a bit useless? |
Contributor
Author
|
@tomaka |
Contributor
|
Sorry, I was thinking about the |
Member
|
@tomaka That function is vital for the new logic implemented here, as it's used to climb the window hierarchy in a loop. |
francesca64
self-requested a review
January 26, 2018 23:22
francesca64
approved these changes
Jan 26, 2018
francesca64
left a comment
Member
There was a problem hiding this comment.
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.
alexheretic
added a commit
to alexheretic/winit
that referenced
this pull request
Feb 7, 2018
Fix rust-windowing#398 This reverts commit 150d270.
sodiumjoe
pushed a commit
to sodiumjoe/winit
that referenced
this pull request
Mar 19, 2018
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.
tmfink
pushed a commit
to tmfink/winit
that referenced
this pull request
Jan 5, 2022
tmfink
pushed a commit
to tmfink/winit
that referenced
this pull request
Jan 5, 2022
Implement gradient wrap/spread modes in SVG. Closes rust-windowing#386.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.