From 19d05637819bf234e6556abba89cad06bc9d5554 Mon Sep 17 00:00:00 2001 From: VallierDev <24893073+VallierDev@users.noreply.github.com> Date: Sun, 18 Oct 2026 17:25:14 +0800 Subject: [PATCH] desktop: viewer launcher entry and window icon; explicit StartupWMClass (#13) The viewer's GTK windows had no icon and no desktop entry, so docks showed a generic icon next to the host's. Add uu-remote-linux-viewer.desktop and use the host icon for viewer windows. Co-Authored-By: Claude Opus 5.5 --- README.en.md | 1 + README.md | 1 + c_engine/viewer_tools.c | 1 + c_engine/viewer_window.c | 1 + contrib/desktop/uu-remote-linux-viewer.desktop | 14 ++++++++++++++ contrib/desktop/uu-remote-linux.desktop | 2 ++ 6 files changed, 20 insertions(+) create mode 100644 contrib/desktop/uu-remote-linux-viewer.desktop diff --git a/README.en.md b/README.en.md index e36e22e..b007ae5 100644 --- a/README.en.md +++ b/README.en.md @@ -225,6 +225,7 @@ Optional launcher icon: ```sh install -Dm644 contrib/desktop/uu-remote-linux.svg ~/.local/share/icons/hicolor/scalable/apps/uu-remote-linux.svg install -Dm644 contrib/desktop/uu-remote-linux.desktop ~/.local/share/applications/uu-remote-linux.desktop +install -Dm644 contrib/desktop/uu-remote-linux-viewer.desktop ~/.local/share/applications/uu-remote-linux-viewer.desktop ``` Verified with the official Mac viewer: guest connections, wrong-code rejection, code rotation, switching assistance off, diff --git a/README.md b/README.md index 1932a5b..c3c8f91 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,7 @@ X11 默认继续用 XTest,因为它能正确处理网络延迟下按住不放 ```sh install -Dm644 contrib/desktop/uu-remote-linux.svg ~/.local/share/icons/hicolor/scalable/apps/uu-remote-linux.svg install -Dm644 contrib/desktop/uu-remote-linux.desktop ~/.local/share/applications/uu-remote-linux.desktop +install -Dm644 contrib/desktop/uu-remote-linux-viewer.desktop ~/.local/share/applications/uu-remote-linux-viewer.desktop ``` 验证情况:访客身份下的连接、错误验证码拒绝、用完换码、关闭后不可连接、登录与退出登录的切换,已用官方 Mac 客户端实测通过。 diff --git a/c_engine/viewer_tools.c b/c_engine/viewer_tools.c index 3e3dfff..ce24eee 100644 --- a/c_engine/viewer_tools.c +++ b/c_engine/viewer_tools.c @@ -474,6 +474,7 @@ static gboolean show_window(gpointer d) { static void *ui_thread(void *d) { (void)d; if (!gtk_init_check(NULL, NULL)) { pthread_mutex_lock(&init_lock); init_state = -1; pthread_cond_signal(&init_cond); pthread_mutex_unlock(&init_lock); return NULL; } + gtk_window_set_default_icon_name("uu-remote-linux"); // same taskbar icon as the host (#13) // Light palette in CSS; keep a dark system theme from making unstyled text white on white (#43). g_object_set(gtk_settings_get_default(), "gtk-theme-name", "Adwaita", "gtk-application-prefer-dark-theme", FALSE, NULL); show_window(NULL); gtk_main(); return NULL; diff --git a/c_engine/viewer_window.c b/c_engine/viewer_window.c index 15a22ec..4d39ee9 100644 --- a/c_engine/viewer_window.c +++ b/c_engine/viewer_window.c @@ -590,6 +590,7 @@ static gboolean on_delete(GtkWidget *w, GdkEvent *e, gpointer d) { (void)w; (voi static void *run(void *arg) { (void)arg; int ok = gtk_init_check(NULL, NULL); + if (ok) { gtk_window_set_default_icon_name("uu-remote-linux"); } // same taskbar icon as the host (#13) // The CSS hard-codes a light palette; a dark system theme would turn unstyled text white on white (#43). if (ok) g_object_set(gtk_settings_get_default(), "gtk-theme-name", "Adwaita", "gtk-application-prefer-dark-theme", FALSE, NULL); if (ok) { diff --git a/contrib/desktop/uu-remote-linux-viewer.desktop b/contrib/desktop/uu-remote-linux-viewer.desktop new file mode 100644 index 0000000..e631a4d --- /dev/null +++ b/contrib/desktop/uu-remote-linux-viewer.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Type=Application +Name=UU 远程 Linux 控制端 +Name[en]=UU Remote Linux Viewer +GenericName=Remote desktop viewer +Comment=非官方 UU 远程控制端(实验性):远控你的 Windows / Mac / Linux 设备 +Comment[en]=Unofficial NetEase UU Remote viewer (experimental) +Exec=uuremote-viewer ui +Icon=uu-remote-linux +Terminal=false +Categories=Network;RemoteAccess; +Keywords=remote;desktop;viewer;UU;远程;控制; +StartupNotify=false +StartupWMClass=uuremote-viewer diff --git a/contrib/desktop/uu-remote-linux.desktop b/contrib/desktop/uu-remote-linux.desktop index f18c777..082afc1 100644 --- a/contrib/desktop/uu-remote-linux.desktop +++ b/contrib/desktop/uu-remote-linux.desktop @@ -11,3 +11,5 @@ Terminal=false Categories=Network;RemoteAccess; Keywords=remote;assist;UU;远程;协助; StartupNotify=false +# Matches the GTK window class so docks/taskbars show this icon for the host window (#13). +StartupWMClass=uu-remote-linux