mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
show wallpaper only when support, show test on checked
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -1341,6 +1341,14 @@ impl WallPaperRemover {
|
||||
old_path_dark,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn support() -> bool {
|
||||
let desktop = std::env::var("XDG_CURRENT_DESKTOP").unwrap_or_default();
|
||||
if wallpaper::gnome::is_compliant(&desktop) || desktop.as_str() == "XFCE" {
|
||||
return wallpaper::get().is_ok();
|
||||
}
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for WallPaperRemover {
|
||||
|
||||
@@ -2392,6 +2392,10 @@ impl WallPaperRemover {
|
||||
Ok(Self { old_path })
|
||||
}
|
||||
|
||||
pub fn support() -> bool {
|
||||
wallpaper::get().is_ok() || !Self::get_recent_wallpaper().unwrap_or_default().is_empty()
|
||||
}
|
||||
|
||||
fn get_recent_wallpaper() -> ResultType<String> {
|
||||
// SystemParametersInfoW may return %appdata%\Microsoft\Windows\Themes\TranscodedWallpaper, not real path and may not real cache
|
||||
// https://www.makeuseof.com/find-desktop-wallpapers-file-location-windows-11/
|
||||
|
||||
Reference in New Issue
Block a user