aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client.h10
-rw-r--r--dwl.c12
2 files changed, 21 insertions, 1 deletions
diff --git a/client.h b/client.h
index a6b3723..191dcc5 100644
--- a/client.h
+++ b/client.h
@@ -104,6 +104,16 @@ client_is_float_type(Client *c)
}
static inline int
+client_wants_fullscreen(Client *c)
+{
+#ifdef XWAYLAND
+ if (client_is_x11(c))
+ return c->surface.xwayland->fullscreen;
+#endif
+ return c->surface.xdg->toplevel->requested.fullscreen;
+}
+
+static inline int
client_is_unmanaged(Client *c)
{
#ifdef XWAYLAND
diff --git a/dwl.c b/dwl.c
index 20e7c5c..3c57c23 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1043,7 +1043,14 @@ void
fullscreennotify(struct wl_listener *listener, void *data)
{
Client *c = wl_container_of(listener, c, fullscreen);
- setfullscreen(c, !c->isfullscreen);
+ int fullscreen = client_wants_fullscreen(c);
+
+ if (!c->mon) {
+ /* if the client is not mapped yet, let mapnotify() call setfullscreen() */
+ c->isfullscreen = fullscreen;
+ return;
+ }
+ setfullscreen(c, fullscreen);
}
Monitor *
@@ -1318,6 +1325,9 @@ mapnotify(struct wl_listener *listener, void *data)
/* Set initial monitor, tags, floating status, and focus */
applyrules(c);
printstatus();
+
+ if (c->isfullscreen)
+ setfullscreen(c, 1);
}
void