Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion plugins/positioner/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,13 @@ fn calculate_position<R: Runtime>(
) -> Result<PhysicalPosition<i32>> {
use Position::*;

let screen = window.current_monitor()?.unwrap();
let screen = window.current_monitor()?;
let screen = if let Some(screen) = screen {
screen
} else {
// falling back to primary fixes a crash on macOS when using multiple monitors but current_monitor() is None
window.primary_monitor()?.unwrap()
};
// Only use the screen_position for the Tray independent positioning,
// because a tray event may not be called on the currently active monitor.
let screen_position = screen.position();
Expand Down