osd: generalize osd_{classic,thumbnail}_item

This allows us to share common codes for dealing with osd items.
For example:
- Get the clicked osd item to focus its associated window
- Scroll the items when their total height is taller than output height
This commit is contained in:
tokyo4j 2025-10-30 02:51:05 +09:00 committed by Johan Malm
parent 747163fa3e
commit 00f0a46ef7
6 changed files with 43 additions and 31 deletions

View file

@ -69,6 +69,12 @@ bool osd_field_is_valid(struct window_switcher_field *field);
void osd_field_free(struct window_switcher_field *field);
/* Internal API */
struct osd_item {
struct view *view;
struct wlr_scene_tree *tree;
struct wl_list link;
};
struct osd_impl {
/*
* Create a scene-tree of OSD for an output.