From 6114dd6a838c1c4ebeb5c8f2a66f7c1e628d11d5 Mon Sep 17 00:00:00 2001
From: John Lindgren <john@jlindgren.net>
Date: Wed, 11 Oct 2023 03:37:46 -0400
Subject: xwayland: stop translating _NET_WM_STRUT_PARTIAL coordinates

Translating the right/bottom coordinates from offsets to absolute
coordinates in wlroots (rather than in the compositor) was supposed to
be more reliable, since wlroots had access to the X11 screen size.

It ended up being less reliable, because the screen size values
(xwm->screen->width_in_pixels/height_in_pixels) are not updated when the
output layout changes.

So let's remove the translation from wlroots, and let the compositor
figure it out. From what I can understand of the current XWayland code,
the X11 screen size should generally match the overall wlr_output_layout
bounding box, which the compositor has access to.
---
 xwayland/xwm.c | 14 --------------
 1 file changed, 14 deletions(-)

(limited to 'xwayland')

diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index 6597af9a..92d68c7b 100644
--- a/xwayland/xwm.c
+++ b/xwayland/xwm.c
@@ -775,20 +775,6 @@ static void read_surface_strut_partial(struct wlr_xwm *xwm,
 		return;
 	}
 	xcb_ewmh_get_wm_strut_partial_from_reply(xsurface->strut_partial, reply);
-
-	/*
-	 * Translate right/bottom into root x/y coordinates here since
-	 * the compositor is ignorant of X11 screen width/height.
-	 *
-	 * (This could result in an incorrect position if the X11 screen
-	 * size changes but _NET_WM_STRUT_PARTIAL doesn't. It's probably
-	 * not worth the additional code to fix this corner case.)
-	 */
-	xsurface->strut_partial->right =
-		xwm->screen->width_in_pixels - xsurface->strut_partial->right;
-	xsurface->strut_partial->bottom =
-		xwm->screen->height_in_pixels - xsurface->strut_partial->bottom;
-
 	wl_signal_emit_mutable(&xsurface->events.set_strut_partial, NULL);
 }
 
-- 
cgit v1.2.3