summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorExtraterrestrial <[email protected]>2013-06-23 04:13:40 +0400
committerStefano Karapetsas <[email protected]>2014-01-24 09:29:15 +0100
commit62bf199982e977236d040102efa13862f189c32b (patch)
tree8cb4e9d1c9eee18d8edcde9eedde97eb92f486fd /src/core
parent6f4ee23657a8fbaed9cc89e56e08b543203fefd3 (diff)
downloadmarco-62bf199982e977236d040102efa13862f189c32b.tar.bz2
marco-62bf199982e977236d040102efa13862f189c32b.tar.xz
Fix drag over the top screen edge
Diffstat (limited to 'src/core')
-rw-r--r--src/core/window-private.h3
-rw-r--r--src/core/window.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/src/core/window-private.h b/src/core/window-private.h
index 02c518e0..f88f8a4d 100644
--- a/src/core/window-private.h
+++ b/src/core/window-private.h
@@ -86,7 +86,8 @@ typedef enum {
typedef enum {
META_TILE_NONE,
META_TILE_LEFT,
- META_TILE_RIGHT
+ META_TILE_RIGHT,
+ META_TILE_MAXIMIZE
} MetaTileMode;
struct _MetaWindow
diff --git a/src/core/window.c b/src/core/window.c
index 7a7f6bec..cd54e5b9 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -6966,7 +6966,7 @@ update_move (MetaWindow *window,
* because it's about the right size
*/
-#define DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR 6
+#define DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR 2
shake_threshold = meta_ui_get_drag_threshold (window->screen->ui) *
DRAG_THRESHOLD_TO_SHAKE_THRESHOLD_FACTOR;
@@ -6995,6 +6995,8 @@ update_move (MetaWindow *window,
else if (x >= work_area.x + work_area.width - shake_threshold &&
x < (monitor->rect.x + monitor->rect.width))
window->tile_mode = META_TILE_RIGHT;
+ else if ((y >= monitor->rect.y) && (y < work_area.y + shake_threshold))
+ window->tile_mode = META_TILE_MAXIMIZE;
else
window->tile_mode = META_TILE_NONE;
}
@@ -7527,6 +7529,8 @@ meta_window_handle_mouse_grab_op_event (MetaWindow *window,
{
if (window->tile_mode != META_TILE_NONE)
meta_window_tile (window);
+ else if (window->tile_mode == META_TILE_MAXIMIZE)
+ meta_window_maximize (window, META_MAXIMIZE_HORIZONTAL | META_MAXIMIZE_VERTICAL);
else if (event->xbutton.root == window->screen->xroot)
update_move (window, event->xbutton.state & ShiftMask,
event->xbutton.x_root, event->xbutton.y_root);