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 629931 - Allow breaking out from maximization/tiling during a mouse resize
Allow breaking out from maximization/tiling during a mouse resize
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2010-09-17 15:22 UTC by Owen Taylor
Modified: 2010-09-23 20:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow breaking out from maximization during a mouse resize (14.61 KB, patch)
2010-09-19 21:29 UTC, Florian Müllner
committed Details | Review
Allow breaking out from tiling during a mouse resize (2.19 KB, patch)
2010-09-19 21:32 UTC, Florian Müllner
needs-work Details | Review
Allow breaking out from tiling during a mouse resize (3.15 KB, patch)
2010-09-22 01:27 UTC, Florian Müllner
committed Details | Review

Description Owen Taylor 2010-09-17 15:22:20 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.)
Comment 1 Florian Müllner 2010-09-19 21:29:49 UTC
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.
Comment 2 Florian Müllner 2010-09-19 21:32:32 UTC
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.
Comment 3 Owen Taylor 2010-09-20 15:45:42 UTC
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.)
Comment 4 Owen Taylor 2010-09-20 15:58:00 UTC
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.
Comment 5 Florian Müllner 2010-09-22 00:46:04 UTC
(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.
Comment 6 Florian Müllner 2010-09-22 01:27:54 UTC
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.
Comment 7 Owen Taylor 2010-09-23 19:46:05 UTC
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.
Comment 8 Florian Müllner 2010-09-23 20:02:01 UTC
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