Blame marco_window-snapping-top-screen.patch

raveit65 3243dae
diff --git a/src/core/window-private.h b/src/core/window-private.h
raveit65 3243dae
index 02c518e..f88f8a4 100644
raveit65 3243dae
--- a/src/core/window-private.h
raveit65 3243dae
+++ b/src/core/window-private.h
raveit65 3243dae
@@ -86,7 +86,8 @@ typedef gboolean (*MetaWindowForeachFunc) (MetaWindow *window,
raveit65 3243dae
 typedef enum {
raveit65 3243dae
   META_TILE_NONE,
raveit65 3243dae
   META_TILE_LEFT,
raveit65 3243dae
-  META_TILE_RIGHT
raveit65 3243dae
+  META_TILE_RIGHT,
raveit65 3243dae
+  META_TILE_MAXIMIZE
raveit65 3243dae
 } MetaTileMode;
raveit65 3243dae
 
raveit65 3243dae
 struct _MetaWindow
raveit65 3243dae
diff --git a/src/core/window.c b/src/core/window.c
raveit65 3243dae
index 7a7f6be..cd54e5b 100644
raveit65 3243dae
--- a/src/core/window.c
raveit65 3243dae
+++ b/src/core/window.c
raveit65 3243dae
@@ -6966,7 +6966,7 @@ static void meta_window_apply_session_info (MetaWindow                  *window,
raveit65 3243dae
    * because it's about the right size
raveit65 3243dae
    */
raveit65 3243dae
 
raveit65 3243dae
-#define DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR 6
raveit65 3243dae
+#define DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR 2
raveit65 3243dae
   shake_threshold = meta_ui_get_drag_threshold (window->screen->ui) *
raveit65 3243dae
     DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR;
raveit65 3243dae
 
raveit65 3243dae
@@ -6995,6 +6995,8 @@ static void meta_window_apply_session_info (MetaWindow                  *window,
raveit65 3243dae
           else if (x >= work_area.x + work_area.width - shake_threshold &&
raveit65 3243dae
                    x < (monitor->rect.x + monitor->rect.width))
raveit65 3243dae
             window->tile_mode = META_TILE_RIGHT;
raveit65 3243dae
+          else if ((y >= monitor->rect.y) && (y < work_area.y + shake_threshold))
raveit65 3243dae
+            window->tile_mode = META_TILE_MAXIMIZE;
raveit65 3243dae
           else
raveit65 3243dae
             window->tile_mode = META_TILE_NONE;
raveit65 3243dae
         }
raveit65 3243dae
@@ -7527,6 +7529,8 @@ static void meta_window_apply_session_info (MetaWindow                  *window,
raveit65 3243dae
             {
raveit65 3243dae
               if (window->tile_mode != META_TILE_NONE)
raveit65 3243dae
                 meta_window_tile (window);
raveit65 3243dae
+              else if (window->tile_mode == META_TILE_MAXIMIZE)
raveit65 3243dae
+                meta_window_maximize (window, META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
raveit65 3243dae
               else if (event->xbutton.root == window->screen->xroot)
raveit65 3243dae
                 update_move (window, event->xbutton.state & ShiftMask,
raveit65 3243dae
                              event->xbutton.x_root, event->xbutton.y_root);
raveit65 3243dae