aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-13 21:32:55 -0600
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-13 21:32:55 -0600
commit88f241d1cf54ffb7ec1f6e092ccb547c96f57ac9 (patch)
tree02c2ce6ad1441411c98b5448a7b1190694862304 /dwl.c
parentebff6e38a02086bd6078a444641a83cb226f9995 (diff)
parent43228bd493f53f996a645156f0505b63e79a4f72 (diff)
Merge branch 'fix-segfault-in-fullscreennotify'
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c12
1 files changed, 11 insertions, 1 deletions
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