1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-03 19:51:03 +02:00

fix(popup): often opening in wrong place

Fixes #16.
This commit is contained in:
Jake Stanger 2022-10-14 23:48:28 +01:00
parent 9e31107251
commit 5523e9af46
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
3 changed files with 29 additions and 7 deletions

View file

@ -111,7 +111,7 @@ impl Popup {
/// Sets the popover's X position relative to the left border of the screen
fn set_pos(&self, button_x: i32, button_width: i32) {
let screen_width = self.monitor.workarea().width();
let popup_width = self.window.allocated_width();
let (popup_width, _popup_height) = self.window.size();
let widget_center = f64::from(button_x) + f64::from(button_width) / 2.0;