Merge pull request #1053 from emersion/xdg-decoration

Add xdg-decoration-unstable-v1 support
This commit is contained in:
Drew DeVault 2018-08-02 09:33:10 -04:00 committed by GitHub
commit 5642c5cc8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 807 additions and 43 deletions

View file

@ -552,6 +552,23 @@ void view_update_size(struct roots_view *view, uint32_t width, uint32_t height)
view_damage_whole(view);
}
void view_update_decorated(struct roots_view *view, bool decorated) {
if (view->decorated == decorated) {
return;
}
view_damage_whole(view);
view->decorated = decorated;
if (decorated) {
view->border_width = 4;
view->titlebar_height = 12;
} else {
view->border_width = 0;
view->titlebar_height = 0;
}
view_damage_whole(view);
}
static bool view_at(struct roots_view *view, double lx, double ly,
struct wlr_surface **surface, double *sx, double *sy) {
if (view->type == ROOTS_WL_SHELL_VIEW &&
@ -884,6 +901,12 @@ struct roots_desktop *desktop_create(struct roots_server *server,
desktop->screencopy = wlr_screencopy_manager_v1_create(server->wl_display);
desktop->xdg_decoration_manager =
wlr_xdg_decoration_manager_v1_create(server->wl_display);
wl_signal_add(&desktop->xdg_decoration_manager->events.new_toplevel_decoration,
&desktop->xdg_toplevel_decoration);
desktop->xdg_toplevel_decoration.notify = handle_xdg_toplevel_decoration;
return desktop;
}