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 639988 - Problems with window tiling when a drag is cancelled
Problems with window tiling when a drag is cancelled
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2011-01-19 20:35 UTC by Florian Müllner
Modified: 2011-01-20 17:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window: Make meta_window_tile() semi-public (1.67 KB, patch)
2011-01-19 20:35 UTC, Florian Müllner
committed Details | Review
display: Keep track of the original tile state during drag (2.80 KB, patch)
2011-01-19 20:35 UTC, Florian Müllner
committed Details | Review
Hide tile preview when cancelling a drag with Escape (1.25 KB, patch)
2011-01-19 20:35 UTC, Florian Müllner
reviewed Details | Review
Restore the original tile state when a drag is cancelled (1.64 KB, patch)
2011-01-19 20:35 UTC, Florian Müllner
committed Details | Review
screen: Add a method to hide the tile preview unconditionally (1.80 KB, patch)
2011-01-19 21:43 UTC, Florian Müllner
committed Details | Review
Hide tile preview when cancelling a drag with Escape (1.17 KB, patch)
2011-01-19 21:46 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2011-01-19 20:35:00 UTC
When cancelling a drag operation with Escape, window tiling does not
behave correctly:

 (1) the tile preview may still stick around after the drag was
     cancelled

 (2) if the window was tiled when the drag was started, the original
     state is not restored
Comment 1 Florian Müllner 2011-01-19 20:35:03 UTC
Created attachment 178775 [details] [review]
window: Make meta_window_tile() semi-public

The previous tiling state of a grabbed window should be restored
if the drag operation is cancelled (by hitting the Escape key).
This might involve to meta_window_tile(), so export the function
in window-private.h.
Comment 2 Florian Müllner 2011-01-19 20:35:06 UTC
Created attachment 178776 [details] [review]
display: Keep track of the original tile state during drag

Drag operations may be cancelled, in which case the dragged window
should be restored to the position/state it had when the drag was
initialized. In order to do this for tiled states, the original
state has to be saved during the operation.
Comment 3 Florian Müllner 2011-01-19 20:35:10 UTC
Created attachment 178777 [details] [review]
Hide tile preview when cancelling a drag with Escape

As the tile preview is shown or hidden when a window is dragged
around, it may stick around if the drag operation is cancelled.
Make sure that the preview is hidden in this case.
Comment 4 Florian Müllner 2011-01-19 20:35:14 UTC
Created attachment 178778 [details] [review]
Restore the original tile state when a drag is cancelled

If a drag operation is cancelled, the dragged window should be
restored to its previous state/position. Implement this for tiled
states.
Comment 5 Owen Taylor 2011-01-19 20:47:42 UTC
Review of attachment 178775 [details] [review]:

Sure
Comment 6 Owen Taylor 2011-01-19 20:48:51 UTC
Review of attachment 178776 [details] [review]:

Looks fine
Comment 7 Owen Taylor 2011-01-19 20:51:23 UTC
Review of attachment 178777 [details] [review]:

::: src/core/keybindings.c
@@ +1556,3 @@
+        {
+          window->tile_mode = META_TILE_NONE;
+          meta_screen_tile_preview_update (screen, FALSE);

Ugly, but if this is the best way to do it, then OK. It wouldn't be better to add a explicit meta_screen_hide_tile_preview() or something? If left like this, you should add a comment here explaining that the tile mode will be fixed back up later, and maybe this needs to be merged with the next patch which actually does the fixup as I understand it?
Comment 8 Owen Taylor 2011-01-19 20:52:12 UTC
Review of attachment 178778 [details] [review]:

Looks fine
Comment 9 Florian Müllner 2011-01-19 21:43:40 UTC
Created attachment 178785 [details] [review]
screen: Add a method to hide the tile preview unconditionally

Add meta_screen_tile_preview_hide() to hide the tile preview
independent from the tile state of the dragged window.

(In reply to comment #7)
> Ugly, but if this is the best way to do it, then OK. It wouldn't be better to
> add a explicit meta_screen_hide_tile_preview() or something?

Yeah, looks nicer ...
Comment 10 Florian Müllner 2011-01-19 21:46:22 UTC
Created attachment 178787 [details] [review]
Hide tile preview when cancelling a drag with Escape

(In reply to comment #7)
> maybe this needs to be merged with the next patch which actually
> does the fixup as I understand it?

Could be merged, but there are actually two problems to fix: first the preview sticking around (fixed here) and the tile state not being restored (fixed in attachment 178778 [details] [review]).
Comment 11 Owen Taylor 2011-01-19 21:49:30 UTC
Review of attachment 178787 [details] [review]:

Looks good. (The reason I suggested merging was that the old version would have left things in a more inconsistent state without the other patch as I read it.)
Comment 12 Owen Taylor 2011-01-20 17:47:41 UTC
Review of attachment 178785 [details] [review]:

Looks fine
Comment 13 Florian Müllner 2011-01-20 17:50:31 UTC
Attachment 178775 [details] pushed as 5806826 - window: Make meta_window_tile() semi-public
Attachment 178776 [details] pushed as 2861606 - display: Keep track of the original tile state during drag
Attachment 178778 [details] pushed as 2eb8b09 - Restore the original tile state when a drag is cancelled
Attachment 178785 [details] pushed as 53d6938 - screen: Add a method to hide the tile preview unconditionally
Attachment 178787 [details] pushed as bca610e - Hide tile preview when cancelling a drag with Escape