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 630548 - gnome-shell could auto-maximize windows when dragged to top edge of screen
gnome-shell could auto-maximize windows when dragged to top edge of screen
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: High normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks: 604237
 
 
Reported: 2010-09-24 21:31 UTC by Ray Strode [halfline]
Modified: 2010-12-02 22:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tiling: rename side-by-side tiling to edge tiling (3.60 KB, patch)
2010-09-24 21:31 UTC, Ray Strode [halfline]
committed Details | Review
tiling: add side_by_side suffix to tile code (6.85 KB, patch)
2010-09-24 21:31 UTC, Ray Strode [halfline]
committed Details | Review
tiling: use META_WINDOW_TILED_SIDE_BY_SIDE in state check (1.57 KB, patch)
2010-09-24 21:31 UTC, Ray Strode [halfline]
committed Details | Review
tiling: Add new "maximized" tile (7.50 KB, patch)
2010-09-24 21:31 UTC, Ray Strode [halfline]
reviewed Details | Review
Rename side-by-side tiling key (1.82 KB, patch)
2010-09-24 21:35 UTC, Ray Strode [halfline]
needs-work Details | Review
Use new key names when overriding metacity's defaults (1.30 KB, patch)
2010-09-27 14:30 UTC, Florian Müllner
none Details | Review
tiling: Add new "maximized" tile (8.02 KB, patch)
2010-12-02 22:40 UTC, Ray Strode [halfline]
committed Details | Review
tiling: disable "shake loose" feature when edge tiling (1.28 KB, patch)
2010-12-02 22:41 UTC, Ray Strode [halfline]
committed Details | Review
Rename side-by-side tiling key (2.86 KB, patch)
2010-12-02 22:48 UTC, Ray Strode [halfline]
committed Details | Review

Description Ray Strode [halfline] 2010-09-24 21:31:03 UTC
The new side-by-side tiling feature in gnome-shell is really neat.  It works
really well.  One thing I've noticed, though, is I sort of intuitively expect
the window to maximize when I drag it to the top edge of the screen.  At some
point I actually caught myself sitting there waiting for it to maximize and
had to ask myself why it wasn't working.

This subconscious expectation may have something to do with me crossing the
old "shake loose a window and drag to a different monitor feature" with the
new side-by-side tiling feature.

Anyway, I think it's a useful feature to have so I'm proposing it here.

The idea is that maximize is just a degenerate form of tiling.  Instead of tiling
two document windows and the panels together, it's tiling one window and the panels
together.
Comment 1 Ray Strode [halfline] 2010-09-24 21:31:04 UTC
Created attachment 171062 [details] [review]
tiling: rename side-by-side tiling to edge tiling

Currently, the new tiling feature, supports side-by-side, horizontal
tiling when dragging windows to one of the vertical edges of a monitor.

Other types of tiling (on other monitor edges) are potentially useful,
though.

This commit renames the preference from side_by_side_tiling to
edge_tiling.
Comment 2 Ray Strode [halfline] 2010-09-24 21:31:07 UTC
Created attachment 171063 [details] [review]
tiling: add side_by_side suffix to tile code

The meta_window_can_tile function and META_WINDOW_TILED
macro are pretty side-by-side tiling specific, so
rename them.
Comment 3 Ray Strode [halfline] 2010-09-24 21:31:09 UTC
Created attachment 171064 [details] [review]
tiling: use META_WINDOW_TILED_SIDE_BY_SIDE in state check

The meta_window_handle_mouse_grab_op_event function ensures
the tile_mode variable is in a consistent state after a drag
op is finished.

The way this is current done is:

if (!window->maximized_vertically &&
    window->tile_mode != META_TILE_NONE)
  window->tile_mode = META_TILE_NONE;

While valid, it doesn't "read" as well as using the
META_WINDOW_TILED_SIDE_BY_SIDE macro, since the macro is specifically
about side-by-side tiling.

This commit just changes things to use the macro and to not bother
checking the tile mode (since if we just reset it anyway, then it doesn't
matter if the value is right or wrong to begin with).
Comment 4 Ray Strode [halfline] 2010-09-24 21:31:11 UTC
Created attachment 171065 [details] [review]
tiling: Add new "maximized" tile

In addition to the existing side-by-side tiling modes, this commit
adds a new "maximize" tiling mode.  It allows the user to maximize
their windows (in other words, tile with the edge panels) by dragging
their window to the top edge of the monitor.
Comment 5 Ray Strode [halfline] 2010-09-24 21:35:07 UTC
Created attachment 171066 [details] [review]
Rename side-by-side tiling key

It's now called edge_tiling since it can do more than
just side-by-side tiling.
Comment 6 Florian Müllner 2010-09-24 23:11:26 UTC
Review of attachment 171063 [details] [review]:

As mentioned on IRC, I'm a bit concerned about inconsistencies with side-by-side-tiling / top-edge-tiling / shaking-loose. But thinking about it a little, the old shaking-loose behavior is not very useful in the presence of top-edge-tiling - tiling requires a tiny bit more mouse movement and a button release, none of which should be a big deal. So I'd suggest trying to make shaking-loose and tiling mutually exclusive, e.g. only keep the old behavior if tiling is not enabled.

I guess something like the following could work?

::: src/core/window.c
@@ +7807,2 @@
       /* Shake loose */
+      window->shaken_loose = !META_WINDOW_TILED_SIDE_BY_SIDE (window);

/* Shake loose, so that the window snaps back to maximized
   when dragged near the top; do not snap back if tiling
   is enabled, as top edge tiling can be used in that case
 */
