[PATCH] xwayland: Fix input coordinates of shadowless CSD windows

Scott Moreau oreaus at gmail.com
Tue May 2 16:24:17 UTC 2017


This fixes wrong input coordinates when using clients like steam,
that draw their own decorations and have no shadows.
---
 xwayland/window-manager.c | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index 2608075..7cb60d1 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -610,15 +610,17 @@ weston_wm_window_get_frame_size(struct weston_wm_window *window,
 {
 	struct theme *t = window->wm->theme;
 
-	if (window->fullscreen) {
+	if (window->decorate) {
+		if (window->frame) {
+			*width = frame_width(window->frame);
+			*height = frame_height(window->frame);
+		} else {
+			*width = window->width + t->margin * 2;
+			*height = window->height + t->margin * 2;
+		}
+	} else {
 		*width = window->width;
 		*height = window->height;
-	} else if (window->decorate && window->frame) {
-		*width = frame_width(window->frame);
-		*height = frame_height(window->frame);
-	} else {
-		*width = window->width + t->margin * 2;
-		*height = window->height + t->margin * 2;
 	}
 }
 
@@ -628,14 +630,16 @@ weston_wm_window_get_child_position(struct weston_wm_window *window,
 {
 	struct theme *t = window->wm->theme;
 
-	if (window->fullscreen) {
+	if (window->decorate) {
+		if (window->frame)
+			frame_interior(window->frame, x, y, NULL, NULL);
+		else {
+			*x = t->margin;
+			*y = t->margin;
+		}
+	} else {
 		*x = 0;
 		*y = 0;
-	} else if (window->decorate && window->frame) {
-		frame_interior(window->frame, x, y, NULL, NULL);
-	} else {
-		*x = t->margin;
-		*y = t->margin;
 	}
 }
 
-- 
2.7.4



More information about the wayland-devel mailing list