diff --git a/docs/labwc-actions.5.scd b/docs/labwc-actions.5.scd index de1dc00d..7a27e0f5 100644 --- a/docs/labwc-actions.5.scd +++ b/docs/labwc-actions.5.scd @@ -145,6 +145,10 @@ Actions are used in menus and keyboard/mouse bindings. This determines whether to cycle through all windows or only windows of the same application as the currently focused window. Default is "all". + *immediate* [yes|no] + This determines whether the switch happens immediately, useful when bound to + a key without modifier. Default is "no". + ** Re-load configuration and theme files. diff --git a/src/action.c b/src/action.c index b2d9d1cf..67c7ffdd 100644 --- a/src/action.c +++ b/src/action.c @@ -372,6 +372,10 @@ action_arg_from_xml_node(struct action *action, const char *nodename, const char } goto cleanup; } + if (!strcasecmp(argument, "immediate")) { + action_arg_add_bool(action, argument, parse_bool(content, false)); + goto cleanup; + } break; case ACTION_TYPE_SHOW_MENU: if (!strcmp(argument, "menu")) { @@ -1143,7 +1147,7 @@ run_action(struct view *view, struct action *action, cycle_step(dir); } else { cycle_begin(dir, filter); - if (!rc.window_switcher.osd.show) { + if (action_get_bool(action, "immediate", false)) { cycle_finish(true); if (view && dir == LAB_CYCLE_DIR_FORWARD) { view_move_to_back(view);