-
Notifications
You must be signed in to change notification settings - Fork 180
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
xwayland: Use configure request mask to position surfaces #308
Conversation
461e461
to
95c2ce2
Compare
src/view/xwayland.cpp
Outdated
if ((ev->mask & XCB_CONFIG_WINDOW_X) && (ev->mask & XCB_CONFIG_WINDOW_Y)) | ||
{ | ||
self_positioned = true; | ||
} else { |
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.
Why do we need the else here? Wlroots will already set x and y to xsurface->x/y
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.
This is needed or else xterm is placed at 0,0 instead of 100,100 without place enabled.
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.
Okay but this is still wrong because ev->x/y is supposed to be global coordinates, and geometry.x/y is geometry relative to the view output.
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.
Should be fixed now.
src/view/xwayland.cpp
Outdated
|
||
/* Freely-floating X windows might have set a geometry hint, try to | ||
* take this into account */ | ||
if (!tiled_edges && !fullscreen && !parent && !self_positioned) |
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.
I just realize this, but we may not need this at all. Can you try removing the if and its contents?
My logic is the following: if we had a configure request before mapping, we have already applied it so the view is at the correct place.
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.
This is needed or else xterm is placed as if it doesn't have decorations, without place enabled.
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.
As discussed on IRC, it doesn't really matter if place is disabled.
9add43f
to
6bad967
Compare
The mask contains information about whether or not to use the position and size fields. Since size is determined by commit, we only concern ourselves with the position here. This requires wlroots #1843. This fixes bugs with positioning xwayland surfaces with and without place plugin enabled. Fixes #307. Thanks to ammen99 for the initial work on this.
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.
LGTM, thanks!
The mask contains information about whether or not to use the
position and size fields. Since size is determined by commit,
we only concern ourselves with the position here. This requires
wlroots #1843. This fixes bugs with positioning xwayland surfaces
with and without place plugin enabled. Fixes #307.