summaryrefslogtreecommitdiff
path: root/downdate2.diff
blob: 2dec598c88be0721f89e45ccd6962dbc4828786d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
diff --git a/dwl.c b/dwl.c
index 2533ef7..227e1c4 100644
--- a/dwl.c
+++ b/dwl.c
@@ -574,7 +574,7 @@ arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, int
 		const uint32_t both_vert = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP
 			| ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM;
 
-		if (wlr_layer_surface->mapped && exclusive != (state->exclusive_zone > 0))
+		if (exclusive != (state->exclusive_zone > 0))
 			continue;
 
 		bounds = state->exclusive_zone == -1 ? full_area : *usable_area;
@@ -643,8 +643,6 @@ arrangelayers(Monitor *m)
 		ZWLR_LAYER_SHELL_V1_LAYER_TOP,
 	};
 	LayerSurface *layersurface;
-	if (!m || !m->wlr_output->enabled)
-		return;
 
 	/* Arrange exclusive surfaces from top->bottom */
 	for (i = 3; i >= 0; i--)
@@ -803,7 +801,6 @@ cleanupmon(struct wl_listener *listener, void *data)
 	wl_list_remove(&m->destroy.link);
 	wl_list_remove(&m->frame.link);
 	wl_list_remove(&m->link);
-	wlr_output->data = NULL;
 	wlr_output_layout_remove(output_layout, m->wlr_output);
 	wlr_scene_output_destroy(m->scene_output);
 
@@ -838,9 +835,8 @@ commitlayersurfacenotify(struct wl_listener *listener, void *data)
 {
 	LayerSurface *layersurface = wl_container_of(listener, layersurface, surface_commit);
 	struct wlr_layer_surface_v1 *wlr_layer_surface = layersurface->layer_surface;
-	struct wlr_output *wlr_output = wlr_layer_surface->output;
 
-	if (!wlr_output || !(layersurface->mon = wlr_output->data))
+	if (!layersurface->mon)
 		return;
 
 	if (layers[wlr_layer_surface->current.layer] != layersurface->scene) {
@@ -1131,6 +1127,8 @@ destroylayersurfacenotify(struct wl_listener *listener, void *data)
 	wl_list_remove(&layersurface->unmap.link);
 	wl_list_remove(&layersurface->surface_commit.link);
 	wlr_scene_node_destroy(layersurface->scene);
+	if (layersurface->mon)
+		arrangelayers(layersurface->mon);
 	free(layersurface);
 }
 
@@ -1553,6 +1551,9 @@ mapnotify(struct wl_listener *listener, void *data)
 	}
 	printstatus();
 
+	if (c->isfullscreen)
+		setfullscreen(c, 1);
+
 	c->mon->un_map = 1;
 	if (!c->noswallow) {
 			Client *p = termforwin(c);
@@ -2028,8 +2029,6 @@ void
 setfullscreen(Client *c, int fullscreen)
 {
 	c->isfullscreen = fullscreen;
-	if (!c->mon)
-		return;
 	c->bw = fullscreen ? 0 : borderpx;
 	client_set_fullscreen(c, fullscreen);
 
@@ -2115,7 +2114,7 @@ setmon(Client *c, Monitor *m, unsigned int newtags)
 		resize(c, c->geom, 0, 1);
 		wlr_surface_send_enter(client_surface(c), m->wlr_output);
 		c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
-		setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
+		arrange(m);
 	}
 	focusclient(focustop(selmon), 1);
 }