workspaces: place osd at the center of output rather than usable area

This commit is contained in:
tokyo4j 2025-11-02 11:37:57 +09:00 committed by Consolatis
parent 9b6e2b71e6
commit 9ce57c5f36

View file

@ -170,12 +170,8 @@ _osd_update(struct server *server)
struct wlr_box output_box; struct wlr_box output_box;
wlr_output_layout_get_box(output->server->output_layout, wlr_output_layout_get_box(output->server->output_layout,
output->wlr_output, &output_box); output->wlr_output, &output_box);
int lx = output->usable_area.x int lx = output_box.x + (output_box.width - width) / 2;
+ (output->usable_area.width - width) / 2 int ly = output_box.y + (output_box.height - height) / 2;
+ output_box.x;
int ly = output->usable_area.y
+ (output->usable_area.height - height) / 2
+ output_box.y;
wlr_scene_node_set_position(&output->workspace_osd->node, lx, ly); wlr_scene_node_set_position(&output->workspace_osd->node, lx, ly);
wlr_scene_buffer_set_buffer(output->workspace_osd, &buffer->base); wlr_scene_buffer_set_buffer(output->workspace_osd, &buffer->base);
wlr_scene_buffer_set_dest_size(output->workspace_osd, wlr_scene_buffer_set_dest_size(output->workspace_osd,