forked from QubesOS/qubes-desktop-linux-xfce4-xfwm4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0002-Qubes-decoration-custom-colors.patch
58 lines (51 loc) · 1.82 KB
/
0002-Qubes-decoration-custom-colors.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
56
57
From e5da8df545117dcc8e399bc2917d930c41f0a3f8 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:43:01 +0200
Subject: [PATCH] Qubes decoration: custom colors
Authors:
@marmarek
Original work done in:
- QubesOS/qubes-desktop-linux-xfce4
- QubesOS/qubes-desktop-linux-xfce4-xfwm4
---
src/client.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/client.c b/src/client.c
index 52d8dbda8..b9b12b96c 100644
--- a/src/client.c
+++ b/src/client.c
@@ -173,15 +173,31 @@ getQubesLabel (Client *c)
ScreenInfo *screen_info;
DisplayInfo *display_info;
Atom atom_label;
+ Atom atom_label_color;
screen_info = c->screen_info;
display_info = screen_info->display_info;
atom_label = XInternAtom(display_info->dpy, "_QUBES_LABEL", TRUE);
+ atom_label_color = XInternAtom(display_info->dpy, "_QUBES_LABEL_COLOR", TRUE);
- if (atom_label == 0) {
- c->qubes_label_color = QUBES_LABEL_DOM0;
- } else {
+ c->qubes_label_color = QUBES_LABEL_DOM0;
+ if (atom_label_color) {
+ Atom actual_type;
+ int actual_format;
+ unsigned long nitems = 0, bytes_left;
+ unsigned char *data = 0;
+
+ if ((XGetWindowProperty (display_info->dpy, c->window, atom_label_color, 0L, 1L,
+ FALSE, XA_CARDINAL, &actual_type, &actual_format, &nitems,
+ &bytes_left, &data) == Success))
+ {
+ if (nitems == 1 && actual_format == 32) {
+ c->qubes_label_color = *(long*)data;
+ }
+ }
+ }
+ if (c->qubes_label_color == QUBES_LABEL_DOM0 && atom_label) {
Atom actual_type;
int actual_format;
unsigned long nitems = 0, bytes_left;
--
2.25.4