Improve error message for missing default monitor on wayland
This commit is contained in:
parent
78ae9cb00a
commit
c0dcc43336
1 changed files with 3 additions and 1 deletions
|
@ -456,7 +456,9 @@ fn get_monitor_geometry(n: Option<i32>) -> Result<gdk::Rectangle> {
|
|||
let display = gdk::Display::default().expect("could not get default display");
|
||||
let monitor = match n {
|
||||
Some(n) => display.monitor(n).with_context(|| format!("Failed to get monitor with index {}", n))?,
|
||||
None => display.primary_monitor().context("Failed to get primary monitor from GTK")?,
|
||||
None => display
|
||||
.primary_monitor()
|
||||
.context("Failed to get primary monitor from GTK. Try explicitly specifying the monitor on your window.")?,
|
||||
};
|
||||
Ok(monitor.geometry())
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue