From 0ee5512fa85c1942a50e6b028bf7bf3c9e4d4e16 Mon Sep 17 00:00:00 2001 From: Leonardo Hernandez Hernandez Date: Mon, 31 Jan 2022 14:02:59 -0600 Subject: [PATCH] add support for xwayland popups they were already displaying but in a bad position and crashing, for example, when selecting an option in a menu in chromium or trying to move or resize popups --- dwl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dwl.c b/dwl.c index fcf81d9..f6b390f 100644 --- a/dwl.c +++ b/dwl.c @@ -1084,7 +1084,7 @@ focusclient(Client *c, int lift) return; /* Put the new client atop the focus stack and select its monitor */ - if (c) { + if (c && c->type != X11Unmanaged) { wl_list_remove(&c->flink); wl_list_insert(&fstack, &c->flink); selmon = c->mon; @@ -1108,7 +1108,8 @@ focusclient(Client *c, int lift) )) return; } else { - client_activate_surface(old, 0); + /* If client is unmanaged then we shoudn't deactivate old surface */ + client_activate_surface(old, c && c->type == X11Unmanaged); } } @@ -1317,8 +1318,10 @@ mapnotify(struct wl_listener *listener, void *data) } if (client_is_unmanaged(c)) { + client_get_geometry(c, &c->geom); /* Floating, no border */ wlr_scene_node_reparent(c->scene, layers[LyrFloat]); + wlr_scene_node_set_position(c->scene, c->geom.x, c->geom.y); c->bw = 0; /* Insert this independent into independents lists. */ @@ -1431,7 +1434,7 @@ moveresize(const Arg *arg) if (cursor_mode != CurNormal) return; xytonode(cursor->x, cursor->y, NULL, &grabc, NULL, NULL, NULL); - if (!grabc) + if (!grabc || grabc->type == X11Unmanaged) return; /* Float the window and tell motionnotify to grab it */