After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 764180 - Dragging from fullscreen title to normal mode always places window at the left edge of the screen
Dragging from fullscreen title to normal mode always places window at the lef...
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 767029 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-03-25 08:52 UTC by Jonas Hahnfeld
Modified: 2016-08-19 11:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Small screencast (900.44 KB, video/ogg)
2016-03-25 13:04 UTC, Olivier Fourdan
  Details
[PATCH] wayland: Mark pending moved as moved (1.08 KB, patch)
2016-06-13 12:04 UTC, Olivier Fourdan
committed Details | Review

Description Jonas Hahnfeld 2016-03-25 08:52:06 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.
Comment 1 Olivier Fourdan 2016-03-25 09:19:56 UTC
I fail to reproduce this, dragging a maximized Nautilus window restores its size and place the window under the mouse pointer here.
Comment 2 Olivier Fourdan 2016-03-25 09:30:55 UTC
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.
Comment 3 Jonas Hahnfeld 2016-03-25 11:07:49 UTC
(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...
Comment 4 Olivier Fourdan 2016-03-25 12:29:40 UTC
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.
Comment 5 Olivier Fourdan 2016-03-25 13:04:43 UTC
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).
Comment 6 Jonas Hahnfeld 2016-06-11 13:53:42 UTC
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...
Comment 7 Olivier Fourdan 2016-06-13 12:04:56 UTC
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.
Comment 8 Olivier Fourdan 2016-06-13 12:05:49 UTC
This patch fixes the issue here.
Comment 9 Rui Matos 2016-06-13 15:16:55 UTC
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.
Comment 10 Olivier Fourdan 2016-06-13 15:34:33 UTC
Thanks! Do you want me to push that to master only or in 'gnome-3-20' as well?
Comment 11 Rui Matos 2016-06-13 16:20:23 UTC
I think it's safe enough for 3.20 and it's a nice polish fix so, yes please.
Comment 12 Olivier Fourdan 2016-06-13 18:18:30 UTC
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
Comment 13 Olivier Fourdan 2016-06-13 18:18:46 UTC
Done, thanks!
Comment 14 Rui Matos 2016-08-19 11:54:55 UTC
*** Bug 767029 has been marked as a duplicate of this bug. ***