mirror of
https://github.com/labwc/labwc.git
synced 2025-11-30 06:59:52 -05:00
osd: add multi-monitor support
Some checks failed
labwc.github.io / notify (push) Has been cancelled
Some checks failed
labwc.github.io / notify (push) Has been cancelled
Adds `output` attribute to control which monitor(s) display the window switcher OSD. Supports three modes: - "all": display on all monitors (default) - "pointer": display on monitor with mouse cursor - "keyboard": display on monitor with keyboard focus The configuration structure is also refactored to nest OSD-specific settings (show, style, output, thumbnailLabelFormat) under an <osd> element within <windowSwitcher>, improving logical organization.
This commit is contained in:
parent
79fbb611e0
commit
d65caf8bfd
6 changed files with 105 additions and 25 deletions
|
|
@ -294,6 +294,20 @@ preview_cycled_view(struct view *view)
|
|||
wlr_scene_node_raise_to_top(osd_state->preview_node);
|
||||
}
|
||||
|
||||
static void
|
||||
update_osd_on_output(struct server *server, struct output *output,
|
||||
struct osd_impl *osd_impl, struct wl_array *views)
|
||||
{
|
||||
if (!output_is_usable(output)) {
|
||||
return;
|
||||
}
|
||||
if (!output->osd_scene.tree) {
|
||||
osd_impl->create(output, views);
|
||||
assert(output->osd_scene.tree);
|
||||
}
|
||||
osd_impl->update(output);
|
||||
}
|
||||
|
||||
static void
|
||||
update_osd(struct server *server)
|
||||
{
|
||||
|
|
@ -318,16 +332,29 @@ update_osd(struct server *server)
|
|||
|
||||
if (rc.window_switcher.show) {
|
||||
/* Display the actual OSD */
|
||||
struct output *output;
|
||||
wl_list_for_each(output, &server->outputs, link) {
|
||||
if (!output_is_usable(output)) {
|
||||
continue;
|
||||
switch (rc.window_switcher.output_criteria) {
|
||||
case OSD_OUTPUT_ALL: {
|
||||
struct output *output;
|
||||
wl_list_for_each(output, &server->outputs, link) {
|
||||
update_osd_on_output(server, output, osd_impl, &views);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (!output->osd_scene.tree) {
|
||||
osd_impl->create(output, &views);
|
||||
assert(output->osd_scene.tree);
|
||||
case OSD_OUTPUT_POINTER:
|
||||
update_osd_on_output(server,
|
||||
output_nearest_to_cursor(server), osd_impl, &views);
|
||||
break;
|
||||
case OSD_OUTPUT_KEYBOARD: {
|
||||
struct output *output;
|
||||
if (server->active_view) {
|
||||
output = server->active_view->output;
|
||||
} else {
|
||||
/* Fallback to pointer, if there is no active_view */
|
||||
output = output_nearest_to_cursor(server);
|
||||
}
|
||||
update_osd_on_output(server, output, osd_impl, &views);
|
||||
break;
|
||||
}
|
||||
osd_impl->update(output);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue