XdgPopup: fix unconstrainFromBox coordinates

This commit is contained in:
Isaac Freund 2021-01-07 21:22:11 +01:00
parent a672738603
commit e7442e53c1
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11

View file

@ -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 // The output box relative to the parent of the popup
var box = output.root.output_layout.getBox(output.wlr_output).?.*; const output_dimensions = output.getEffectiveResolution();
box.x -= parent_box.x; var box = wlr.Box{
box.y -= parent_box.y; .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.unconstrainFromBox(&box);
wlr_xdg_popup.base.events.destroy.add(&self.destroy); wlr_xdg_popup.base.events.destroy.add(&self.destroy);