]> Dogcows Code - chaz/openbox/blobdiff - plugins/mouse/mouserc_parse.l
sep is not used any more
[chaz/openbox] / plugins / mouse / mouserc_parse.l
index 1a3233c0f92d815a30adaf40db3f38d0d4ef70e8..a653c3af1698777108c9c15f2d1772da8c50fb5b 100644 (file)
@@ -7,7 +7,6 @@
 
 static int lineno;
 static char *path;
-static gboolean comment;
 static gboolean error;
 
 static char *context;
@@ -21,13 +20,12 @@ static void gotfield();
 static void addbinding();
 %}
 
-field [-A-Za-z0-9]+
-sep [ \t]+
+field [A-Za-z0-9][-A-Za-z0-9]*
 white [ \t]*
 
 %%
 
-^{white}# comment = TRUE;
+^{white}\#.+\n lineno++;
 {field} gotfield();
 \n endofline();
 [ \t]
@@ -51,14 +49,12 @@ static void gotfield()
 
 static void endofline()
 {
-    if (!comment) {
-        if (!error && context && event && button && action)
-            addbinding();
-        else if (error || context || event || button || action)
-            g_warning("Parser error in '%s' on line %d", path, lineno);
-    }
+    if (!error && context && event && button && action)
+        addbinding();
+    else if (error || context || event || button || action)
+        g_warning("Parser error in '%s' on line %d", path, lineno);
 
-    comment = error = FALSE;
+    error = FALSE;
     g_free(context); g_free(event); g_free(button); g_free(action);
     context = event = button = action = NULL;
 
@@ -180,9 +176,11 @@ static void addbinding()
     } else if (!g_ascii_strcasecmp(action, "previousdesktoprowwrap")) {
         a = action_new(action_previous_desktop_row);
         a->data.nextprevdesktop.wrap = TRUE;
-    } else if (!g_ascii_strcasecmp(action, "move")) {
+    } else if (!g_ascii_strcasecmp(action, "move") &&
+               mact == MouseAction_Motion) {
         a = action_new(action_move);
-    } else if (!g_ascii_strcasecmp(action, "resize")) {
+    } else if (!g_ascii_strcasecmp(action, "resize") &&
+               mact == MouseAction_Motion) {
         a = action_new(action_resize);
     } else {
         g_warning("Invalid action '%s' in '%s' on line %d", action, path,
@@ -218,7 +216,6 @@ void mouserc_parse()
     }
 
     lineno = 1;
-    comment = FALSE;
     error = FALSE;
     context = event = button = action = NULL;
 
This page took 0.023396 seconds and 4 git commands to generate.