view: Unify view_move()/view_move_resize()

view->impl->move() is a specific case of view->impl->configure().
To reduce code duplication, we can use view->impl->configure() for
pure moves (without resize) as well.

xwayland's move() function also possibly contained a race condition
when there was a pending resize, as it used the current surface
width/height rather than the pending width/height. This is fixed.
This commit is contained in:
John Lindgren 2023-02-09 01:07:07 -05:00 committed by Consolatis
parent 859eba1c6b
commit 0ca6c4c763
4 changed files with 16 additions and 54 deletions

View file

@ -386,22 +386,6 @@ handle_set_class(struct wl_listener *listener, void *data)
view_update_app_id(view);
}
static void
move(struct view *view, int x, int y)
{
view->current.x = x;
view->current.y = y;
/* override any previous pending move */
view->pending.x = x;
view->pending.y = y;
struct wlr_xwayland_surface *s = xwayland_surface_from_view(view);
wlr_xwayland_surface_configure(s, (int16_t)x, (int16_t)y,
(uint16_t)s->width, (uint16_t)s->height);
view_moved(view);
}
static void
_close(struct view *view)
{
@ -615,7 +599,6 @@ static const struct view_impl xwl_view_impl = {
.close = _close,
.get_string_prop = get_string_prop,
.map = map,
.move = move,
.set_activated = set_activated,
.set_fullscreen = set_fullscreen,
.unmap = unmap,