mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-07 08:01:29 +03:00
fix hide-tray=Y causing The application “RustDesk.app” is not open anymore. https://github.com/rustdesk/rustdesk/discussions/10210 (#14127)
This commit is contained in:
11
src/tray.rs
11
src/tray.rs
@@ -10,12 +10,6 @@ use std::time::Duration;
|
|||||||
|
|
||||||
pub fn start_tray() {
|
pub fn start_tray() {
|
||||||
if crate::ui_interface::get_builtin_option(hbb_common::config::keys::OPTION_HIDE_TRAY) == "Y" {
|
if crate::ui_interface::get_builtin_option(hbb_common::config::keys::OPTION_HIDE_TRAY) == "Y" {
|
||||||
#[cfg(target_os = "macos")]
|
|
||||||
{
|
|
||||||
loop {
|
|
||||||
std::thread::sleep(std::time::Duration::from_secs(1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -129,6 +123,11 @@ fn make_tray() -> hbb_common::ResultType<()> {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if let tao::event::Event::NewEvents(tao::event::StartCause::Init) = event {
|
if let tao::event::Event::NewEvents(tao::event::StartCause::Init) = event {
|
||||||
|
// for fixing https://github.com/rustdesk/rustdesk/discussions/10210#discussioncomment-14600745
|
||||||
|
// so we start tray, but not to show it
|
||||||
|
if crate::ui_interface::get_builtin_option(hbb_common::config::keys::OPTION_HIDE_TRAY) == "Y" {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// We create the icon once the event loop is actually running
|
// We create the icon once the event loop is actually running
|
||||||
// to prevent issues like https://github.com/tauri-apps/tray-icon/issues/90
|
// to prevent issues like https://github.com/tauri-apps/tray-icon/issues/90
|
||||||
let tray = TrayIconBuilder::new()
|
let tray = TrayIconBuilder::new()
|
||||||
|
|||||||
Reference in New Issue
Block a user