diff --git a/CHANGELOG.md b/CHANGELOG.md index d64baabb..01299e49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +# [3.7.1] - 2021-06-11 ### Changed - Refine graphics mode switching: + Disallow switching to compute or vfio mode unless existing mode is "Integrated" diff --git a/Cargo.lock b/Cargo.lock index 7919fe84..aa05ed72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -206,7 +206,7 @@ dependencies = [ [[package]] name = "daemon" -version = "3.7.0" +version = "3.7.1" dependencies = [ "env_logger", "log", diff --git a/asusctl/src/main.rs b/asusctl/src/main.rs index 9288499b..a247cb1e 100644 --- a/asusctl/src/main.rs +++ b/asusctl/src/main.rs @@ -10,10 +10,13 @@ use rog_anime::{AnimeDataBuffer, AnimeImage, Vec2, ANIME_DATA_LEN}; use rog_aura::{self, AuraEffect}; use rog_dbus::RogDbusClient; use rog_profiles::profiles::Profile; -use rog_types::{gfx_vendors::{GfxRequiredUserAction, GfxVendors}, supported::{ +use rog_types::{ + gfx_vendors::{GfxRequiredUserAction, GfxVendors}, + supported::{ FanCpuSupportedFunctions, LedSupportedFunctions, RogBiosSupportedFunctions, SupportedFunctions, - }}; + }, +}; use std::{env::args, path::Path}; use yansi_term::Colour::Green; use yansi_term::Colour::Red; @@ -312,20 +315,17 @@ fn do_gfx( "You must change to Integrated before you can change to {}", <&str>::from(mode) ); - }, + } GfxRequiredUserAction::Logout | GfxRequiredUserAction::Reboot => { println!( "Graphics mode changed to {}. User action required is: {}", <&str>::from(mode), <&str>::from(&res) ); - }, + } GfxRequiredUserAction::None => { - println!( - "Graphics mode changed to {}", - <&str>::from(mode) - ); - }, + println!("Graphics mode changed to {}", <&str>::from(mode)); + } } std::process::exit(0) } diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index 8ecbc5fa..200e1229 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "daemon" -version = "3.7.0" +version = "3.7.1" license = "MPL-2.0" readme = "README.md" authors = ["Luke "] diff --git a/daemon/src/ctrl_gfx/controller.rs b/daemon/src/ctrl_gfx/controller.rs index d1395df2..d4d92c3c 100644 --- a/daemon/src/ctrl_gfx/controller.rs +++ b/daemon/src/ctrl_gfx/controller.rs @@ -662,7 +662,7 @@ impl CtrlGraphics { let bus = self.bus.clone(); Self::do_mode_setup_tasks(vendor, vfio_enable, &devices, &bus)?; info!("GFX: Graphics mode changed to {}", <&str>::from(vendor)); - }, + } GfxRequiredUserAction::Integrated => { info!("GFX: mode change requires user to be in Integrated mode first"); } diff --git a/daemon/src/ctrl_leds/controller.rs b/daemon/src/ctrl_leds/controller.rs index 15445858..e37b5fea 100644 --- a/daemon/src/ctrl_leds/controller.rs +++ b/daemon/src/ctrl_leds/controller.rs @@ -17,11 +17,11 @@ use rog_aura::{ AuraEffect, LedBrightness, LED_MSG_LEN, }; use rog_types::supported::LedSupportedFunctions; -use std::{fs::OpenOptions, thread::spawn}; use std::io::{Read, Write}; use std::path::Path; use std::sync::Arc; use std::sync::Mutex; +use std::{fs::OpenOptions, thread::spawn}; use zbus::Connection; use crate::GetSupported; @@ -75,12 +75,13 @@ impl<'a> CtrlKbdLedTask<'a> { // wait a fraction for things to wake up properly //std::thread::sleep(Duration::from_millis(100)); loop { - if let Ok(ref mut lock) = c1.try_lock() { - lock.set_brightness(lock.config.brightness).ok(); - break; - }} + if let Ok(ref mut lock) = c1.try_lock() { + lock.set_brightness(lock.config.brightness).ok(); + break; + } + } }); - } + } Ok(()) }) .map_err(|err| {