mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
action: refactor action()
This commit is contained in:
parent
d15e48269d
commit
745915c0ba
3 changed files with 10 additions and 10 deletions
16
src/action.c
16
src/action.c
|
|
@ -4,20 +4,20 @@
|
|||
|
||||
#include <strings.h>
|
||||
|
||||
void action(struct server *server, struct keybind *keybind)
|
||||
void action(struct server *server, const char *action, const char *command)
|
||||
{
|
||||
if (!keybind || !keybind->action)
|
||||
if (!action)
|
||||
return;
|
||||
if (!strcasecmp(keybind->action, "Exit")) {
|
||||
if (!strcasecmp(action, "Exit")) {
|
||||
wl_display_terminate(server->wl_display);
|
||||
} else if (!strcasecmp(keybind->action, "NextWindow")) {
|
||||
} else if (!strcasecmp(action, "NextWindow")) {
|
||||
server->cycle_view =
|
||||
desktop_next_view(server, server->cycle_view);
|
||||
} else if (!strcasecmp(keybind->action, "Execute")) {
|
||||
spawn_async_no_shell(keybind->command);
|
||||
} else if (!strcasecmp(keybind->action, "debug-views")) {
|
||||
} else if (!strcasecmp(action, "Execute")) {
|
||||
spawn_async_no_shell(command);
|
||||
} else if (!strcasecmp(action, "debug-views")) {
|
||||
dbg_show_views(server);
|
||||
} else {
|
||||
warn("action (%s) not supported", keybind->action);
|
||||
warn("action (%s) not supported", action);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue