wayland: apply CSD geometry offset in wl_window_move
Without this, moving a CSD client (Firefox) causes the surface to "pop" out of the WM frame — the scene node was positioned at the raw frame-relative coords without subtracting geometry.x/y.
This commit is contained in:
parent
1ee10d37f5
commit
bb95bd52cd
|
|
@ -189,11 +189,16 @@ void wl_window_move(WNativeWindow win, int x, int y)
|
|||
v->x = x; v->y = y;
|
||||
}
|
||||
if (v->scene_node) {
|
||||
/* Scene node is a child of the frame tree — use relative coords */
|
||||
/* Scene node position must account for CSD geometry offset */
|
||||
int gx = 0, gy = 0;
|
||||
if (v->xdg_surface) {
|
||||
gx = v->xdg_surface->geometry.x;
|
||||
gy = v->xdg_surface->geometry.y;
|
||||
}
|
||||
if (v->frame_id)
|
||||
wlr_scene_node_set_position(&v->scene_node->node, x, y);
|
||||
wlr_scene_node_set_position(&v->scene_node->node, x - gx, y - gy);
|
||||
else
|
||||
wlr_scene_node_set_position(&v->scene_node->node, v->x, v->y);
|
||||
wlr_scene_node_set_position(&v->scene_node->node, v->x - gx, v->y - gy);
|
||||
}
|
||||
if (v->xw_surface)
|
||||
wlr_xwayland_surface_configure(v->xw_surface,
|
||||
|
|
|
|||
Loading…
Reference in New Issue