From 6d2c558bd8c4f3159f46ab2c58f1c51471785b9f Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Thu, 9 May 2002 21:22:01 +0000 Subject: [PATCH] make Alt+button2 do a resize 2002-05-09 Havoc Pennington * src/display.c (event_callback): make Alt+button2 do a resize --- ChangeLog | 4 ++++ src/display.c | 32 +++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 19c26765a..afb99385a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-05-09 Havoc Pennington + + * src/display.c (event_callback): make Alt+button2 do a resize + 2002-05-08 Anders Carlsson * src/fixedtip.c (meta_fixed_tip_show): diff --git a/src/display.c b/src/display.c index 638aefa5a..479dde825 100644 --- a/src/display.c +++ b/src/display.c @@ -952,7 +952,37 @@ event_callback (XEvent *event, } else if (event->xbutton.button == 2) { - begin_move = TRUE; + if (window->has_resize_func) + { + gboolean north; + gboolean west; + int root_x, root_y; + MetaGrabOp op; + + meta_window_get_position (window, &root_x, &root_y); + + west = event->xbutton.x_root < (root_x + window->rect.width / 2); + north = event->xbutton.y_root < (root_y + window->rect.height / 2); + + if (west && north) + op = META_GRAB_OP_RESIZING_NW; + else if (west) + op = META_GRAB_OP_RESIZING_SW; + else if (north) + op = META_GRAB_OP_RESIZING_NE; + else + op = META_GRAB_OP_RESIZING_SE; + + meta_display_begin_grab_op (display, + window, + op, + TRUE, + event->xbutton.button, + 0, + event->xbutton.time, + event->xbutton.x_root, + event->xbutton.y_root); + } } else if (event->xbutton.button == 3) {