rootston: use box for views position

This commit is contained in:
Louis Taylor 2018-12-05 09:01:25 +00:00
parent d703ae45dd
commit 0f3a061f60
No known key found for this signature in database
GPG key ID: 8E81A6DAE13E7098
10 changed files with 89 additions and 90 deletions

View file

@ -73,8 +73,8 @@ static void popup_unconstrain(struct roots_xdg_popup_v6 *popup) {
int popup_lx, popup_ly;
wlr_xdg_popup_v6_get_toplevel_coords(wlr_popup, wlr_popup->geometry.x,
wlr_popup->geometry.y, &popup_lx, &popup_ly);
popup_lx += view->x;
popup_ly += view->y;
popup_lx += view->box.x;
popup_ly += view->box.y;
anchor_lx += popup_lx;
anchor_ly += popup_ly;
@ -96,8 +96,8 @@ static void popup_unconstrain(struct roots_xdg_popup_v6 *popup) {
// 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->x,
.y = output->ly - view->y,
.x = output->lx - view->box.x,
.y = output->ly - view->box.y,
.width = width,
.height = height
};
@ -193,8 +193,8 @@ static void move_resize(struct roots_view *view, double x, double y,
return;
}
bool update_x = x != view->x;
bool update_y = y != view->y;
bool update_x = x != view->box.x;
bool update_y = y != view->box.y;
uint32_t constrained_width, constrained_height;
apply_size_constraints(surface, width, height, &constrained_width,
@ -344,8 +344,8 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) {
uint32_t pending_serial =
roots_surface->pending_move_resize_configure_serial;
if (pending_serial > 0 && pending_serial >= surface->configure_serial) {
double x = view->x;
double y = view->y;
double x = view->box.x;
double y = view->box.y;
if (view->pending_move_resize.update_x) {
x = view->pending_move_resize.x + view->pending_move_resize.width -
size.width;
@ -376,8 +376,8 @@ static void handle_map(struct wl_listener *listener, void *data) {
struct wlr_box box;
get_size(view, &box);
view->width = box.width;
view->height = box.height;
view->box.width = box.width;
view->box.height = box.height;
view_map(view, view->xdg_surface_v6->surface);
view_setup(view);