]> Dogcows Code - chaz/openbox/blobdiff - plugins/keyboard/keyparse.c
move the move/resize functionality into moveresize.c, for use with the netwm atoms...
[chaz/openbox] / plugins / keyboard / keyparse.c
index 95a60ba335c8e2de44ddd9d0783ef2481269b748..b3c00f7e99f52870d6c8988b33c439c69b083b36 100644 (file)
@@ -1,4 +1,5 @@
 #include "kernel/parse.h"
+#include "kernel/prop.h"
 #include "keyboard.h"
 
 void keyparse(ParseToken *token)
@@ -17,11 +18,11 @@ void keyparse(ParseToken *token)
         /* just fall through and free the token */
     } else if (top == NULL) {
         if (token->type == TOKEN_IDENTIFIER &&
-            !g_ascii_strcasecmp("key", token->data.identifier)) {
+            !g_ascii_strcasecmp("kbind", token->data.identifier)) {
             top = token->data.identifier;
             return;
         } else {
-            yyerror("syntax error (expected Key)");
+            yyerror("syntax error (expected kbind)");
             err = TRUE;
         }
     } else if (chain == NULL) {
@@ -44,9 +45,11 @@ void keyparse(ParseToken *token)
             action = action_from_string(token->data.identifier);
 
             /* no move/resize with the keyboard */
-            if (action &&
-                (action->func == action_move ||
-                 action->func == action_resize)) {
+            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;
             }
@@ -75,15 +78,15 @@ void keyparse(ParseToken *token)
         GList *strchain = NULL;
 
         /* build a list of just char*'s */
-        for (it = chain; it; it = it->next) {
+        for (it = chain; it; it = it->next)
             strchain = g_list_append(strchain,
                                      ((ParseToken*)it->data)->data.identifier);
-            g_print("Chain %s\n", ((ParseToken*)it->data)->data.identifier);
-        }
 
         /* these use the argument */
         if (action->func == action_execute || action->func == action_restart)
             action->data.execute.path = g_strdup(arg_str);
+        else if (action->func == action_showmenu)
+            action->data.showmenu.name = g_strdup(arg_str);
         if ((action->func == action_desktop ||
              action->func == action_send_to_desktop) &&
             arg_int)
@@ -97,7 +100,7 @@ void keyparse(ParseToken *token)
         if (kbind(strchain, action))
             action = NULL; /* don't free this if kbind succeeds */
         else
-            yyerror("failed to add binding");
+            yyerror("failed to add key binding");
         /* free the char*'s */
         g_list_free(strchain);
 
This page took 0.022864 seconds and 4 git commands to generate.