virt-viewer: use title as subtitle

This commit is contained in:
dump_stack() 2020-02-02 02:13:57 +00:00
parent 7cad1efce8
commit 218e81a6ac
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
5 changed files with 48 additions and 3 deletions

View File

@ -5,6 +5,7 @@ let
./patches/0001-Remove-menu-bar.patch
./patches/0002-Do-not-grab-keyboard-mouse.patch
./patches/0003-Use-name-of-appvm-applications-as-a-title.patch
./patches/0004-Use-title-application-name-as-subtitle.patch
];
});
in with pkgs;

View File

@ -1,7 +1,7 @@
From c26580442a4ac18f805b1795ec250d6cf5857a49 Mon Sep 17 00:00:00 2001
From: Mikhail Klementev <blame@dumpstack.io>
Date: Wed, 22 Jan 2020 00:25:16 +0000
Subject: [PATCH 1/3] Remove menu bar
Subject: [PATCH 1/4] Remove menu bar
---
src/resources/ui/virt-viewer.ui | 2 +-

View File

@ -1,7 +1,7 @@
From eac430d01f486e15b55d6fa992e77ded77bb4b1a Mon Sep 17 00:00:00 2001
From: Mikhail Klementev <blame@dumpstack.io>
Date: Wed, 22 Jan 2020 00:41:34 +0000
Subject: [PATCH 2/3] Do not grab keyboard/mouse
Subject: [PATCH 2/4] Do not grab keyboard/mouse
---
src/virt-viewer-display-spice.c | 4 ++--

View File

@ -1,7 +1,7 @@
From c5b51c0a540af34499f2b2a49cb64599c06ba293 Mon Sep 17 00:00:00 2001
From: Mikhail Klementev <blame@dumpstack.io>
Date: Wed, 22 Jan 2020 01:24:57 +0000
Subject: [PATCH 3/3] Use name of appvm applications as a title
Subject: [PATCH 3/4] Use name of appvm applications as a title
---
src/virt-viewer-window.c | 3 +++

View File

@ -0,0 +1,44 @@
From 8e95408365b57c64a738381d132ecdc844013afb Mon Sep 17 00:00:00 2001
From: Mikhail Klementev <blame@dumpstack.io>
Date: Wed, 22 Jan 2020 02:27:26 +0000
Subject: [PATCH 4/4] Use title (application name) as subtitle
---
src/virt-viewer-app.c | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 343b1af..8267f82 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -718,25 +718,8 @@ virt_viewer_app_set_window_subtitle(VirtViewerApp *app,
gchar *subtitle = NULL;
const gchar *title = virt_viewer_app_get_title(app);
- if (title != NULL) {
- VirtViewerDisplay *display = virt_viewer_window_get_display(window);
- gchar *d = strstr(title, "%d");
- gchar *desc = NULL;
-
- if (display && VIRT_VIEWER_IS_DISPLAY_VTE(display)) {
- g_object_get(display, "name", &desc, NULL);
- } else {
- desc = g_strdup_printf("%d", nth + 1);
- }
-
- if (d != NULL) {
- *d = '\0';
- subtitle = g_strdup_printf("%s%s%s", title, desc, d + 2);
- *d = '%';
- } else
- subtitle = g_strdup_printf("%s (%s)", title, desc);
- g_free(desc);
- }
+ if (title != NULL)
+ subtitle = g_strdup_printf("%s", title);
g_object_set(window, "subtitle", subtitle, NULL);
g_free(subtitle);
--
2.23.1