From afacc9b0b50fe9c63700e62f7d2083c6edb9d17b Mon Sep 17 00:00:00 2001 From: Leonardo Hernández Hernández Date: Mon, 19 Dec 2022 21:43:15 -0600 Subject: force SSD when creating an xdg_toplevel_decoration object Closes: https://github.com/djpohly/dwl/issues/366 Not sure why GLFW apps do not get mapped when we do not tell them the decoration method --- dwl.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dwl.c b/dwl.c index f189139..2b4aa64 100644 --- a/dwl.c +++ b/dwl.c @@ -231,6 +231,7 @@ static void cleanupmon(struct wl_listener *listener, void *data); static void closemon(Monitor *m); static void commitlayersurfacenotify(struct wl_listener *listener, void *data); static void commitnotify(struct wl_listener *listener, void *data); +static void createdecoration(struct wl_listener *listener, void *data); static void createidleinhibitor(struct wl_listener *listener, void *data); static void createkeyboard(struct wlr_keyboard *keyboard); static void createlayersurface(struct wl_listener *listener, void *data); @@ -327,6 +328,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 *xdg_decoration_mgr; static struct wl_list clients; /* tiling order */ static struct wl_list fstack; /* focus order */ static struct wlr_idle *idle; @@ -369,6 +371,7 @@ static struct wl_listener new_input = {.notify = inputdevice}; 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_xdg_decoration = {.notify = createdecoration}; static struct wl_listener new_layer_shell_surface = {.notify = createlayersurface}; static struct wl_listener output_mgr_apply = {.notify = outputmgrapply}; static struct wl_listener output_mgr_test = {.notify = outputmgrtest}; @@ -770,6 +773,13 @@ commitnotify(struct wl_listener *listener, void *data) c->resize = 0; } +void +createdecoration(struct wl_listener *listener, void *data) +{ + struct wlr_xdg_toplevel_decoration_v1 *dec = data; + wlr_xdg_toplevel_decoration_v1_set_mode(dec, WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE); +} + void createidleinhibitor(struct wl_listener *listener, void *data) { @@ -2181,7 +2191,8 @@ setup(void) 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); + xdg_decoration_mgr = wlr_xdg_decoration_manager_v1_create(dpy); + wl_signal_add(&xdg_decoration_mgr->events.new_toplevel_decoration, &new_xdg_decoration); /* * Creates a cursor, which is a wlroots utility for tracking the cursor -- cgit v1.2.3