summaryrefslogtreecommitdiff
path: root/update.diff
diff options
context:
space:
mode:
Diffstat (limited to 'update.diff')
-rw-r--r--update.diff147
1 files changed, 147 insertions, 0 deletions
diff --git a/update.diff b/update.diff
new file mode 100644
index 0000000..d38a529
--- /dev/null
+++ b/update.diff
@@ -0,0 +1,147 @@
+diff --git a/README.md b/README.md
+index 887bf29..6b12ab0 100644
+--- a/README.md
++++ b/README.md
+@@ -1,6 +1,6 @@
+ # dwl - dwm for Wayland
+
+-Join us on our [Discord server](https://discord.gg/jJxZnrGPWN)!
++Join us on our [Discord server](https://discord.gg/jJxZnrGPWN) and at [#dwl](https://web.libera.chat/?channels=#dwl) on irc.libera.chat.
+
+ dwl is a compact, hackable compositor for Wayland based on [wlroots](https://gitlab.freedesktop.org/wlroots/wlroots/). It is intended to fill the same space in the Wayland world that dwm does in X11, primarily in terms of philosophy, and secondarily in terms of functionality. Like dwm, dwl is:
+
+@@ -85,10 +85,6 @@ Existing dwl-specific status bars and dwl-specific scripts for other status bars
+
+ You can find a [list of Wayland applications on the sway wiki](https://github.com/swaywm/sway/wiki/i3-Migration-Guide).
+
+-## IRC channel
+-
+-dwl's IRC channel is #dwl on irc.libera.chat.
+-
+ ## Acknowledgements
+
+ dwl began by extending the TinyWL example provided (CC0) by the sway/wlroots developers. This was made possible in many cases by looking at how sway accomplished something, then trying to do the same in as suckless a way as possible.
+diff --git a/config.h b/config.h
+index bc08e2e..7745e7d 100644
+--- a/config.h
++++ b/config.h
+@@ -49,8 +49,7 @@ static const MonitorRule monrules[] = {
+ { "eDP-1", 0.5, 1, 2, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
+ */
+ /* defaults */
+- { "HDMI-A-1", 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
+- { "HDMI-A-2", 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
++ { NULL, 0.55, 1, 1, &layouts[0], WL_OUTPUT_TRANSFORM_NORMAL },
+ };
+
+ /* keyboard */
+diff --git a/dwl.c b/dwl.c
+index 227e1c4..2533ef7 100644
+--- a/dwl.c
++++ b/dwl.c
+@@ -315,7 +315,7 @@ static void swallow(Client *c, Client *w);
+ /* variables */
+ static const char broken[] = "broken";
+ static pid_t child_pid = -1;
+-static struct wlr_surface *exclusive_focus;
++static void *exclusive_focus;
+ static struct wl_display *dpy;
+ static struct wlr_backend *backend;
+ static struct wlr_scene *scene;
+@@ -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 (exclusive != (state->exclusive_zone > 0))
++ if (wlr_layer_surface->mapped && exclusive != (state->exclusive_zone > 0))
+ continue;
+
+ bounds = state->exclusive_zone == -1 ? full_area : *usable_area;
+@@ -643,6 +643,8 @@ 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--)
+@@ -665,8 +667,8 @@ arrangelayers(Monitor *m)
+ layersurface->layer_surface->mapped) {
+ /* Deactivate the focused client. */
+ focusclient(NULL, 0);
+- exclusive_focus = layersurface->layer_surface->surface;
+- client_notify_enter(exclusive_focus, wlr_seat_get_keyboard(seat));
++ exclusive_focus = layersurface;
++ client_notify_enter(layersurface->layer_surface->surface, wlr_seat_get_keyboard(seat));
+ return;
+ }
+ }
+@@ -801,6 +803,7 @@ 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);
+
+@@ -835,8 +838,9 @@ 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 (!layersurface->mon)
++ if (!wlr_output || !(layersurface->mon = wlr_output->data))
+ return;
+
+ if (layers[wlr_layer_surface->current.layer] != layersurface->scene) {
+@@ -1127,8 +1131,6 @@ 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);
+ }
+
+@@ -1551,9 +1553,6 @@ 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);
+@@ -2029,6 +2028,8 @@ void
+ setfullscreen(Client *c, int fullscreen)
+ {
+ c->isfullscreen = fullscreen;
++ if (!c->mon)
++ return;
+ c->bw = fullscreen ? 0 : borderpx;
+ client_set_fullscreen(c, fullscreen);
+
+@@ -2114,7 +2115,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 */
+- arrange(m);
++ setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
+ }
+ focusclient(focustop(selmon), 1);
+ }
+@@ -2512,7 +2513,10 @@ unmaplayersurfacenotify(struct wl_listener *listener, void *data)
+
+ layersurface->layer_surface->mapped = (layersurface->mapped = 0);
+ wlr_scene_node_set_enabled(layersurface->scene, 0);
+- if (layersurface->layer_surface->surface == exclusive_focus)
++ if (layersurface->layer_surface->output
++ && (layersurface->mon = layersurface->layer_surface->output->data))
++ arrangelayers(layersurface->mon);
++ if (layersurface == exclusive_focus)
+ exclusive_focus = NULL;
+ if (layersurface->layer_surface->surface ==
+ seat->keyboard_state.focused_surface)