mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
Merge pull request #1053 from emersion/xdg-decoration
Add xdg-decoration-unstable-v1 support
This commit is contained in:
commit
5642c5cc8f
14 changed files with 807 additions and 43 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue