mirror of
https://github.com/labwc/labwc.git
synced 2026-03-17 05:33:47 -04:00
desktop: rename desktop_cycle_view()
This commit is contained in:
parent
5f9c5a9d01
commit
5d6143449f
5 changed files with 9 additions and 11 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1,6 +1,3 @@
|
||||||
*.o
|
|
||||||
xdg-shell-protocol.*
|
|
||||||
labwc
|
|
||||||
build*/
|
build*/
|
||||||
subprojects/
|
subprojects/
|
||||||
tags
|
tags
|
||||||
|
|
|
||||||
|
|
@ -227,11 +227,11 @@ void view_for_each_surface(struct view *view,
|
||||||
void desktop_focus_view(struct seat *seat, struct view *view);
|
void desktop_focus_view(struct seat *seat, struct view *view);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* desktop_next_view - return next view
|
* desktop_cycle_view - return view to 'cycle' to
|
||||||
* @current: view used as reference point for defining 'next'
|
* @current: reference point for finding next view to cycle to
|
||||||
* Note: If current==NULL, the list's second view is returned
|
* 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);
|
void desktop_focus_topmost_mapped_view(struct server *server);
|
||||||
struct view *desktop_view_at(struct server *server, double lx, double ly,
|
struct view *desktop_view_at(struct server *server, double lx, double ly,
|
||||||
struct wlr_surface **surface, double *sx,
|
struct wlr_surface **surface, double *sx,
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ action(struct server *server, const char *action, const char *command)
|
||||||
spawn_async_no_shell(command);
|
spawn_async_no_shell(command);
|
||||||
} else if (!strcasecmp(action, "NextWindow")) {
|
} else if (!strcasecmp(action, "NextWindow")) {
|
||||||
server->cycle_view =
|
server->cycle_view =
|
||||||
desktop_next_view(server, server->cycle_view);
|
desktop_cycle_view(server, server->cycle_view);
|
||||||
} else if (!strcasecmp(action, "Reconfigure")) {
|
} else if (!strcasecmp(action, "Reconfigure")) {
|
||||||
spawn_async_no_shell("killall -SIGHUP labwc");
|
spawn_async_no_shell("killall -SIGHUP labwc");
|
||||||
} else if (!strcasecmp(action, "Debug")) {
|
} else if (!strcasecmp(action, "Debug")) {
|
||||||
|
|
|
||||||
|
|
@ -130,10 +130,11 @@ first_view(struct server *server)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct view *
|
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;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
struct view *view = current ? current : first_view(server);
|
struct view *view = current ? current : first_view(server);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ keyboard_key_notify(struct wl_listener *listener, void *data)
|
||||||
} else if (event->state == WLR_KEY_PRESSED) {
|
} else if (event->state == WLR_KEY_PRESSED) {
|
||||||
/* cycle to next */
|
/* cycle to next */
|
||||||
server->cycle_view =
|
server->cycle_view =
|
||||||
desktop_next_view(server, server->cycle_view);
|
desktop_cycle_view(server, server->cycle_view);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue