aboutsummaryrefslogtreecommitdiff
path: root/rootston/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'rootston/output.c')
-rw-r--r--rootston/output.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/rootston/output.c b/rootston/output.c
index 54d27d0d..92a969f7 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -122,12 +122,15 @@ void output_surface_for_each_surface(struct roots_output *output,
void output_view_for_each_surface(struct roots_output *output,
struct roots_view *view, roots_surface_iterator_func_t iterator,
void *user_data) {
+ struct wlr_box *output_box =
+ wlr_output_layout_get_box(output->desktop->layout, output->wlr_output);
+
struct surface_iterator_data data = {
.user_iterator = iterator,
.user_data = user_data,
.output = output,
- .ox = view->box.x - output->wlr_output->lx,
- .oy = view->box.y - output->wlr_output->ly,
+ .ox = view->box.x - output_box->x,
+ .oy = view->box.y - output_box->y,
.width = view->box.width,
.height = view->box.height,
.rotation = view->rotation,
@@ -140,11 +143,14 @@ void output_view_for_each_surface(struct roots_output *output,
void output_xwayland_children_for_each_surface(
struct roots_output *output, struct wlr_xwayland_surface *surface,
roots_surface_iterator_func_t iterator, void *user_data) {
+ struct wlr_box *output_box =
+ wlr_output_layout_get_box(output->desktop->layout, output->wlr_output);
+
struct wlr_xwayland_surface *child;
wl_list_for_each(child, &surface->children, parent_link) {
if (child->mapped) {
- double ox = child->x - output->wlr_output->lx;
- double oy = child->y - output->wlr_output->ly;
+ double ox = child->x - output_box->x;
+ double oy = child->y - output_box->y;
output_surface_for_each_surface(output, child->surface,
ox, oy, iterator, user_data);
}
@@ -187,6 +193,9 @@ void output_layer_for_each_surface(struct roots_output *output,
void output_drag_icons_for_each_surface(struct roots_output *output,
struct roots_input *input, roots_surface_iterator_func_t iterator,
void *user_data) {
+ struct wlr_box *output_box =
+ wlr_output_layout_get_box(output->desktop->layout, output->wlr_output);
+
struct roots_seat *seat;
wl_list_for_each(seat, &input->seats, link) {
struct roots_drag_icon *drag_icon = seat->drag_icon;
@@ -194,8 +203,8 @@ void output_drag_icons_for_each_surface(struct roots_output *output,
continue;
}
- double ox = drag_icon->x - output->wlr_output->lx;
- double oy = drag_icon->y - output->wlr_output->ly;
+ double ox = drag_icon->x - output_box->x;
+ double oy = drag_icon->y - output_box->y;
output_surface_for_each_surface(output,
drag_icon->wlr_drag_icon->surface, ox, oy, iterator, user_data);
}
@@ -430,7 +439,12 @@ static void update_output_manager_config(struct roots_desktop *desktop) {
struct roots_output *output;
wl_list_for_each(output, &desktop->outputs, link) {
- wlr_output_configuration_head_v1_create(config, output->wlr_output);
+ struct wlr_output_configuration_head_v1 *config_head =
+ wlr_output_configuration_head_v1_create(config, output->wlr_output);
+ struct wlr_box *output_box = wlr_output_layout_get_box(
+ output->desktop->layout, output->wlr_output);
+ config_head->state.x = output_box->x;
+ config_head->state.y = output_box->y;
}
wlr_output_manager_v1_set_configuration(desktop->output_manager_v1, config);