mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
fix: rogcc not starting in rog ally
This commit is contained in:
@@ -14,6 +14,7 @@ mocking = []
|
|||||||
x11 = ["slint/backend-winit-x11"]
|
x11 = ["slint/backend-winit-x11"]
|
||||||
# Optional tokio debug feature does not require nightly; remove RUSTFLAGS note.
|
# Optional tokio debug feature does not require nightly; remove RUSTFLAGS note.
|
||||||
tokio-debug = ["console-subscriber"]
|
tokio-debug = ["console-subscriber"]
|
||||||
|
rog_ally = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
console-subscriber = { version = "^0.4", optional = true }
|
console-subscriber = { version = "^0.4", optional = true }
|
||||||
|
|||||||
@@ -107,7 +107,6 @@ async fn main() -> Result<()> {
|
|||||||
let board_name = dmi.board_name;
|
let board_name = dmi.board_name;
|
||||||
let prod_family = dmi.product_family;
|
let prod_family = dmi.product_family;
|
||||||
info!("Running on {board_name}, product: {prod_family}");
|
info!("Running on {board_name}, product: {prod_family}");
|
||||||
let is_rog_ally = board_name == "RC71L" || board_name == "RC72L" || prod_family == "ROG Ally";
|
|
||||||
|
|
||||||
let args: Vec<String> = args().skip(1).collect();
|
let args: Vec<String> = args().skip(1).collect();
|
||||||
|
|
||||||
@@ -138,6 +137,18 @@ async fn main() -> Result<()> {
|
|||||||
config.start_fullscreen = false;
|
config.start_fullscreen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let is_rog_ally = {
|
||||||
|
#[cfg(feature = "rog_ally")]
|
||||||
|
{
|
||||||
|
board_name == "RC71L" || board_name == "RC72L" || prod_family == "ROG Ally"
|
||||||
|
}
|
||||||
|
#[cfg(not(feature = "rog_ally"))]
|
||||||
|
{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#[cfg(feature = "rog_ally")]
|
||||||
if is_rog_ally {
|
if is_rog_ally {
|
||||||
config.notifications.enabled = false;
|
config.notifications.enabled = false;
|
||||||
config.enable_tray_icon = false;
|
config.enable_tray_icon = false;
|
||||||
@@ -145,6 +156,7 @@ async fn main() -> Result<()> {
|
|||||||
config.startup_in_background = false;
|
config.startup_in_background = false;
|
||||||
config.start_fullscreen = true;
|
config.start_fullscreen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
config.write();
|
config.write();
|
||||||
|
|
||||||
let enable_tray_icon = config.enable_tray_icon;
|
let enable_tray_icon = config.enable_tray_icon;
|
||||||
@@ -203,7 +215,10 @@ async fn main() -> Result<()> {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.ok();
|
.ok();
|
||||||
} else {
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// save as a var, don't hold the lock the entire time or deadlocks happen
|
// save as a var, don't hold the lock the entire time or deadlocks happen
|
||||||
if let Ok(app_state) = app_state.lock() {
|
if let Ok(app_state) = app_state.lock() {
|
||||||
state = *app_state;
|
state = *app_state;
|
||||||
@@ -248,9 +263,8 @@ async fn main() -> Result<()> {
|
|||||||
let config = config_copy_2.clone();
|
let config = config_copy_2.clone();
|
||||||
ui_copy
|
ui_copy
|
||||||
.upgrade_in_event_loop(move |w| {
|
.upgrade_in_event_loop(move |w| {
|
||||||
let fullscreen = config
|
let fullscreen =
|
||||||
.lock()
|
config.lock().is_ok_and(|c| c.start_fullscreen);
|
||||||
.is_ok_and(|c| c.start_fullscreen);
|
|
||||||
if fullscreen && !w.window().is_fullscreen() {
|
if fullscreen && !w.window().is_fullscreen() {
|
||||||
w.window().set_fullscreen(fullscreen);
|
w.window().set_fullscreen(fullscreen);
|
||||||
}
|
}
|
||||||
@@ -276,7 +290,6 @@ async fn main() -> Result<()> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
slint::run_event_loop_until_quit().unwrap();
|
slint::run_event_loop_until_quit().unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user