summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2022-09-04 19:13:45 -0500
committerzachir <zachir@librem.one>2022-09-04 19:13:45 -0500
commitd24d9e013ba7b999033792c7e0ec46b23a505fc4 (patch)
tree51b08f1c112beb8781156ebb0363cb621ed66b44
parent3946a44baffcf7b23951f46d25c2f5b7ec54c5a7 (diff)
parente91f71e8d6b6b29da69ec0cd8ad8f7dec2878df3 (diff)
Merge branch 'main' of https://github.com/djpohly/dwl into testing
-rw-r--r--README.md6
-rw-r--r--dwl.c28
2 files changed, 17 insertions, 17 deletions
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/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)