Skip to content
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

linux/x11: Ignore bounds.origin on resize event #12604

Merged
merged 1 commit into from
Jun 3, 2024
Merged

Conversation

mrnugget
Copy link
Member

@mrnugget mrnugget commented Jun 3, 2024

This fixes #11236 by ignoring the bounds.origin values when the window is only being resized.

The cause for the issue was that the ConfigureNotify event would contain "wrong" values when the window was being resized (by dragging a corner).

In my case it would always contain x:14/y:49, which is I think might map to the origin of the top bar in GNOME.

We would then persist these wrong values when serializing the workspace. On restart, we'd use these values and end up with the window decorations in the wrong place.

What I still don't know:

  1. What exactly the 14/49 map to, because it's not the origin of the top bar in GNOME. I also tried the X11 TranslateCoordinates call but couldn't get meaningful results back (even taking scale factor into account).
  2. Why the window decorations end up looking wrong vs. the window being in the first place. But if you look at my screenshot in Window Content Misaligned From Decorations on X11 Linux #11236, it looks like the decorations are off exactly by 14/49px.

That being said, I think the solution here is a good one for now: we don't do an additional X11 call and when we're resizing, we're not interested in the origin changing.

Release Notes:

  • N/A

Proof:

Screencast.from.2024-06-03.15-08-36.webm

This fixes #11236 by ignoring the `bounds.origin` values when the window
is only being resized.

The cause for the issue was that the `ConfigureNotify` event would
contain "wrong" values when the window was being resized (by dragging a
corner).

In my case it would *always* contain x:14/y:49, which is I
think maps to the origin of the top bar in GNOME.

We would then persist these wrong values when serializing the workspace.
On restart, we'd use these values and end up with the window decorations
in the wrong place.

What I still don't know:
1. What exactly the 14/49 map to, because it's not the origin of the top
   bar in GNOME. I also tried the X11 TranslateCoordinates call but
   couldn't get meaningful results back (even taking scale factor into
   account).
2. Why the window decorations end up looking wrong vs. the window being
   in the first place. But if you look at my screenshot in #11236, it
   looks like the decorations are off exactly by 14/49px.

That being said, I think the solution here is a good one for now: we
don't do an additional X11 call and when we're resizing, we're not
interested in the origin changing.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jun 3, 2024
@mrnugget mrnugget added the linux label Jun 3, 2024
@mrnugget mrnugget merged commit 338df5d into main Jun 3, 2024
9 checks passed
@mrnugget mrnugget deleted the linux-x11-resize branch June 3, 2024 14:25
@someone13574
Copy link
Contributor

Works for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Window Content Misaligned From Decorations on X11 Linux
2 participants