aboutsummaryrefslogtreecommitdiff
path: root/rootston/desktop.c
diff options
context:
space:
mode:
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r--rootston/desktop.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c
index 17bf7ec4..658611e3 100644
--- a/rootston/desktop.c
+++ b/rootston/desktop.c
@@ -9,6 +9,7 @@
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_export_dmabuf_v1.h>
#include <wlr/types/wlr_gamma_control.h>
+#include <wlr/types/wlr_gamma_control_v1.h>
#include <wlr/types/wlr_idle_inhibit_v1.h>
#include <wlr/types/wlr_idle.h>
#include <wlr/types/wlr_input_inhibitor.h>
@@ -552,6 +553,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 &&
@@ -851,6 +869,8 @@ struct roots_desktop *desktop_create(struct roots_server *server,
desktop->gamma_control_manager = wlr_gamma_control_manager_create(
server->wl_display);
+ desktop->gamma_control_manager_v1 = wlr_gamma_control_manager_v1_create(
+ server->wl_display);
desktop->screenshooter = wlr_screenshooter_create(server->wl_display);
desktop->export_dmabuf_manager_v1 =
wlr_export_dmabuf_manager_v1_create(server->wl_display);
@@ -884,6 +904,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;
}