]> git.mdlowis.com Git - proto/labwc.git/commitdiff
action: Allow explicit None action without warning
authorJohn Lindgren <john@jlindgren.net>
Tue, 6 Sep 2022 17:22:43 +0000 (13:22 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Fri, 16 Sep 2022 21:06:29 +0000 (22:06 +0100)
docs/labwc-actions.5.scd
src/action.c

index 6d74700d25e1d1c8596f524af3ee8e62f7ffa060..84dcb94710ecdd9072dfc72bade976126a4d4e3e 100644 (file)
@@ -75,6 +75,9 @@ Actions are used in menus and keyboard/mouse bindings.
        Send active window to workspace.
        Supported values are the same as for GoToDesktop.
 
+*<action name="None">*
+       If used as the only action for a binding: clear an earlier defined binding.
+
 # SEE ALSO
 
 labwc(1), labwc-config(5), labwc-theme(5)
index 445644477f589913f23f92750b1d6550cfebcd99..95871e43b1a22a8358f7c3007f0620de0e3d5d51 100644 (file)
@@ -16,7 +16,8 @@
 #include "workspaces.h"
 
 enum action_type {
-       ACTION_TYPE_NONE = 0,
+       ACTION_TYPE_INVALID = 0,
+       ACTION_TYPE_NONE,
        ACTION_TYPE_CLOSE,
        ACTION_TYPE_DEBUG,
        ACTION_TYPE_EXECUTE,
@@ -41,7 +42,8 @@ enum action_type {
 };
 
 const char *action_names[] = {
-       "NoOp",
+       "INVALID",
+       "None",
        "Close",
        "Debug",
        "Execute",
@@ -93,7 +95,7 @@ action_type_from_str(const char *action_name)
                }
        }
        wlr_log(WLR_ERROR, "Invalid action: %s", action_name);
-       return ACTION_TYPE_NONE;
+       return ACTION_TYPE_INVALID;
 }
 
 struct action *
@@ -349,6 +351,8 @@ actions_run(struct view *activator, struct server *server,
                        }
                        break;
                case ACTION_TYPE_NONE:
+                       break;
+               case ACTION_TYPE_INVALID:
                        wlr_log(WLR_ERROR, "Not executing unknown action");
                        break;
                default: