xdg-shell: Add set_margin request

This is used to figure out the size of "invisible" decorations, which we'll
use to better know the visible extents of the surface, which we can use for
constraining, titlebars, and more.
This commit is contained in:
Jasper St. Pierre
2014-02-01 18:36:41 -05:00
committed by Kristian Høgsberg
parent 2097fe12d4
commit 7407345446
5 changed files with 72 additions and 0 deletions
+22
View File
@@ -3937,6 +3937,27 @@ window_sync_transient_for(struct window *window)
xdg_surface_set_transient_for(window->xdg_surface, parent_surface);
}
static void
window_sync_margin(struct window *window)
{
int margin;
if (!window->xdg_surface)
return;
if (!window->frame)
return;
margin = frame_get_shadow_margin(window->frame->frame);
/* Shadow size is the same on every side. */
xdg_surface_set_margin(window->xdg_surface,
margin,
margin,
margin,
margin);
}
static void
window_flush(struct window *window)
{
@@ -3953,6 +3974,7 @@ window_flush(struct window *window)
&xdg_surface_listener, window);
window_sync_transient_for(window);
window_sync_margin(window);
}
}