Set node position in xdg/xwayland commit handlers

...in order to sync resize/move events to avoid left/bottom edge wobbling
when resizing with top/left resize edges
This commit is contained in:
Johan Malm 2022-02-23 22:39:57 +00:00
parent 581a2bb2f1
commit f4c9d1ba9f
3 changed files with 8 additions and 3 deletions

View file

@ -12,6 +12,8 @@ handle_commit(struct wl_listener *listener, void *data)
/* Must receive commit signal before accessing surface->current* */
view->w = view->surface->current.width;
view->h = view->surface->current.height;
bool move_pending = view->pending_move_resize.update_x
|| view->pending_move_resize.update_y;
if (view->pending_move_resize.update_x) {
view->x = view->pending_move_resize.x +
@ -23,6 +25,10 @@ handle_commit(struct wl_listener *listener, void *data)
view->pending_move_resize.height - view->h;
view->pending_move_resize.update_y = false;
}
if (move_pending) {
wlr_scene_node_set_position(&view->scene_tree->node,
view->x, view->y);
}
ssd_update_geometry(view);
damage_view_whole(view);
}