git.lucas.co / cce-compositor
Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git

commit6ec6de08a9b51a4d5619f5be5e4569d01c6b2dbe
parent21f04640d9
authorIsaac Freund <[email protected]>
date2020-12-29 19:18
xwayland: use layout coords for configures

 river/XwaylandView.zig | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/river/XwaylandView.zig b/river/XwaylandView.zig
index dea66e2..76af934 100644
--- a/river/XwaylandView.zig
+++ b/river/XwaylandView.zig
@@ -63,8 +63,10 @@ pub fn deinit(self: *Self) void {
 }
 
 pub fn needsConfigure(self: Self) bool {
-    return self.xwayland_surface.x != self.view.pending.box.x or
-        self.xwayland_surface.y != self.view.pending.box.y or
+    const output = self.view.output;
+    const output_box = output.root.output_layout.getBox(output.wlr_output).?;
+    return self.xwayland_surface.x != self.view.pending.box.x + output_box.x or
+        self.xwayland_surface.y != self.view.pending.box.y + output_box.y or
         self.xwayland_surface.width != self.view.pending.box.width or
         self.xwayland_surface.height != self.view.pending.box.height;
 }
@@ -72,11 +74,14 @@ pub fn needsConfigure(self: Self) bool {
 /// Apply pending state. Note: we don't set View.serial as
 /// shouldTrackConfigure() is always false for xwayland views.
 pub fn configure(self: Self) void {
+    const output = self.view.output;
+    const output_box = output.root.output_layout.getBox(output.wlr_output).?;
+
     const state = &self.view.pending;
     self.xwayland_surface.setFullscreen(state.fullscreen);
     self.xwayland_surface.configure(
-        @intCast(i16, state.box.x),
-        @intCast(i16, state.box.y),
+        @intCast(i16, state.box.x + output_box.x),
+        @intCast(i16, state.box.y + output_box.y),
         @intCast(u16, state.box.width),
         @intCast(u16, state.box.height),
     );