From 7249f5c9c3f32462a675fc6888bc4dd5f1e83845 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Tue, 29 Dec 2020 19:18:00 +0100 Subject: [PATCH] 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), );