mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
xwayland.c: Fix positioning with multiple queued configure events
Prevents a single action like ToggleDecorations + ToggleMaximize to position the view somewhere with negative coordinates when unmaximizing. It may still position the view on negative coordinates but later commit events will fix the position. This issue only exists on xwayland because there are no configure serials which we could use to ignore all repositioning until we are at the latest desired state.
This commit is contained in:
parent
00b2925461
commit
841b6550a9
1 changed files with 7 additions and 1 deletions
|
|
@ -14,13 +14,19 @@ handle_commit(struct wl_listener *listener, void *data)
|
||||||
view->h = view->surface->current.height;
|
view->h = view->surface->current.height;
|
||||||
|
|
||||||
if (view->pending_move_resize.update_x) {
|
if (view->pending_move_resize.update_x) {
|
||||||
|
/* Adjust x for queued up configure events */
|
||||||
view->x = view->pending_move_resize.x +
|
view->x = view->pending_move_resize.x +
|
||||||
view->pending_move_resize.width - view->w;
|
view->pending_move_resize.width - view->w;
|
||||||
view->pending_move_resize.update_x = false;
|
|
||||||
}
|
}
|
||||||
if (view->pending_move_resize.update_y) {
|
if (view->pending_move_resize.update_y) {
|
||||||
|
/* Adjust y for queued up configure events */
|
||||||
view->y = view->pending_move_resize.y +
|
view->y = view->pending_move_resize.y +
|
||||||
view->pending_move_resize.height - view->h;
|
view->pending_move_resize.height - view->h;
|
||||||
|
}
|
||||||
|
if ((int)view->pending_move_resize.width == view->w
|
||||||
|
&& (int)view->pending_move_resize.height == view->h) {
|
||||||
|
/* We reached the end of all queued size changing configure events */
|
||||||
|
view->pending_move_resize.update_x = false;
|
||||||
view->pending_move_resize.update_y = false;
|
view->pending_move_resize.update_y = false;
|
||||||
}
|
}
|
||||||
ssd_update_geometry(view, false);
|
ssd_update_geometry(view, false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue