Skip to content

Commit cc258bf

Browse files
committed
Fix multi monitor support
1 parent 923f6a2 commit cc258bf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/vonal_daemon/app.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -147,20 +147,20 @@ impl App {
147147
let monitor_width = monitor.size().width;
148148
let width = self.config.window_width.get_points(monitor_width as f64) as u32;
149149
let height = self.config.window_height.get_points(monitor_height as f64) as u32;
150-
151150
let old_position = gl_window.window().outer_position().unwrap_or_default();
152151
let new_position = PhysicalPosition::new(
153152
if self.config.center_window_horizontally {
154-
monitor_width / 2 - width / 2
153+
monitor.position().x as u32 + monitor_width / 2 - width / 2
155154
} else {
156-
0
155+
monitor.position().x as u32
157156
} as i32,
158157
if self.config.center_window_vertically {
159-
monitor_height / 2 - height / 2
158+
monitor.position().y as u32 + monitor_height / 2 - height / 2
160159
} else {
161-
0
160+
monitor.position().y as u32
162161
} as i32,
163162
);
163+
164164
if old_position != new_position {
165165
gl_window.window().set_outer_position(new_position);
166166
}

0 commit comments

Comments
 (0)