gimp but for windows: a wayland compositor
git clone https://github.com/m-col/wimp
Files | Refs | Readme

Commit d184232071f0b0a77988fd5e996e33b1774a0464
Parent: d90893bc3392b7829dfc864c43d375150c8a9ec6
Author: mcol <mcol@posteo.net>
Date: 2021-01-24 11:03:39 +0000
Committer: mcol <mcol@posteo.net>
Committed: 2021-01-24 11:03:39 +0000

add super basic server decoration manager

src/types.h Modified

@@ -10,6 +10,7 @@
 #include <wlr/types/wlr_compositor.h>
 #include <wlr/types/wlr_cursor.h>
 #include <wlr/types/wlr_output_layout.h>
+#include <wlr/types/wlr_server_decoration.h>
 #include <wlr/types/wlr_xdg_decoration_v1.h>
 #include <wlr/types/wlr_xdg_shell.h>
 #include <wlr/util/log.h>
@@ -52,6 +53,7 @@
 
     struct wlr_xdg_decoration_manager_v1 *decoration_manager;
     struct wl_listener decoration_listener;
+    struct wlr_server_decoration_manager *server_decoration_manager;
 
     struct wlr_cursor *cursor;
     struct wlr_xcursor_manager *cursor_manager;

src/decorations.h Modified

@@ -3,12 +3,6 @@
 
 #include "types.h"
 
-struct decoration {
-    struct wlr_xdg_toplevel_decoration_v1 *wlr_xdg_decoration;
-    struct wl_listener destroy_listener;
-    struct wl_listener request_mode_listener;
-};
-
 void set_up_decorations(struct server *server);
 
 #endif

src/decorations.c Modified

@@ -1,6 +1,13 @@
 #include "decorations.h"
 
 
+struct decoration {
+    struct wlr_xdg_toplevel_decoration_v1 *wlr_xdg_decoration;
+    struct wl_listener destroy_listener;
+    struct wl_listener request_mode_listener;
+};
+
+
 static void on_destroy(struct wl_listener *listener, void *data) {
     struct decoration *deco = wl_container_of(listener, deco, destroy_listener);
     wl_list_remove(&deco->destroy_listener.link);
@@ -40,6 +47,7 @@
 
 
 void set_up_decorations(struct server *server) {
+    // xdg_decoration
     server->decoration_manager = wlr_xdg_decoration_manager_v1_create(server->display);
 
     server->decoration_listener.notify = on_new_decoration;
@@ -47,4 +55,11 @@
         &server->decoration_manager->events.new_toplevel_decoration,
         &server->decoration_listener
     );
+
+    // server_decoration
+    server->server_decoration_manager = wlr_server_decoration_manager_create(server->display);
+    wlr_server_decoration_manager_set_default_mode(
+	server->server_decoration_manager,
+	WLR_SERVER_DECORATION_MANAGER_MODE_SERVER
+    );
 }