[mutter/wip/fmuellner/contraint-tiling: 6/14] window: Maximize tiled windows when resizing to work area



commit 209407657dfc40c7d4a2611c25cf5a2b6c4757f1
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sun Jun 11 14:58:21 2017 -0300

    window: Maximize tiled windows when resizing to work area
    
    Now that tiled windows are resizable, the user may grow a tiled
    windows until it covers the entire work area. As this makes the
    window state mostly indistinguishable from maximization, avoid
    subtle differences by properly maximizing the window in that case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=645153

 src/core/window.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/core/window.c b/src/core/window.c
index 09f6fd3..9aa962c 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -6147,6 +6147,24 @@ update_resize (MetaWindow *window,
     g_get_current_time (&window->display->grab_last_moveresize_time);
 }
 
+static void
+maybe_maximize_tiled_window (MetaWindow *window)
+{
+  MetaRectangle work_area;
+  gint shake_threshold;
+
+  if (!META_WINDOW_TILED_SIDE_BY_SIDE (window))
+    return;
+
+  shake_threshold = meta_prefs_get_drag_threshold ();
+
+  meta_window_get_work_area_for_monitor (window,
+                                         window->tile_monitor_number,
+                                         &work_area);
+  if (window->rect.width >= work_area.width - shake_threshold)
+    meta_window_maximize (window, META_MAXIMIZE_BOTH);
+}
+
 void
 meta_window_update_resize (MetaWindow *window,
                            gboolean    snap,
@@ -6190,6 +6208,7 @@ end_grab_op (MetaWindow *window,
                          modifiers & CLUTTER_SHIFT_MASK,
                          x, y,
                          TRUE);
+          maybe_maximize_tiled_window (window);
         }
     }
   window->screen->preview_tile_mode = META_TILE_NONE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]