aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernandez Hernandez <leohdz172@protonmail.com>2022-01-31 14:02:59 -0600
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-03-16 09:27:09 -0600
commit863eedd05e8d292ccef2530d9b4b8b5475b8cbef (patch)
tree7efa883314318e6bd355630bf67bbe41eba212a9
parentb92c0ff57fbf9cc9ffb2a33e689acc08b8745f1d (diff)
set correct position for unmanaged clients
- don't allow to move/resize with them - don't focus unmanaged clients on buttonpress()
-rw-r--r--dwl.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/dwl.c b/dwl.c
index 0d8a1b1..7f8d3f4 100644
--- a/dwl.c
+++ b/dwl.c
@@ -645,7 +645,8 @@ buttonpress(struct wl_listener *listener, void *data)
case WLR_BUTTON_PRESSED:;
/* Change focus if the button was _pressed_ over a client */
xytonode(cursor->x, cursor->y, NULL, &c, NULL, NULL, NULL);
- if (c)
+ /* Don't focus unmanaged clients */
+ if (c && !client_is_unmanaged(c))
focusclient(c, 1);
keyboard = wlr_seat_get_keyboard(seat);
@@ -1328,9 +1329,12 @@ 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]);
c->bw = 0;
+ wlr_scene_node_set_position(c->scene, c->geom.x + borderpx,
+ c->geom.y + borderpx);
/* Insert this independent into independents lists. */
wl_list_insert(&independents, &c->link);
@@ -1442,7 +1446,7 @@ moveresize(const Arg *arg)
if (cursor_mode != CurNormal)
return;
xytonode(cursor->x, cursor->y, NULL, &grabc, NULL, NULL, NULL);
- if (!grabc)
+ if (!grabc || client_is_unmanaged(grabc))
return;
/* Float the window and tell motionnotify to grab it */