wayland: Don't require a new buffer to move windows with dx/dy
This doesn't match what Weston does. I don't know of any apps that this fixes (we don't have any apps that even use non-zero dx/dy, I don't think), but this is part of a cleanup for window geometry.
This commit is contained in:
parent
567ca15610
commit
90d7737fc1
@ -165,16 +165,11 @@ cursor_surface_commit (MetaWaylandSurface *surface,
|
|||||||
static void
|
static void
|
||||||
toplevel_surface_commit (MetaWaylandSurface *surface,
|
toplevel_surface_commit (MetaWaylandSurface *surface,
|
||||||
MetaWaylandPendingState *pending)
|
MetaWaylandPendingState *pending)
|
||||||
{
|
|
||||||
if (pending->frame_extents_changed)
|
|
||||||
meta_window_set_custom_frame_extents (surface->window, &pending->frame_extents);
|
|
||||||
|
|
||||||
if (pending->newly_attached)
|
|
||||||
{
|
{
|
||||||
MetaWindow *window = surface->window;
|
MetaWindow *window = surface->window;
|
||||||
MetaWaylandBuffer *buffer = pending->buffer;
|
|
||||||
|
|
||||||
if (buffer == NULL)
|
/* Sanity check. */
|
||||||
|
if (surface->buffer == NULL)
|
||||||
{
|
{
|
||||||
wl_resource_post_error (surface->resource,
|
wl_resource_post_error (surface->resource,
|
||||||
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
WL_DISPLAY_ERROR_INVALID_OBJECT,
|
||||||
@ -182,13 +177,16 @@ toplevel_surface_commit (MetaWaylandSurface *surface,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pending->frame_extents_changed)
|
||||||
|
meta_window_set_custom_frame_extents (surface->window, &pending->frame_extents);
|
||||||
|
|
||||||
/* We resize X based surfaces according to X events */
|
/* We resize X based surfaces according to X events */
|
||||||
if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
|
if (window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND)
|
||||||
{
|
{
|
||||||
int new_width, new_height;
|
int new_width, new_height;
|
||||||
|
|
||||||
new_width = cogl_texture_get_width (buffer->texture);
|
new_width = cogl_texture_get_width (surface->buffer->texture);
|
||||||
new_height = cogl_texture_get_height (buffer->texture);
|
new_height = cogl_texture_get_height (surface->buffer->texture);
|
||||||
|
|
||||||
if (new_width != window->rect.width ||
|
if (new_width != window->rect.width ||
|
||||||
new_height != window->rect.height ||
|
new_height != window->rect.height ||
|
||||||
@ -197,7 +195,6 @@ toplevel_surface_commit (MetaWaylandSurface *surface,
|
|||||||
meta_window_wayland_move_resize (window, new_width, new_height, pending->dx, pending->dy);
|
meta_window_wayland_move_resize (window, new_width, new_height, pending->dx, pending->dy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
surface_handle_pending_buffer_destroy (struct wl_listener *listener, void *data)
|
surface_handle_pending_buffer_destroy (struct wl_listener *listener, void *data)
|
||||||
@ -268,14 +265,11 @@ move_pending_state (MetaWaylandPendingState *from,
|
|||||||
static void
|
static void
|
||||||
subsurface_surface_commit (MetaWaylandSurface *surface,
|
subsurface_surface_commit (MetaWaylandSurface *surface,
|
||||||
MetaWaylandPendingState *pending)
|
MetaWaylandPendingState *pending)
|
||||||
{
|
|
||||||
if (pending->newly_attached)
|
|
||||||
{
|
{
|
||||||
MetaSurfaceActor *surface_actor = surface->surface_actor;
|
MetaSurfaceActor *surface_actor = surface->surface_actor;
|
||||||
MetaWaylandBuffer *buffer = pending->buffer;
|
|
||||||
float x, y;
|
float x, y;
|
||||||
|
|
||||||
if (buffer != NULL)
|
if (surface->buffer != NULL)
|
||||||
clutter_actor_show (CLUTTER_ACTOR (surface_actor));
|
clutter_actor_show (CLUTTER_ACTOR (surface_actor));
|
||||||
else
|
else
|
||||||
clutter_actor_hide (CLUTTER_ACTOR (surface_actor));
|
clutter_actor_hide (CLUTTER_ACTOR (surface_actor));
|
||||||
@ -285,7 +279,6 @@ subsurface_surface_commit (MetaWaylandSurface *surface,
|
|||||||
y += pending->dy;
|
y += pending->dy;
|
||||||
clutter_actor_set_position (CLUTTER_ACTOR (surface_actor), x, y);
|
clutter_actor_set_position (CLUTTER_ACTOR (surface_actor), x, y);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
subsurface_parent_surface_committed (MetaWaylandSurface *surface);
|
subsurface_parent_surface_committed (MetaWaylandSurface *surface);
|
||||||
@ -423,16 +416,13 @@ wl_surface_attach (struct wl_client *client,
|
|||||||
else
|
else
|
||||||
buffer = NULL;
|
buffer = NULL;
|
||||||
|
|
||||||
if (surface->buffer == buffer)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (surface->pending.buffer)
|
if (surface->pending.buffer)
|
||||||
wl_list_remove (&surface->pending.buffer_destroy_listener.link);
|
wl_list_remove (&surface->pending.buffer_destroy_listener.link);
|
||||||
|
|
||||||
|
surface->pending.newly_attached = TRUE;
|
||||||
|
surface->pending.buffer = buffer;
|
||||||
surface->pending.dx = dx;
|
surface->pending.dx = dx;
|
||||||
surface->pending.dy = dy;
|
surface->pending.dy = dy;
|
||||||
surface->pending.buffer = buffer;
|
|
||||||
surface->pending.newly_attached = TRUE;
|
|
||||||
|
|
||||||
if (buffer)
|
if (buffer)
|
||||||
wl_signal_add (&buffer->destroy_signal,
|
wl_signal_add (&buffer->destroy_signal,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user