// SPDX-License-Identifier: GPL-2.0-only
#include <assert.h>
+#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/util/box.h>
#include <wlr/util/log.h>
bool show_workspace = wl_list_length(&rc.workspace_config.workspaces) > 1;
const char *workspace_name = server->workspaces.current->name;
- int output_width, output_height;
- wlr_output_effective_resolution(output->wlr_output,
- &output_width, &output_height);
+ struct wlr_box output_box;
+ wlr_output_layout_get_box(server->output_layout, output->wlr_output,
+ &output_box);
int w = switcher_theme->width;
if (switcher_theme->width_is_percent) {
- w = output_width * switcher_theme->width / 100;
+ w = output_box.width * switcher_theme->width / 100;
}
int h = wl_array_len(views) * switcher_theme->item_height
+ 2 * rc.theme->osd_border_width + 2 * switcher_theme->padding;
error:;
/* Center OSD */
- struct wlr_box usable = output_usable_area_in_layout_coords(output);
wlr_scene_node_set_position(&output->osd_scene.tree->node,
- usable.x + usable.width / 2 - w / 2,
- usable.y + usable.height / 2 - h / 2);
+ output_box.x + (output_box.width - w) / 2,
+ output_box.y + (output_box.height - h) / 2);
}
static void
// SPDX-License-Identifier: GPL-2.0-only
#include <assert.h>
+#include <wlr/render/allocator.h>
#include <wlr/render/swapchain.h>
+#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h>
-#include <wlr/render/allocator.h>
#include "config/rcxml.h"
#include "common/array.h"
#include "common/box.h"
{
assert(!output->osd_scene.tree);
- struct theme *theme = output->server->theme;
+ struct server *server = output->server;
+ struct theme *theme = server->theme;
struct window_switcher_thumbnail_theme *switcher_theme =
&theme->osd_window_switcher_thumbnail;
int padding = theme->osd_border_width + switcher_theme->padding;
wlr_scene_node_lower_to_bottom(&bg->tree->node);
/* center */
- struct wlr_box usable = output_usable_area_in_layout_coords(output);
- int lx = usable.x + (usable.width - bg_opts.width) / 2;
- int ly = usable.y + (usable.height - bg_opts.height) / 2;
+ struct wlr_box output_box;
+ wlr_output_layout_get_box(server->output_layout, output->wlr_output,
+ &output_box);
+ int lx = output_box.x + (output_box.width - bg_opts.width) / 2;
+ int ly = output_box.y + (output_box.height - bg_opts.height) / 2;
wlr_scene_node_set_position(&output->osd_scene.tree->node, lx, ly);
}