mirror of
https://github.com/labwc/labwc.git
synced 2026-03-22 05:33:57 -04:00
osd: allow clicking an osd item to focus the window
This commit is contained in:
parent
00f0a46ef7
commit
9197eb468a
9 changed files with 55 additions and 1 deletions
|
|
@ -161,6 +161,8 @@ osd_classic_create(struct output *output, struct wl_array *views)
|
|||
wl_list_append(&output->osd_scene.items, &item->base.link);
|
||||
item->base.view = *view;
|
||||
item->base.tree = wlr_scene_tree_create(output->osd_scene.tree);
|
||||
node_descriptor_create(&item->base.tree->node,
|
||||
LAB_NODE_OSD_ITEM, NULL, item);
|
||||
/*
|
||||
* OSD border
|
||||
* +---------------------------------+
|
||||
|
|
@ -200,6 +202,11 @@ osd_classic_create(struct output *output, struct wl_array *views)
|
|||
item->active_tree, &highlight_opts);
|
||||
wlr_scene_node_set_position(&highlight_rect->tree->node, padding, y);
|
||||
|
||||
/* hitbox for mouse clicks */
|
||||
struct wlr_scene_rect *hitbox = wlr_scene_rect_create(item->base.tree,
|
||||
w - 2 * padding, switcher_theme->item_height, (float[4]) {0});
|
||||
wlr_scene_node_set_position(&hitbox->node, padding, y);
|
||||
|
||||
create_fields_scene(server, *view, item->normal_tree,
|
||||
text_color, bg_color, field_widths_sum, x, y);
|
||||
create_fields_scene(server, *view, item->active_tree,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue