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

Window move of gnome nautilus using mouse drag on title causes jump of window #2507

Open
zougloub opened this issue Oct 31, 2024 · 6 comments · May be fixed by #2509
Open

Window move of gnome nautilus using mouse drag on title causes jump of window #2507

zougloub opened this issue Oct 31, 2024 · 6 comments · May be fixed by #2509
Labels

Comments

@zougloub
Copy link

zougloub commented Oct 31, 2024

Maybe same root cause as #2505 ?

test-2507.mp4

As part of troubleshooting an issue, we found out that when I try to drag a gnome window (eg. nautilus, gnome-calculator) from its titlebar using the mouse:

  • when the motion is initiated, the window jumps in the screen (it should stay in place)
  • when the motion continues, the relative motion follows the mouse cursor motion, but the absolute position is wrong due to the initial offset

** Repro steps **

  1. Desktop computer, connect one screen (HDMI), connect one regular mouse, no keyboard
  2. Configuration, reduced down to:
[autostart]
autostart_wf_shell = false
firefox = firefox
nautilus = nautilus

[core]
plugins = autostart move gtk-shell foreign-toplevel wayfire-shell
  1. Start wayfire ; firefox and nautilus start
  2. Move firefox from title bar with mouse -> 🆗
  3. Move nautilus in the same way -> 🆖

Wayfire version: wayfire master branch ; X11 disabled

@zougloub zougloub added the bug label Oct 31, 2024
@zougloub
Copy link
Author

zougloub commented Nov 2, 2024

Reduced configuration; updating description.

@soreau
Copy link
Member

soreau commented Nov 3, 2024

I can reproduce this with gtk4-demo, but not gtk3-demo. It seems to be specific to gtk4 applications.

@soreau
Copy link
Member

soreau commented Nov 3, 2024

I have gnome-calculator (gtk4) working without jumping positions on titlebar grab-drag with the following configuration:

[autostart]
autostart_wf_shell = true
calculator = gnome-calculator

[core]
plugins = autostart move grid wobbly

[grid]
type = wobbly

With [grid] type = anything-other-than-wobbly, the bug happens. The bug also happens if either wobbly or grid are disabled in the config. The problem reportedly does not happen with mod+drag to initiate move. This can be reproduced in a nested wayland backend session.

@soreau
Copy link
Member

soreau commented Nov 3, 2024

Preliminary patch to fix this issue.

It seems that in the gtk4 case, a request_fullscreen request is sent by the client and wayfire tries to set a geometry, even if the state is already the requested state. This causes the problem when dragging by titlebar. The patch returns early if the fullscreen state is already the requested state.

@zougloub
Copy link
Author

zougloub commented Nov 3, 2024

FWIW the patch works for me.

@soreau
Copy link
Member

soreau commented Nov 3, 2024

FWIW the patch works for me.

Sounds good, I'll make a PR for it.

soreau added a commit that referenced this issue Nov 6, 2024
This fixes dragging gtk4 apps with grid and/or wobbly disabled. The gtk4
toolkit sends a request for unfullscreen even though it is windowed, and
this caused wayfire to set the geometry when dragging by titlebar, which
made the window jump to an offset when grabbing the titlebar to move it.

Fixes #2507.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants