]> Dogcows Code - chaz/openbox/blobdiff - plugins/mouse/mouseparse.c
move the move/resize functionality into moveresize.c, for use with the netwm atoms...
[chaz/openbox] / plugins / mouse / mouseparse.c
index 099dbaa8c0b0ddf5c13c1e433656c130c6c204d5..f9f5f2f65055ac61cfdff9dfb9bcb7fe9da62b69 100644 (file)
@@ -1,5 +1,6 @@
 #include "kernel/action.h"
 #include "kernel/parse.h"
+#include "kernel/prop.h"
 #include "mouse.h"
 
 void mouseparse(ParseToken *token)
@@ -68,12 +69,26 @@ void mouseparse(ParseToken *token)
             action = action_from_string(token->data.identifier);
 
             /* check for valid actions for motion events */
-            if ((event == MouseAction_Motion) ^
-                (action &&
-                 (action->func == action_move ||
-                  action->func == action_resize))) {
-                action_free(action);
-                action = NULL;
+            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 ==
+                               prop_atoms.net_wm_moveresize_move_keyboard ||
+                               action->data.moveresize.corner ==
+                               prop_atoms.net_wm_moveresize_size_keyboard)) {
+                    action_free(action);
+                    action = NULL;
+                }
+            } else {
+                if (action && action->func == action_moveresize &&
+                    action->data.moveresize.corner !=
+                    prop_atoms.net_wm_moveresize_move_keyboard &&
+                    action->data.moveresize.corner !=
+                    prop_atoms.net_wm_moveresize_size_keyboard) {
+                    action_free(action);
+                    action = NULL;
+                }
             }
 
             if (action != NULL) {
This page took 0.022747 seconds and 4 git commands to generate.