From 9fcb2aa1d25ec9889b45d145939fb17160b1106a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 13 May 2007 23:30:52 +0000 Subject: add grab/ungrab macros so dont need to pass in 10 arguments to ungrab stuff. add a confine option to grab_pointer to confine the pointer to the screen, and use that for moveresize --- openbox/moveresize.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'openbox/moveresize.c') diff --git a/openbox/moveresize.c b/openbox/moveresize.c index 37c190d5..b5fe6cb0 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -187,10 +187,11 @@ void moveresize_start(ObClient *c, gint x, gint y, guint b, guint32 cnr) else g_assert_not_reached(); - if (!grab_pointer(TRUE, FALSE, cur)) + /* keep the pointer bounded to the screen for move/resize */ + if (!grab_pointer(FALSE, TRUE, cur)) return; - if (!grab_keyboard(TRUE)) { - grab_pointer(FALSE, FALSE, OB_CURSOR_NONE); + if (!grab_keyboard()) { + ungrab_pointer(); return; } @@ -275,8 +276,8 @@ void moveresize_end(gboolean cancel) { gint x, y; - grab_keyboard(FALSE); - grab_pointer(FALSE, FALSE, OB_CURSOR_NONE); + ungrab_keyboard(); + ungrab_pointer(); popup_hide(popup); -- cgit v1.2.3