forked from akanyan/STARTLINER
fix: don't switch primary, for real
This commit is contained in:
@ -6,14 +6,14 @@ use tauri::{AppHandle, Listener};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct DisplayInfo {
|
||||
pub primary: String,
|
||||
pub primary: Option<String>,
|
||||
pub set: Option<DisplaySet>,
|
||||
}
|
||||
|
||||
impl Default for DisplayInfo {
|
||||
fn default() -> Self {
|
||||
DisplayInfo {
|
||||
primary: "default".to_owned(),
|
||||
primary: None,
|
||||
set: query_displays().ok(),
|
||||
}
|
||||
}
|
||||
@ -60,7 +60,7 @@ impl Display {
|
||||
.ok_or_else(|| anyhow!("Unable to query display settings"))?;
|
||||
|
||||
let res = DisplayInfo {
|
||||
primary: primary.name().to_owned(),
|
||||
primary: if self.dont_switch_primary { None } else { Some(primary.name().to_owned()) },
|
||||
set: Some(display_set.clone()),
|
||||
};
|
||||
|
||||
@ -132,12 +132,14 @@ impl Display {
|
||||
let display_set = info.set.as_ref()
|
||||
.ok_or_else(|| anyhow!("Unable to clean up displays: no display set"))?;
|
||||
|
||||
let primary = display_set
|
||||
.displays()
|
||||
.find(|display| display.name() == info.primary)
|
||||
.ok_or_else(|| anyhow!("Display {} not found", info.primary))?;
|
||||
if let Some(info_primary) = &info.primary {
|
||||
let primary = display_set
|
||||
.displays()
|
||||
.find(|display| display.name() == info_primary)
|
||||
.ok_or_else(|| anyhow!("Display {} not found", info_primary))?;
|
||||
|
||||
primary.set_primary()?;
|
||||
primary.set_primary()?;
|
||||
}
|
||||
|
||||
display_set.apply()?;
|
||||
displayz::refresh()?;
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "STARTLINER",
|
||||
"version": "0.10.0",
|
||||
"version": "0.10.1",
|
||||
"identifier": "zip.patafour.startliner",
|
||||
"build": {
|
||||
"beforeDevCommand": "bun run dev",
|
||||
|
Reference in New Issue
Block a user