aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2019-03-11 11:21:18 +0100
committerDrew DeVault <sir@cmpwn.com>2019-04-13 08:31:30 -0600
commit1515c56caef9ee670d9ddb6dd748f2ce9d5523f0 (patch)
treec18e1e3833d0e6b623b1bf239d4849cc53749dd0 /rootston
parent930e37eae97e2ae965f7ae3a05d2fdd700827688 (diff)
output: remove lx, ly
Fixes https://github.com/swaywm/wlroots/issues/1610
Diffstat (limited to 'rootston')
-rw-r--r--rootston/output.c28
-rw-r--r--rootston/xdg_shell.c13
-rw-r--r--rootston/xdg_shell_v6.c13
3 files changed, 33 insertions, 21 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);
diff --git a/rootston/xdg_shell.c b/rootston/xdg_shell.c
index de9830e6..60222750 100644
--- a/rootston/xdg_shell.c
+++ b/rootston/xdg_shell.c
@@ -87,21 +87,20 @@ static void popup_unconstrain(struct roots_xdg_popup *popup) {
struct wlr_output *output =
wlr_output_layout_output_at(layout, dest_x, dest_y);
-
if (output == NULL) {
return;
}
- int width = 0, height = 0;
- wlr_output_effective_resolution(output, &width, &height);
+ struct wlr_box *output_box =
+ wlr_output_layout_get_box(view->desktop->layout, output);
// the output box expressed in the coordinate system of the toplevel parent
// of the popup
struct wlr_box output_toplevel_sx_box = {
- .x = output->lx - view->box.x,
- .y = output->ly - view->box.y,
- .width = width,
- .height = height
+ .x = output_box->x - view->box.x,
+ .y = output_box->y - view->box.y,
+ .width = output_box->width,
+ .height = output_box->height,
};
wlr_xdg_popup_unconstrain_from_box(
diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c
index cb2a9eab..b80ea38d 100644
--- a/rootston/xdg_shell_v6.c
+++ b/rootston/xdg_shell_v6.c
@@ -87,21 +87,20 @@ static void popup_unconstrain(struct roots_xdg_popup_v6 *popup) {
struct wlr_output *output =
wlr_output_layout_output_at(layout, dest_x, dest_y);
-
if (output == NULL) {
return;
}
- int width = 0, height = 0;
- wlr_output_effective_resolution(output, &width, &height);
+ struct wlr_box *output_box =
+ wlr_output_layout_get_box(view->desktop->layout, output);
// the output box expressed in the coordinate system of the toplevel parent
// of the popup
struct wlr_box output_toplevel_sx_box = {
- .x = output->lx - view->box.x,
- .y = output->ly - view->box.y,
- .width = width,
- .height = height
+ .x = output_box->x - view->box.x,
+ .y = output_box->y - view->box.y,
+ .width = output_box->width,
+ .height = output_box->height,
};
wlr_xdg_popup_v6_unconstrain_from_box(popup->wlr_popup, &output_toplevel_sx_box);