window->shaken_loose = !meta_prefs_get_edge_tiling ();
Comment 7 Ray Strode [halfline] 2010-09-26 20:55:02 UTC
Comment on attachment 171066 [details] [review]
Rename side-by-side tiling key

This patch isn't quite right.  If we do end up landing the mutter changes, the gnome-shell module will need more changes than this.
Comment 8 Florian Müllner 2010-09-27 14:30:25 UTC
Created attachment 171209 [details] [review]
Use new key names when overriding metacity's defaults

(In reply to comment #7)
> This patch isn't quite right.  If we do end up landing the mutter changes, the
> gnome-shell module will need more changes than this.

Correct - feel free to squash this patch.
Comment 9 Florian Müllner 2010-11-25 18:58:38 UTC
Review of attachment 171062 [details] [review]:

Looks good.
Comment 10 Florian Müllner 2010-11-25 19:01:07 UTC
Review of attachment 171063 [details] [review]:

Code looks good, though my suggestion from comment 6 still stands.
Comment 11 Florian Müllner 2010-11-25 19:02:27 UTC
Review of attachment 171064 [details] [review]:

Looks good.
Comment 12 Florian Müllner 2010-11-25 19:30:14 UTC
Review of attachment 171065 [details] [review]:

Looks good, except for one comment:

::: src/core/window.c
@@ +7811,3 @@
+       */
+      if (x >= monitor->rect.x &&
+          x < (monitor->rect.x + monitor->rect.width))

I think it is wrong to enforce maximized tiling on windows which are marked as non-resizable, or whose minimum size will cause maximization to fail - I'd suggest making the block optional with META_WINDOW_ALLOWS_RESIZE (window).
Comment 13 Ray Strode [halfline] 2010-12-02 22:36:09 UTC
(In reply to comment #6)
> Review of attachment 171063 [details] [review]:
> 
> As mentioned on IRC, I'm a bit concerned about inconsistencies with
> side-by-side-tiling / top-edge-tiling / shaking-loose. But thinking about it a
> little, the old shaking-loose behavior is not very useful in the presence of
> top-edge-tiling - tiling requires a tiny bit more mouse movement and a button
> release, none of which should be a big deal. So I'd suggest trying to make
> shaking-loose and tiling mutually exclusive, e.g. only keep the old behavior if
> tiling is not enabled.
> 
> I guess something like the following could work?
> 
> ::: src/core/window.c
> @@ +7807,2 @@
>        /* Shake loose */
> +      window->shaken_loose = !META_WINDOW_TILED_SIDE_BY_SIDE (window);
> 
> /* Shake loose, so that the window snaps back to maximized
>    when dragged near the top; do not snap back if tiling
>    is enabled, as top edge tiling can be used in that case
>  */
> window->shaken_loose = !meta_prefs_get_edge_tiling ();

Right makes sense.  I'll add a commit after the commit that adds maximize edge tiling, which drops shake loose when edge tiling is enabled.
Comment 14 Ray Strode [halfline] 2010-12-02 22:37:42 UTC
(In reply to comment #12)
> Review of attachment 171065 [details] [review]:
> 
> Looks good, except for one comment:
> 
> ::: src/core/window.c
> @@ +7811,3 @@
> +       */
> +      if (x >= monitor->rect.x &&
> +          x < (monitor->rect.x + monitor->rect.width))
> 
> I think it is wrong to enforce maximized tiling on windows which are marked as
> non-resizable, or whose minimum size will cause maximization to fail - I'd
> suggest making the block optional with META_WINDOW_ALLOWS_RESIZE (window).

Right, I guess to be consistent with the meta_window_can_tile_side_by_side usage we should have a meta_window_can_tile_maximized function that checks ALLOWS_RESIZE and also has_maximize_func
Comment 15 Ray Strode [halfline] 2010-12-02 22:40:48 UTC
Created attachment 175742 [details] [review]
tiling: Add new "maximized" tile

In addition to the existing side-by-side tiling modes, this commit
adds a new "maximize" tiling mode.  It allows the user to maximize
their windows (in other words, tile with the edge panels) by dragging
their window to the top edge of the monitor.
Comment 16 Ray Strode [halfline] 2010-12-02 22:41:07 UTC
Created attachment 175743 [details] [review]
tiling: disable "shake loose" feature when edge tiling

The old behavior of being able to shake loose a maiximized window
overlaps with and is for the most part superceded by top edge tiling.

This commit changes the code to only enable shake loose behavior
when edge tiling is disabled.
Comment 17 Ray Strode [halfline] 2010-12-02 22:45:04 UTC
Comment on attachment 175742 [details] [review]
tiling: Add new "maximized" tile

This is just the already reviewed commit with the change from comment 6 added, so i've pushed it.
Comment 18 Ray Strode [halfline] 2010-12-02 22:46:21 UTC
(i meant comment 12 not comment 6 in the previous comment)
Comment 19 Ray Strode [halfline] 2010-12-02 22:47:16 UTC
Comment on attachment 175743 [details] [review]
tiling: disable "shake loose" feature when edge tiling

This is florian's already discussed change to disable shaken loose behavior when edge tiling is enabled. I've pushed it.
Comment 20 Ray Strode [halfline] 2010-12-02 22:48:49 UTC
Created attachment 175744 [details] [review]
Rename side-by-side tiling key

It's now called edge_tiling since it can do more than
just side-by-side tiling.
Comment 21 Ray Strode [halfline] 2010-12-02 22:53:00 UTC
Attachment 175744 [details] pushed as 0c89417 - Rename side-by-side tiling key

This does the remaining discussed gnome-shell changes.