GNOME Bugzilla – Bug 639988
Problems with window tiling when a drag is cancelled
Last modified: 2011-01-20 17:50:47 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
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.
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.
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.
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.
Review of attachment 178775 [details] [review]: Sure
Review of attachment 178776 [details] [review]: Looks fine
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?
Review of attachment 178778 [details] [review]: Looks fine
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 ...
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]).
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.)
Review of attachment 178785 [details] [review]: Looks fine
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