aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2023-06-01 19:50:43 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2023-06-01 19:50:43 +0200
commit4954ac6e9d0eb1e0adfd4853ee4048bf18e540a4 (patch)
tree036d0b6c40ec25ebdcdeb841c4f4e979b4d5f96f
parentff143426376be946fc69bf436d9cb718f1882068 (diff)
parenta5e45924edeaeb9b763cdc75fd4ec413b2ec2ab5 (diff)
Merge branch 'main' of https://github.com/djpohly/dwl
-rw-r--r--.github/ISSUE_TEMPLATE/bug_report.md5
-rw-r--r--dwl.c28
2 files changed, 18 insertions, 15 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 6b60803..cd9bd8d 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -14,9 +14,4 @@ wlroots version:
<!--
Only report bugs that can be reproduced on the main line
Report patch issues to their respective authors
-If the patch author doesn't respond within a reasonable time, email me:
-
-Leonardo Hernández Hernández <leohdz172@protonmail.com>
-
-but note that I'm NOT making any promises
-->
diff --git a/dwl.c b/dwl.c
index 443dbd6..cbc803b 100644
--- a/dwl.c
+++ b/dwl.c
@@ -937,8 +937,10 @@ createlayersurface(struct wl_listener *listener, void *data)
if (!wlr_layer_surface->output)
wlr_layer_surface->output = selmon ? selmon->wlr_output : NULL;
- if (!wlr_layer_surface->output)
+ if (!wlr_layer_surface->output) {
wlr_layer_surface_v1_destroy(wlr_layer_surface);
+ return;
+ }
layersurface = ecalloc(1, sizeof(LayerSurface));
layersurface->type = LayerShell;
@@ -1607,7 +1609,9 @@ void
focusclient(Client *c, int lift)
{
struct wlr_surface *old = seat->keyboard_state.focused_surface;
- int i, unused_lx, unused_ly;
+ int i, unused_lx, unused_ly, old_client_type;
+ Client *old_c = NULL;
+ LayerSurface *old_l = NULL;
if (locked)
return;
@@ -1619,6 +1623,12 @@ focusclient(Client *c, int lift)
if (c && client_surface(c) == old)
return;
+ if ((old_client_type = toplevel_from_wlr_surface(old, &old_c, &old_l)) == XDGShell) {
+ struct wlr_xdg_popup *popup, *tmp;
+ wl_list_for_each_safe(popup, tmp, &old_c->surface.xdg->popups, link)
+ wlr_xdg_popup_destroy(popup);
+ }
+
/* Put the new client atop the focus stack and select its monitor */
if (c && !client_is_unmanaged(c)) {
wl_list_remove(&c->flink);
@@ -1639,19 +1649,17 @@ focusclient(Client *c, int lift)
/* If an overlay is focused, don't focus or activate the client,
* but only update its position in fstack to render its border with focuscolor
* and focus it after the overlay is closed. */
- Client *w = NULL;
- LayerSurface *l = NULL;
- int type = toplevel_from_wlr_surface(old, &w, &l);
- if (type == LayerShell && wlr_scene_node_coords(&l->scene->node, &unused_lx, &unused_ly)
- && l->layer_surface->current.layer >= ZWLR_LAYER_SHELL_V1_LAYER_TOP) {
+ if (old_client_type == LayerShell && wlr_scene_node_coords(
+ &old_l->scene->node, &unused_lx, &unused_ly)
+ && old_l->layer_surface->current.layer >= ZWLR_LAYER_SHELL_V1_LAYER_TOP) {
return;
- } else if (w && w == exclusive_focus && client_wants_focus(w)) {
+ } else if (old_c && old_c == exclusive_focus && client_wants_focus(old_c)) {
return;
/* Don't deactivate old client if the new one wants focus, as this causes issues with winecfg
* and probably other clients */
- } else if (w && !client_is_unmanaged(w) && (!c || !client_wants_focus(c))) {
+ } else if (old_c && !client_is_unmanaged(old_c) && (!c || !client_wants_focus(c))) {
for (i = 0; i < 4; i++)
- wlr_scene_rect_set_color(w->border[i], bordercolor);
+ wlr_scene_rect_set_color(old_c->border[i], bordercolor);
client_activate_surface(old, 0);
}