From e7442e53c1bb31b10bcb94a499431a2819e16769 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Thu, 7 Jan 2021 21:22:11 +0100 Subject: [PATCH] XdgPopup: fix unconstrainFromBox coordinates --- river/XdgPopup.zig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/river/XdgPopup.zig b/river/XdgPopup.zig index fa7eba1..3b0b0fc 100644 --- a/river/XdgPopup.zig +++ b/river/XdgPopup.zig @@ -47,9 +47,13 @@ pub fn init(self: *Self, output: *Output, parent_box: *const Box, wlr_xdg_popup: }; // The output box relative to the parent of the popup - var box = output.root.output_layout.getBox(output.wlr_output).?.*; - box.x -= parent_box.x; - box.y -= parent_box.y; + const output_dimensions = output.getEffectiveResolution(); + var box = wlr.Box{ + .x = -parent_box.x, + .y = -parent_box.y, + .width = @intCast(c_int, output_dimensions.width), + .height = @intCast(c_int, output_dimensions.height), + }; wlr_xdg_popup.unconstrainFromBox(&box); wlr_xdg_popup.base.events.destroy.add(&self.destroy);