mirror of
https://github.com/cage-kiosk/cage.git
synced 2026-02-14 04:28:49 -05:00
Output: abstract away a view switch statement
We have our view abstraction, so why not use it?
This commit is contained in:
parent
431320443a
commit
9a99ba604f
5 changed files with 29 additions and 21 deletions
10
xdg_shell.c
10
xdg_shell.c
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* Cage: A Wayland kiosk.
|
||||
*
|
||||
* Copyright (C) 2018 Jente Hidskes
|
||||
* Copyright (C) 2018-2019 Jente Hidskes
|
||||
*
|
||||
* See the LICENSE file accompanying this file.
|
||||
*/
|
||||
|
|
@ -37,6 +37,13 @@ get_geometry(struct cg_view *view, int *width_out, int *height_out)
|
|||
*height_out = geom.height;
|
||||
}
|
||||
|
||||
static void
|
||||
for_each_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator,
|
||||
void *data)
|
||||
{
|
||||
wlr_xdg_surface_for_each_surface(view->xdg_surface, iterator, data);
|
||||
}
|
||||
|
||||
static bool
|
||||
is_primary(struct cg_view *view)
|
||||
{
|
||||
|
|
@ -86,5 +93,6 @@ handle_xdg_shell_surface_new(struct wl_listener *listener, void *data)
|
|||
view->activate = activate;
|
||||
view->maximize = maximize;
|
||||
view->get_geometry = get_geometry;
|
||||
view->for_each_surface = for_each_surface;
|
||||
view->is_primary = is_primary;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue