[mutter/wayland] wayland-surface: Make set_margin double-buffered as well
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wayland] wayland-surface: Make set_margin double-buffered as well
- Date: Mon, 10 Feb 2014 19:17:13 +0000 (UTC)
commit f16e9b2ee7377ae2065e53627537276aeb75cd4d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Mon Feb 10 14:16:06 2014 -0500
wayland-surface: Make set_margin double-buffered as well
src/wayland/meta-wayland-surface.c | 16 +++++++++-------
src/wayland/meta-wayland-surface.h | 3 +++
2 files changed, 12 insertions(+), 7 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 9666882..e5995d3 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -337,6 +337,9 @@ toplevel_surface_commit (MetaWaylandSurface *surface,
}
}
+ if (pending->frame_extents_changed)
+ meta_window_set_custom_frame_extents (surface->window, &pending->frame_extents);
+
if (pending->maximized.changed)
{
if (pending->maximized.value)
@@ -376,6 +379,7 @@ double_buffered_state_init (MetaWaylandDoubleBufferedState *state)
surface_handle_pending_buffer_destroy;
wl_list_init (&state->frame_callback_list);
+ state->frame_extents_changed = FALSE;
state->maximized.changed = FALSE;
state->fullscreen.changed = FALSE;
}
@@ -749,14 +753,12 @@ xdg_surface_set_margin (struct wl_client *client,
{
MetaWaylandSurfaceExtension *xdg_surface = wl_resource_get_user_data (resource);
MetaWaylandSurface *surface = wl_container_of (xdg_surface, surface, xdg_surface);
- GtkBorder extents;
-
- extents.left = left_margin;
- extents.right = right_margin;
- extents.top = top_margin;
- extents.bottom = bottom_margin;
- meta_window_set_custom_frame_extents (surface->window, &extents);
+ surface->pending.frame_extents_changed = TRUE;
+ surface->pending.frame_extents.left = left_margin;
+ surface->pending.frame_extents.right = right_margin;
+ surface->pending.frame_extents.top = top_margin;
+ surface->pending.frame_extents.bottom = bottom_margin;
}
static void
diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h
index 6b0516e..df725db 100644
--- a/src/wayland/meta-wayland-surface.h
+++ b/src/wayland/meta-wayland-surface.h
@@ -66,6 +66,9 @@ typedef struct
/* wl_surface.frame */
struct wl_list frame_callback_list;
+ gboolean frame_extents_changed;
+ GtkBorder frame_extents;
+
MetaWaylandStateFlag fullscreen;
MetaWaylandStateFlag maximized;
} MetaWaylandDoubleBufferedState;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]