}
}
-/* N.B. Use view_move() if not resizing. */
void
view_move_resize(struct view *view, struct wlr_box geo)
{
geo.width -= margin.left + margin.right;
geo.height -= margin.top + margin.bottom;
- if (view->pending.width == geo.width
- && view->pending.height == geo.height) {
- /* move horizontally/vertically without changing size */
- view_move(view, geo.x, geo.y);
- } else {
- view_move_resize(view, geo);
- }
+ view_move_resize(view, geo);
}
static void
}
struct wlr_box dst = view_get_edge_snap_box(view, output, view->tiled);
- if (view->pending.width == dst.width
- && view->pending.height == dst.height) {
- /* move horizontally/vertically without changing size */
- view_move(view, dst.x, dst.y);
- } else {
- view_move_resize(view, dst);
- }
+ view_move_resize(view, dst);
}
static void
view_update_app_id(view);
}
+static void
+xdg_toplevel_view_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;
+
+ view_moved(view);
+}
+
static void
xdg_toplevel_view_configure(struct view *view, struct wlr_box geo)
{
view_adjust_size(view, &geo.width, &geo.height);
- view->pending = geo;
+ if (view->pending.width == geo.width && view->pending.height == geo.height) {
+ /*
+ * As wayland has no notion of a global position
+ * we are only updating the size. If a wayland
+ * client receives the same size it already has
+ * it might not respond to the configure request
+ * and thus we will never actually set the new
+ * position. To handle this case just call move
+ * directly.
+ */
+ xdg_toplevel_view_move(view, geo.x, geo.y);
+ return;
+ }
+
+ view->pending = geo;
struct wlr_xdg_toplevel *xdg_toplevel = xdg_toplevel_from_view(view);
uint32_t serial = wlr_xdg_toplevel_set_size(xdg_toplevel,
(uint32_t)geo.width, (uint32_t)geo.height);
}
}
-static void
-xdg_toplevel_view_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;
-
- view_moved(view);
-}
-
static void
xdg_toplevel_view_close(struct view *view)
{