WayfireWM / wayfire

A modular and extensible wayland compositor
https://wayfire.org/
MIT License
2.42k stars 179 forks source link

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

Closed zougloub closed 1 week ago

zougloub commented 3 weeks ago

Maybe same root cause as #2505 ?

https://github.com/user-attachments/assets/74c8dff7-59ca-47ba-9ab2-f89b7154eec4

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:

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


2. Start wayfire ; firefox and nautilus start
3. Move firefox from title bar with mouse -> :ok: 
4. Move nautilus in the same way -> :ng: 

Wayfire version: wayfire master branch ; X11 disabled
zougloub commented 2 weeks ago

Reduced configuration; updating description.

soreau commented 2 weeks ago

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

soreau commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

FWIW the patch works for me.

soreau commented 2 weeks ago

FWIW the patch works for me.

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