]> Dogcows Code - chaz/openbox/commitdiff
fix up support for moveresize. make keyboard grabs Async so that i can hit escape...
authorDana Jansens <danakj@orodu.net>
Thu, 17 Apr 2003 07:00:13 +0000 (07:00 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 17 Apr 2003 07:00:13 +0000 (07:00 +0000)
openbox/event.c
openbox/grab.c
openbox/grab.h
openbox/moveresize.c
openbox/moveresize.h
plugins/mouse/mouseparse.c

index f02f2506862100a623a56e5a5fde16c4a5d2d248..6cc8b1f0625f78d3623a6c80f47c517e88de371d 100644 (file)
@@ -689,9 +689,13 @@ static void event_handle_client(Client *client, XEvent *e)
                 (Atom)e->xclient.data.l[2] ==
                 prop_atoms.net_wm_moveresize_move_keyboard) {
 
+                g_message("client %lx x %d y %d button %d corner %d",
+                          client, e->xclient.data.l[0],                  
+                          e->xclient.data.l[1], e->xclient.data.l[3],    
+                          e->xclient.data.l[2]);
                 moveresize_start(client, e->xclient.data.l[0],
-                                 e->xclient.data.l[1], e->xclient.data.l[2],
-                                 e->xclient.data.l[3]);
+                                 e->xclient.data.l[1], e->xclient.data.l[3],
+                                 e->xclient.data.l[2]);
             }
         } else if (msgtype == prop_atoms.net_moveresize_window) {
             int oldg = client->gravity;
index b2426b9da51df569b854cfb3148fb94e03044b64..6af21eb29415524e83f33e11641ff46ba7746afb 100644 (file)
@@ -6,6 +6,7 @@
 #include <X11/Xlib.h>
 
 #define GRAB_PTR_MASK (ButtonPressMask | ButtonReleaseMask | ButtonMotionMask)
+#define GRAB_KEY_MASK (KeyPressMask | KeyReleaseMask)
 
 #define MASK_LIST_SIZE 8
 
@@ -17,8 +18,8 @@ int grab_keyboard(gboolean grab)
     static guint kgrabs = 0;
     if (grab) {
         if (kgrabs++ == 0)
-            XGrabKeyboard(ob_display, ob_root, 0, GrabModeAsync, GrabModeSync,
-                          event_lasttime);
+            XGrabKeyboard(ob_display, ob_root, FALSE, GrabModeAsync,
+                          GrabModeAsync, event_lasttime);
     } else if (kgrabs > 0) {
         if (--kgrabs == 0)
             XUngrabKeyboard(ob_display, event_lasttime);
index 2ba4ed5174390258360f8b6e2a2206d7548caf58..9e1c55d2d9d161017d351e0be98a93107b6a6c8c 100644 (file)
@@ -7,7 +7,7 @@
 void grab_startup();
 void grab_shutdown();
 
-void grab_keyboard(gboolean grab);
+int grab_keyboard(gboolean grab);
 void grab_pointer(gboolean grab, Cursor cur);
 void grab_pointer_window(gboolean grab, Cursor cur, Window win);
 void grab_server(gboolean grab);
index 7af3fa3e76b5bc5eba34972813fabadd542abdae..7731180470aaf48aac03c288397adfe384efc03e 100644 (file)
@@ -117,8 +117,8 @@ void moveresize_start(Client *c, int x, int y, guint b, guint32 cnr)
     else
         g_assert_not_reached();
 
-    grab_keyboard(TRUE);
     grab_pointer(TRUE, cur);
+    grab_keyboard(TRUE);
 }
 
 static void end_moveresize(gboolean cancel)
index 3b8b3c6a5a8173e9c8a405d612c66a4828c089a0..5fc8efde9234bf644357b9ee937a38433b70681e 100644 (file)
@@ -9,7 +9,7 @@ extern gboolean moveresize_in_progress;
 
 void moveresize_startup();
 
-void moveresize_start(Client *c, int x, int y, guint b, guint32 corner);
+void moveresize_start(Client *c, int x, int y, guint button, guint32 corner);
 
 void moveresize_event(XEvent *e);
 
index f9f5f2f65055ac61cfdff9dfb9bcb7fe9da62b69..2c94fb19cd50c6a83c354a8bc6d62afb1f757ce6 100644 (file)
@@ -69,8 +69,6 @@ void mouseparse(ParseToken *token)
             action = action_from_string(token->data.identifier);
 
             /* check for valid actions for motion events */
-            if (action->func == action_moveresize)
-                g_message("%d", action->data.moveresize.corner);
             if (event == MouseAction_Motion) {
                 if (action && (action->func != action_moveresize ||
                                action->data.moveresize.corner ==
This page took 0.027781 seconds and 4 git commands to generate.