mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
rootston: use box for views position
This commit is contained in:
parent
d703ae45dd
commit
0f3a061f60
10 changed files with 89 additions and 90 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue