forked from QubesOS/qubes-desktop-linux-xfce4-xfwm4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0005-Qubes-decoration-handle-guivm-windows-prefix.patch
56 lines (51 loc) · 2.19 KB
/
0005-Qubes-decoration-handle-guivm-windows-prefix.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From 2c3257dc8d88dd1ce7c9bcb32c521705958fb60f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?=
Date: Sat, 16 May 2020 11:44:53 +0200
Subject: [PATCH] Qubes decoration: handle guivm windows prefix
Authors:
@fepitre
Original work done in:
- QubesOS/qubes-desktop-linux-xfce4-xfwm4
---
src/client.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/src/client.c b/src/client.c
index ac9620f2c..aa66f008d 100644
--- a/src/client.c
+++ b/src/client.c
@@ -262,12 +262,32 @@ getQubesVmName (Client *c)
c->qubes_vmname = g_strdup (_("[ERROR Reading VM name?!] "));
}
} else {
- c->qubes_vmname = g_strdup("[Dom0] ");
+ // In case of GuiVM get qubes_vmname from root window if set
+ if ((XGetWindowProperty (display_info->dpy, XDefaultRootWindow(display_info->dpy), atom_vmname, 0L, 0L,
+ FALSE, AnyPropertyType, &actual_type, &actual_format, &nitems,
+ &bytes_left, (unsigned char **) &data) == Success))
+ {
+ if (bytes_left > 0) {
+ if ((XGetWindowProperty (display_info->dpy, XDefaultRootWindow(display_info->dpy), atom_vmname, 0L, bytes_left,
+ FALSE, AnyPropertyType, &actual_type, &actual_format, &nitems,
+ &bytes_left, (unsigned char **) &data) == Success))
+ {
+ c->qubes_vmname = g_strdup_printf (_("[%s] "), data);
+ } else {
+ c->qubes_vmname = g_strdup (_("[ERROR Reading VM name?!] "));
+ }
+ } else {
+ c->qubes_vmname = g_strdup("[Dom0] ");
+ }
+ } else {
+ c->qubes_vmname = g_strdup("[Dom0] ");
+ }
}
} else {
c->qubes_vmname = g_strdup("[Dom0] ");
}
}
+ TRACE ("qubes_vmname \"%s\"", c->qubes_vmname);
}
static gchar*
--
2.25.4