diff --git a/dwl.c b/dwl.c index 8683462..7681365 100644 --- a/dwl.c +++ b/dwl.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -255,6 +254,7 @@ static void motionabsolute(struct wl_listener *listener, void *data); static void motionnotify(uint32_t time); static void motionrelative(struct wl_listener *listener, void *data); static void moveresize(const Arg *arg); +static void newdecoration(struct wl_listener *listener, void *data); static void outputmgrapply(struct wl_listener *listener, void *data); static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test); static void outputmgrtest(struct wl_listener *listener, void *data); @@ -313,6 +313,7 @@ static struct wlr_compositor *compositor; static struct wlr_xdg_shell *xdg_shell; static struct wlr_xdg_activation_v1 *activation; +static struct wlr_xdg_decoration_manager_v1 *decoration; static struct wl_list clients; /* tiling order */ static struct wl_list fstack; /* focus order */ static struct wl_list stack; /* stacking z-order */ @@ -349,6 +350,7 @@ static struct wl_listener new_virtual_keyboard = {.notify = virtualkeyboard}; static struct wl_listener new_output = {.notify = createmon}; static struct wl_listener new_xdg_surface = {.notify = createnotify}; static struct wl_listener new_layer_shell_surface = {.notify = createlayersurface}; +static struct wl_listener new_xdg_decoration = {.notify = newdecoration}; static struct wl_listener output_mgr_apply = {.notify = outputmgrapply}; static struct wl_listener output_mgr_test = {.notify = outputmgrtest}; static struct wl_listener request_activate = {.notify = urgent}; @@ -1456,6 +1458,13 @@ moveresize(const Arg *arg) } } +void +newdecoration(struct wl_listener *listener, void *data) +{ + wlr_xdg_toplevel_decoration_v1_set_mode(data, + WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE); +} + void outputmgrapply(struct wl_listener *listener, void *data) { @@ -2065,10 +2074,8 @@ setup(void) wl_signal_add(&xdg_shell->events.new_surface, &new_xdg_surface); /* Use decoration protocols to negotiate server-side decorations */ - wlr_server_decoration_manager_set_default_mode( - wlr_server_decoration_manager_create(dpy), - WLR_SERVER_DECORATION_MANAGER_MODE_SERVER); - wlr_xdg_decoration_manager_v1_create(dpy); + decoration = wlr_xdg_decoration_manager_v1_create(dpy); + wl_signal_add(&decoration->events.new_toplevel_decoration, &new_xdg_decoration); /* * Creates a cursor, which is a wlroots utility for tracking the cursor