From: Johan Malm Date: Sat, 31 Oct 2020 14:46:33 +0000 (+0000) Subject: desktop: rename desktop_cycle_view() X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=5d6143449f94475bd9e55986745df6e07e6dd8fc;p=proto%2Flabwc.git desktop: rename desktop_cycle_view() --- diff --git a/.gitignore b/.gitignore index e1b0bdc6..2453e062 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -*.o -xdg-shell-protocol.* -labwc build*/ subprojects/ tags diff --git a/include/labwc.h b/include/labwc.h index 559d5bb0..1c58677f 100644 --- a/include/labwc.h +++ b/include/labwc.h @@ -227,11 +227,11 @@ void view_for_each_surface(struct view *view, void desktop_focus_view(struct seat *seat, struct view *view); /** - * desktop_next_view - return next view - * @current: view used as reference point for defining 'next' - * Note: If current==NULL, the list's second view is returned + * desktop_cycle_view - return view to 'cycle' to + * @current: reference point for finding next view to cycle to + * Note: If !current, the server->views second focusable view is returned */ -struct view *desktop_next_view(struct server *server, struct view *current); +struct view *desktop_cycle_view(struct server *server, struct view *current); void desktop_focus_topmost_mapped_view(struct server *server); struct view *desktop_view_at(struct server *server, double lx, double ly, struct wlr_surface **surface, double *sx, diff --git a/src/action.c b/src/action.c index 924ef791..098ee6cc 100644 --- a/src/action.c +++ b/src/action.c @@ -15,7 +15,7 @@ action(struct server *server, const char *action, const char *command) spawn_async_no_shell(command); } else if (!strcasecmp(action, "NextWindow")) { server->cycle_view = - desktop_next_view(server, server->cycle_view); + desktop_cycle_view(server, server->cycle_view); } else if (!strcasecmp(action, "Reconfigure")) { spawn_async_no_shell("killall -SIGHUP labwc"); } else if (!strcasecmp(action, "Debug")) { diff --git a/src/desktop.c b/src/desktop.c index 62e6fc18..7c71667f 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -130,10 +130,11 @@ first_view(struct server *server) } struct view * -desktop_next_view(struct server *server, struct view *current) +desktop_cycle_view(struct server *server, struct view *current) { - if (!has_focusable_view(&server->views)) + if (!has_focusable_view(&server->views)) { return NULL; + } struct view *view = current ? current : first_view(server); diff --git a/src/keyboard.c b/src/keyboard.c index 45d64184..6d6263d6 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -57,7 +57,7 @@ keyboard_key_notify(struct wl_listener *listener, void *data) } else if (event->state == WLR_KEY_PRESSED) { /* cycle to next */ server->cycle_view = - desktop_next_view(server, server->cycle_view); + desktop_cycle_view(server, server->cycle_view); return; } }