1
0
Fork 0

wayland-surface: Make set_margin double-buffered as well

This commit is contained in:
Jasper St. Pierre 2014-02-10 14:16:06 -05:00
parent 06380938d4
commit f16e9b2ee7
2 changed files with 12 additions and 7 deletions

View file

@ -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.changed)
{ {
if (pending->maximized.value) if (pending->maximized.value)
@ -376,6 +379,7 @@ double_buffered_state_init (MetaWaylandDoubleBufferedState *state)
surface_handle_pending_buffer_destroy; surface_handle_pending_buffer_destroy;
wl_list_init (&state->frame_callback_list); wl_list_init (&state->frame_callback_list);
state->frame_extents_changed = FALSE;
state->maximized.changed = FALSE; state->maximized.changed = FALSE;
state->fullscreen.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); MetaWaylandSurfaceExtension *xdg_surface = wl_resource_get_user_data (resource);
MetaWaylandSurface *surface = wl_container_of (xdg_surface, surface, xdg_surface); MetaWaylandSurface *surface = wl_container_of (xdg_surface, surface, xdg_surface);
GtkBorder extents;
extents.left = left_margin; surface->pending.frame_extents_changed = TRUE;
extents.right = right_margin; surface->pending.frame_extents.left = left_margin;
extents.top = top_margin; surface->pending.frame_extents.right = right_margin;
extents.bottom = bottom_margin; surface->pending.frame_extents.top = top_margin;
surface->pending.frame_extents.bottom = bottom_margin;
meta_window_set_custom_frame_extents (surface->window, &extents);
} }
static void static void

View file

@ -66,6 +66,9 @@ typedef struct
/* wl_surface.frame */ /* wl_surface.frame */
struct wl_list frame_callback_list; struct wl_list frame_callback_list;
gboolean frame_extents_changed;
GtkBorder frame_extents;
MetaWaylandStateFlag fullscreen; MetaWaylandStateFlag fullscreen;
MetaWaylandStateFlag maximized; MetaWaylandStateFlag maximized;
} MetaWaylandDoubleBufferedState; } MetaWaylandDoubleBufferedState;