mirror of
https://github.com/labwc/labwc.git
synced 2026-02-28 01:40:29 -05:00
cycle: add <action name="NextWindow" output="" and identifier="">
Some checks failed
labwc.github.io / notify (push) Has been cancelled
Some checks failed
labwc.github.io / notify (push) Has been cancelled
output="all|focused|cursor" filters windows by the output they are on. identifier="all|current" filters windows by their app-id.
This commit is contained in:
parent
a5c6ff499c
commit
610d869561
6 changed files with 61 additions and 3 deletions
28
src/action.c
28
src/action.c
|
|
@ -379,6 +379,30 @@ action_arg_from_xml_node(struct action *action, const char *nodename, const char
|
|||
}
|
||||
goto cleanup;
|
||||
}
|
||||
if (!strcasecmp(argument, "output")) {
|
||||
if (!strcasecmp(content, "all")) {
|
||||
action_arg_add_int(action, argument, CYCLE_OUTPUT_ALL);
|
||||
} else if (!strcasecmp(content, "cursor")) {
|
||||
action_arg_add_int(action, argument, CYCLE_OUTPUT_CURSOR);
|
||||
} else if (!strcasecmp(content, "focused")) {
|
||||
action_arg_add_int(action, argument, CYCLE_OUTPUT_FOCUSED);
|
||||
} else {
|
||||
wlr_log(WLR_ERROR, "Invalid argument for action %s: '%s' (%s)",
|
||||
action_names[action->type], argument, content);
|
||||
}
|
||||
goto cleanup;
|
||||
}
|
||||
if (!strcasecmp(argument, "identifier")) {
|
||||
if (!strcasecmp(content, "all")) {
|
||||
action_arg_add_int(action, argument, CYCLE_APP_ID_ALL);
|
||||
} else if (!strcasecmp(content, "current")) {
|
||||
action_arg_add_int(action, argument, CYCLE_APP_ID_CURRENT);
|
||||
} else {
|
||||
wlr_log(WLR_ERROR, "Invalid argument for action %s: '%s' (%s)",
|
||||
action_names[action->type], argument, content);
|
||||
}
|
||||
goto cleanup;
|
||||
}
|
||||
break;
|
||||
case ACTION_TYPE_SHOW_MENU:
|
||||
if (!strcmp(argument, "menu")) {
|
||||
|
|
@ -1146,6 +1170,10 @@ run_action(struct view *view, struct server *server, struct action *action,
|
|||
struct cycle_filter filter = {
|
||||
.workspace = action_get_int(action, "workspace",
|
||||
rc.window_switcher.workspace_filter),
|
||||
.output = action_get_int(action, "output",
|
||||
CYCLE_OUTPUT_ALL),
|
||||
.app_id = action_get_int(action, "identifier",
|
||||
CYCLE_APP_ID_ALL),
|
||||
};
|
||||
if (server->input_mode == LAB_INPUT_STATE_CYCLE) {
|
||||
cycle_step(server, dir);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue