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:
committed by
Kristian Høgsberg
parent
2097fe12d4
commit
7407345446
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user