GNOME Bugzilla – Bug 764180
Dragging from fullscreen title to normal mode always places window at the left edge of the screen
Last modified: 2016-08-19 11:54:55 UTC
This is working correctly under X11, so I assume an error related to Wayland. Tested this behaviour with Nautilus and Terminal. Xwayland programs (like Google Chrome) and GTK under X11 correctly put the windows underneath the cursor.
I fail to reproduce this, dragging a maximized Nautilus window restores its size and place the window under the mouse pointer here.
Maybe I see what you mean. Dragging a maximized window from the right end of the title bar makes the window appear way too far on the left, with the pointer sitting outside the un-maximized window. It looks like the position of the window is not set relative to the un-maximized width, like mutter does for X11.
(In reply to Olivier Fourdan from comment #2) > Maybe I see what you mean. > > Dragging a maximized window from the right end of the title bar makes the > window appear way too far on the left, with the pointer sitting outside the > un-maximized window. > > It looks like the position of the window is not set relative to the > un-maximized width, like mutter does for X11. That's what I meant. However, for me it looks like it is always put to the left and is then relatively following the pointer. Another observation I just made and that may help: When I move the cursor pixel by pixel, the first position is correct and it only goes wrong when moving the pointer further on...
However it's not gtk+ who implements this (neither gtk nor gdk or its Wayland backend) but mutter/gnome-shell, so it's most likely a bug in mutter. The same problem occurs with weston-terminal for example, and it's not based on gtk+ => Moving to mutter.
Created attachment 324751 [details] Small screencast Screencast of the issue demonstrating the problem with both an gtk+ based app (NAutilus) and a non-gtk based app (weston-terminal).
Is there anyone looking into this? I could also try to fix it myself, if you can give me some hints but I'm not very experienced with debugging GNOME...
Created attachment 329688 [details] [review] [PATCH] wayland: Mark pending moved as moved The result flag needs to be marked as moved even for pending moves, otherwise the window's unconstrained_rect doesn't get updated in meta_window_move_resize_internal() and the anchor grab is wrong.
This patch fixes the issue here.
Review of attachment 329688 [details] [review]: looks good ::: src/wayland/meta-window-wayland.c @@ +311,3 @@ if (new_x != window->rect.x || new_y != window->rect.y) { + *result |= META_MOVE_RESIZE_RESULT_MOVED; At first I was worried because this will make us emit MetaWindow::position-changed when the window hasn't actually moved yet. But, consumers of that signal have to query the position anyway so they're still going to see the old position which shouldn't cause any issues. Any other solution would have to be updating display->grab_anchor_window_pos later when we no longer know about the unmaximize() call so we'd need more state to track it for no added benefit.
Thanks! Do you want me to push that to master only or in 'gnome-3-20' as well?
I think it's safe enough for 3.20 and it's a nice polish fix so, yes please.
Comment on attachment 329688 [details] [review] [PATCH] wayland: Mark pending moved as moved attachment 329688 [details] [review] pushed as commit 989ec7f in master - wayland: Mark pending moved as moved attachment 329688 [details] [review] pushed as commit b2bf301 in branch gnome-3-20 - wayland: Mark pending moved as moved
Done, thanks!
*** Bug 767029 has been marked as a duplicate of this bug. ***