summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2021-05-23 18:28:13 -0500
committerDevin J. Pohly <djpohly@gmail.com>2021-05-23 18:28:13 -0500
commit06ca86009296c1b8753cba259fd797703a281bbd (patch)
treef97052766b50b215231891c3e4ea7afb994d2dcc
parent56d93898ea91ef687d855f2f99d9803480f355e0 (diff)
factor xwayland hackiness out into client.h
-rw-r--r--client.h11
-rw-r--r--dwl.c11
2 files changed, 12 insertions, 10 deletions
diff --git a/client.h b/client.h
index f4735c2..56e3089 100644
--- a/client.h
+++ b/client.h
@@ -141,6 +141,17 @@ client_set_size(Client *c, uint32_t width, uint32_t height)
return wlr_xdg_toplevel_set_size(c->surface.xdg, width, height);
}
+static inline void
+client_set_tiled(Client *c, uint32_t edges)
+{
+#ifdef XWAYLAND
+ if (client_is_x11(c))
+ return;
+#endif
+ wlr_xdg_toplevel_set_tiled(c->surface.xdg, WLR_EDGE_TOP |
+ WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | WLR_EDGE_RIGHT);
+}
+
static inline struct wlr_surface *
client_surface(Client *c)
{
diff --git a/dwl.c b/dwl.c
index 3a562b9..9188f06 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1304,17 +1304,8 @@ mapnotify(struct wl_listener *listener, void *data)
c->geom.width += 2 * c->bw;
c->geom.height += 2 * c->bw;
-#ifdef XWAYLAND
- if (c->type == XDGShell) {
- /* Tell the client not to try anything fancy */
- wlr_xdg_toplevel_set_tiled(c->surface.xdg, WLR_EDGE_TOP |
- WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | WLR_EDGE_RIGHT);
- }
-#else
/* Tell the client not to try anything fancy */
- wlr_xdg_toplevel_set_tiled(c->surface.xdg, WLR_EDGE_TOP |
- WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | WLR_EDGE_RIGHT);
-#endif
+ client_set_tiled(c, WLR_EDGE_TOP | WLR_EDGE_BOTTOM | WLR_EDGE_LEFT | WLR_EDGE_RIGHT);
/* Set initial monitor, tags, floating status, and focus */
applyrules(c);