GNOME Bugzilla – Bug 629931
Allow breaking out from maximization/tiling during a mouse resize
Last modified: 2010-09-23 20:02:09 UTC
See bug 622517 for a patch that allows taking a maximized window and using alt-middle-drag to resize it. We should apply that to Mutter and make sure that it works properly for tiled windows as well. (A good part of the complexity in that patch is for reduced-resources-mode - i.e., wireframes, so it won't apply cleanly, but should be simpler when applied.)
Created attachment 170604 [details] [review] Allow breaking out from maximization during a mouse resize (In reply to comment #0) > (A good part of the complexity in that patch is for reduced-resources-mode - > i.e., wireframes, so it won't apply cleanly, but should be simpler when > applied.) Right. First patch is the ported metacity patch.
Created attachment 170605 [details] [review] Allow breaking out from tiling during a mouse resize Second patch which extends the concept to tiled windows. The separation is only intended for review, the patches should be squashed when accepted.
Review of attachment 170604 [details] [review]: Looks like the right part of my patch. I think I'd suggest 'git commit --amend --author "Owen W. Taylor <otaylor@fishsoup.net>" before pushing - I like to preserve the author when I'm not substantially changing things around. (And I probably would not squash the two patches in this case unless this patch alone is crashy or doesn't compile.)
Review of attachment 170605 [details] [review]: Doesn't look like this has the "undo" behavior that there is for maximization - if during the drag, you drag back to near the screen edge it clicks backs to maximized. Probably less important for this, but might be nice to have for consistency. ::: src/core/window.c @@ +3369,3 @@ { + /* Restore tiling if necessary */ + if (window->tile_mode != META_TILE_NONE) If meta_window_unmaximize_with_gravity has different behavior that meta_window_unmaximize() that should be noted in the docs. @@ +8420,3 @@ + if (!window->maximized_vertically && + window->tile_mode != META_TILE_NONE) + window->tile_mode = META_TILE_NONE; Very mysterious code in a weird place.... I'd expect any fixups for tiling/unmaximization during a drag to be right after the unmaximization in update_resize() or inside unmaximize_with_gravity. Not here. If there's some reason that they need to be here, should be commented.
(In reply to comment #4) > Doesn't look like this has the "undo" behavior that there is for maximization - > if during the drag, you drag back to near the screen edge it clicks backs to > maximized. Probably less important for this, but might be nice to have for > consistency. Works here. > If meta_window_unmaximize_with_gravity has different behavior that > meta_window_unmaximize() that should be noted in the docs. OK. > @@ +8420,3 @@ > + if (!window->maximized_vertically && > + window->tile_mode != META_TILE_NONE) > + window->tile_mode = META_TILE_NONE; > > Very mysterious code in a weird place.... I'd expect any fixups for > tiling/unmaximization during a drag to be right after the unmaximization in > update_resize() or inside unmaximize_with_gravity. Not here. If there's some > reason that they need to be here, should be commented. Having the code in either update_resize() or unmaximize_with_gravity() will break the "undo" behavior for tiled windows.
Created attachment 170805 [details] [review] Allow breaking out from tiling during a mouse resize Extend the code which allows resizing maximized windows using alt-middle-drag, so that it applies to tiled windows as well.
Review of attachment 170805 [details] [review]: (In reply to comment #6) (In reply to comment #5) > (In reply to comment #4) > > Doesn't look like this has the "undo" behavior that there is for maximization - > > if during the drag, you drag back to near the screen edge it clicks backs to > > maximized. Probably less important for this, but might be nice to have for > > consistency. > > Works here. Ah, didn't really understand how your patch was working - I didn't understand that when tile_mode was not NORMAL then maximize()/unmaximize_with_gravity() were acting as tile/untile. Maybe a bit magical but seems to work well in testing, and clearer with the comment on the post-resize cleanup.
Attachment 170604 [details] pushed as 1c3f7c4 - Allow breaking out from maximization during a mouse resize Attachment 170805 [details] pushed as 635e20d - Allow breaking out from tiling during a mouse resize