mirror of
https://github.com/swaywm/sway.git
synced 2026-03-06 01:40:42 -05:00
tree/view: fix initial positioning
This commit is contained in:
parent
ea11148a49
commit
ccbb811f7f
1 changed files with 3 additions and 2 deletions
|
|
@ -871,8 +871,9 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface,
|
||||||
wlr_xdg_toplevel_drag_v1_from_wlr_xdg_toplevel(
|
wlr_xdg_toplevel_drag_v1_from_wlr_xdg_toplevel(
|
||||||
server.xdg_toplevel_drag_manager, view->wlr_xdg_toplevel);
|
server.xdg_toplevel_drag_manager, view->wlr_xdg_toplevel);
|
||||||
if (toplevel_drag != NULL) {
|
if (toplevel_drag != NULL) {
|
||||||
double x = seat->cursor->cursor->x - toplevel_drag->x_offset;
|
struct wlr_box *geo = &view->geometry;
|
||||||
double y = seat->cursor->cursor->y - toplevel_drag->y_offset;
|
double x = seat->cursor->cursor->x - toplevel_drag->x_offset - geo->x;
|
||||||
|
double y = seat->cursor->cursor->y - toplevel_drag->y_offset - geo->y;
|
||||||
container_floating_move_to(view->container, x, y);
|
container_floating_move_to(view->container, x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue