Skip to content

Commit

Permalink
XdgPopup: fix unconstrainFromBox coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
ifreund committed Jan 7, 2021
1 parent a672738 commit e7442e5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions river/XdgPopup.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e7442e5

Please sign in to comment.