From 06d9230a9611ab70041c7dbb1bf3d9e9ea497271 Mon Sep 17 00:00:00 2001 From: Ben Jargowsky Date: Wed, 11 May 2022 14:30:10 +0200 Subject: [PATCH 1/5] Run focusclient when switching to monocle layout --- dwl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dwl.c b/dwl.c index 8088d9f..55e9f35 100644 --- a/dwl.c +++ b/dwl.c @@ -1405,6 +1405,7 @@ monocle(Monitor *m) continue; resize(c, m->w.x, m->w.y, m->w.width, m->w.height, 0); } + focusclient(focustop(m), 1); } void From 3c11ad9aa6d3d8d69c926d5c767aedfdf1cd03b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Sat, 14 May 2022 00:24:06 -0500 Subject: [PATCH 2/5] fix segfault when dragging chromium tabs --- client.h | 15 +++++++++------ dwl.c | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/client.h b/client.h index 2ea0d22..a7b546a 100644 --- a/client.h +++ b/client.h @@ -30,16 +30,19 @@ client_surface(Client *c) static inline void client_activate_surface(struct wlr_surface *s, int activated) { + struct wlr_xdg_surface *surface; #ifdef XWAYLAND - if (wlr_surface_is_xwayland_surface(s)) { - wlr_xwayland_surface_activate( - wlr_xwayland_surface_from_wlr_surface(s), activated); + struct wlr_xwayland_surface *xsurface; + if (wlr_surface_is_xwayland_surface(s) + && (xsurface = wlr_xwayland_surface_from_wlr_surface(s))) { + wlr_xwayland_surface_activate(xsurface, activated); return; } #endif - if (wlr_surface_is_xdg_surface(s)) - wlr_xdg_toplevel_set_activated( - wlr_xdg_surface_from_wlr_surface(s), activated); + if (wlr_surface_is_xdg_surface(s) + && (surface = wlr_xdg_surface_from_wlr_surface(s)) + && surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL) + wlr_xdg_toplevel_set_activated(surface, activated); } static inline void diff --git a/dwl.c b/dwl.c index 55e9f35..abff38a 100644 --- a/dwl.c +++ b/dwl.c @@ -1121,7 +1121,7 @@ focusclient(Client *c, int lift) } else { Client *w; struct wlr_scene_node *node = old->data; - if ((w = node->data)) + if (old->role_data && (w = node->data)) for (i = 0; i < 4; i++) wlr_scene_rect_set_color(w->border[i], bordercolor); From 2f8736b986786f526efbd2bb6863ed39bba4d3e0 Mon Sep 17 00:00:00 2001 From: Ben Jargowsky Date: Sun, 15 May 2022 13:18:40 +0200 Subject: [PATCH 3/5] Check if XWayland client size_hints are NULL --- client.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client.h b/client.h index a7b546a..e0964da 100644 --- a/client.h +++ b/client.h @@ -215,8 +215,13 @@ client_min_size(Client *c, int *width, int *height) if (client_is_x11(c)) { struct wlr_xwayland_surface_size_hints *size_hints; size_hints = c->surface.xwayland->size_hints; - *width = size_hints->min_width; - *height = size_hints->min_height; + if (size_hints) { + *width = size_hints->min_width; + *height = size_hints->min_height; + } else { + *width = 0; + *height = 0; + } return; } #endif From 5de68ba71362553e31a36f6a5a594e0ee830e611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Tue, 17 May 2022 13:23:29 -0500 Subject: [PATCH 4/5] sync manpage and help info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Leonardo Hernández Hernández --- dwl.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dwl.1 b/dwl.1 index f50602c..d958210 100644 --- a/dwl.1 +++ b/dwl.1 @@ -7,7 +7,7 @@ .Sh SYNOPSIS .Nm .Op Fl v -.Op Fl s Ar command +.Op Fl s Ar startup command .Sh DESCRIPTION .Nm is a Wayland compositor based on wlroots. From 8870ba0bb8106a4a367bd8dee78178891b8c19db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?= Date: Tue, 17 May 2022 14:38:18 -0500 Subject: [PATCH 5/5] implement urgency hints for xwayland clients --- dwl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dwl.c b/dwl.c index abff38a..90a2789 100644 --- a/dwl.c +++ b/dwl.c @@ -112,6 +112,7 @@ typedef struct { #ifdef XWAYLAND struct wl_listener activate; struct wl_listener configure; + struct wl_listener set_hints; #endif int bw; unsigned int tags; @@ -358,6 +359,7 @@ static void activatex11(struct wl_listener *listener, void *data); static void configurex11(struct wl_listener *listener, void *data); static void createnotifyx11(struct wl_listener *listener, void *data); static Atom getatom(xcb_connection_t *xc, const char *name); +static void sethints(struct wl_listener *listener, void *data); static void xwaylandready(struct wl_listener *listener, void *data); static struct wl_listener new_xwayland_surface = {.notify = createnotifyx11}; static struct wl_listener xwayland_ready = {.notify = xwaylandready}; @@ -1046,6 +1048,7 @@ destroynotify(struct wl_listener *listener, void *data) #ifdef XWAYLAND if (c->type != XDGShell) { wl_list_remove(&c->configure.link); + wl_list_remove(&c->set_hints.link); wl_list_remove(&c->activate.link); } else #endif @@ -2460,6 +2463,7 @@ createnotifyx11(struct wl_listener *listener, void *data) LISTEN(&xwayland_surface->events.request_activate, &c->activate, activatex11); LISTEN(&xwayland_surface->events.request_configure, &c->configure, configurex11); + LISTEN(&xwayland_surface->events.set_hints, &c->set_hints, sethints); LISTEN(&xwayland_surface->events.set_title, &c->set_title, updatetitle); LISTEN(&xwayland_surface->events.destroy, &c->destroy, destroynotify); LISTEN(&xwayland_surface->events.request_fullscreen, &c->fullscreen, @@ -2479,6 +2483,16 @@ getatom(xcb_connection_t *xc, const char *name) return atom; } +void +sethints(struct wl_listener *listener, void *data) +{ + Client *c = wl_container_of(listener, c, set_hints); + if (c != selclient()) { + c->isurgent = c->surface.xwayland->hints_urgency; + printstatus(); + } +} + void xwaylandready(struct wl_listener *listener, void *data) {