aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-12-19 21:43:15 -0600
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-12-20 21:53:45 -0600
commitafacc9b0b50fe9c63700e62f7d2083c6edb9d17b (patch)
tree574a17552257ed426cf484e4156e140bb5c116c4
parentdd9d8d543cc511df44035c0e3fe32a5f17a31c29 (diff)
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
-rw-r--r--dwl.c13
1 files changed, 12 insertions, 1 deletions
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};
@@ -771,6 +774,13 @@ commitnotify(struct wl_listener *listener, void *data)
}
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)
{
struct wlr_idle_inhibitor_v1 *idle_inhibitor = 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