From 13925eb1da8af2c1d23ee9d01efd03c3626081b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
 <leohdz172@proton.me>
Date: Sun, 23 Jun 2024 14:42:50 -0600
Subject: correctly report position to xwayland clients

Previously we didn't take into account their borders requiring us to add
`borderpx` to override_redirect clients.

Fixes: https://codeberg.org/dwl/dwl/issues/651
---
 dwl.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'dwl.c')

diff --git a/dwl.c b/dwl.c
index d48bf40..00e9cc1 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1651,8 +1651,7 @@ mapnotify(struct wl_listener *listener, void *data)
 	if (client_is_unmanaged(c)) {
 		/* Unmanaged clients always are floating */
 		wlr_scene_node_reparent(&c->scene->node, layers[LyrFloat]);
-		wlr_scene_node_set_position(&c->scene->node, c->geom.x + borderpx,
-				c->geom.y + borderpx);
+		wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y);
 		if (client_wants_focus(c)) {
 			focusclient(c, 1);
 			exclusive_focus = c;
@@ -3038,7 +3037,7 @@ createnotifyx11(struct wl_listener *listener, void *data)
 	c = xsurface->data = ecalloc(1, sizeof(*c));
 	c->surface.xwayland = xsurface;
 	c->type = X11;
-	c->bw = borderpx;
+	c->bw = client_is_unmanaged(c) ? 0 : borderpx;
 
 	/* Listen to the various events it can emit */
 	LISTEN(&xsurface->events.associate, &c->associate, associatex11);
-- 
cgit v1.2.3


From 46ae075430017ccd4a58d63a166fe1e696d3f379 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Leonardo=20Hern=C3=A1ndez=20Hern=C3=A1ndez?=
 <leohdz172@proton.me>
Date: Wed, 5 Jun 2024 00:42:43 -0600
Subject: set preferred scale on creation (LayerShell)

---
 dwl.c | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'dwl.c')

diff --git a/dwl.c b/dwl.c
index 00e9cc1..521b07a 100644
--- a/dwl.c
+++ b/dwl.c
@@ -71,6 +71,7 @@
 #define MAX(A, B)               ((A) > (B) ? (A) : (B))
 #define MIN(A, B)               ((A) < (B) ? (A) : (B))
 #define ROUND(X)                ((int)((X < 0) ? (X - 0.5) : (X + 0.5)))
+#define CEIL(X)                 ((int)((X < 0) ? (X) : ((int)X == X) ? (X) : ((int)X + 1)))
 #define CLEANMASK(mask)         (mask & ~WLR_MODIFIER_CAPS)
 #define VISIBLEON(C, M)         ((M) && (C)->mon == (M) && ((C)->tags & (M)->tagset[(M)->seltags]))
 #define LENGTH(X)               (sizeof X / sizeof X[0])
@@ -884,6 +885,8 @@ createlayersurface(struct wl_listener *listener, void *data)
 
 	wl_list_insert(&l->mon->layers[layer_surface->pending.layer],&l->link);
 	wlr_surface_send_enter(surface, layer_surface->output);
+	wlr_fractional_scale_v1_notify_scale(surface, l->mon->wlr_output->scale);
+	wlr_surface_set_preferred_buffer_scale(surface, CEIL(l->mon->wlr_output->scale));
 
 	/* Temporarily set the layer's current state to pending
 	 * so that we can easily arrange it
-- 
cgit v1.2.3