window: Add proper interpretation of dx/dy

dx/dy should be against the regular window's rect, and need to
be ignored when we're resizing. Instead, we use gravity to anchor
the window's new rectangle when resizing.
This commit is contained in:
Jasper St. Pierre 2014-04-16 16:26:23 -04:00
parent 0797206cc2
commit c1f4352683
3 changed files with 13 additions and 15 deletions

View File

@ -415,12 +415,6 @@ struct _MetaWindow
*/
MetaRectangle rect;
/* The size and position we want the window to be (i.e. what we last asked
* the client to configure).
* This is only used for wayland clients.
*/
MetaRectangle expected_rect;
gboolean has_custom_frame_extents;
GtkBorder custom_frame_extents;

View File

@ -4405,14 +4405,23 @@ meta_window_move_resize_wayland (MetaWindow *window,
flags = META_IS_WAYLAND_RESIZE;
meta_window_get_position (window, &x, &y);
x += dx; y += dy;
if (x != window->expected_rect.x || y != window->expected_rect.y)
flags |= META_IS_MOVE_ACTION;
/* dx/dy are ignored during resizing */
if (!meta_grab_op_is_resizing (window->display->grab_op))
{
if (dx != 0 || dy != 0)
{
x += dx;
y += dy;
flags |= META_IS_MOVE_ACTION;
}
}
if (width != window->rect.width || height != window->rect.height)
flags |= META_IS_RESIZE_ACTION;
meta_window_move_resize_internal (window, flags, NorthWestGravity,
meta_window_move_resize_internal (window, flags,
meta_resize_gravity_from_grab_op (window->display->grab_op),
x, y, width, height);
save_user_window_placement (window);
}

View File

@ -131,11 +131,6 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
* it can be for maximized or fullscreen.
*/
/* First, save where we would like the client to be. This is used by the next
* attach to determine if the client is really moving/resizing or not.
*/
window->expected_rect = constrained_rect;
if (flags & META_IS_WAYLAND_RESIZE)
{
/* This is a call to wl_surface_commit(), ignore the constrained_rect and