summaryrefslogtreecommitdiff
path: root/x11-misc/dunst-1.0.0/net-wm-window-type_followup.patch
blob: b01eb0128f2c8c313a9077425908c7db1dc3e7d4 (plain)
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
From 0466d41c507352766d86f4e2e9292b68162dc6eb Mon Sep 17 00:00:00 2001
From: Yuri D'Elia <yuri.delia@eurac.edu>
Date: Thu, 6 Mar 2014 16:47:06 +0100
Subject: [PATCH] Set _NET_WM_STATE_ABOVE and fix window type.

- Fix indentation.
- Fix wrong paramenters in call to XChangeProperty
- Do not try to raise the window, set _NET_WM_STATE_ABOVE instead
---
 x.c | 36 +++++++++++++++++++-----------------
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/x.c b/x.c
index a4e877f..f552f1b 100644
--- a/x.c
+++ b/x.c
@@ -581,10 +581,6 @@ gboolean x_mainloop_fd_dispatch(GSource * source, GSourceFunc callback,
                 case SelectionNotify:
                         if (ev.xselection.property == xctx.utf8)
                                 break;
-                case VisibilityNotify:
-                        if (ev.xvisibility.state != VisibilityUnobscured)
-                                XRaiseWindow(xctx.dpy, xctx.win);
-                        break;
                 case ButtonPress:
                         if (ev.xbutton.window == xctx.win) {
                                 x_handle_click(ev);
@@ -854,23 +850,29 @@ void x_setup(void)
 }
 
 
-static void x_set_win_type(Window win)
+static void x_set_wm(Window win)
 {
 
-    long data[2];
+        Atom data[2];
+
+        /* set window type */
+        Atom net_wm_window_type =
+                XInternAtom(xctx.dpy, "_NET_WM_WINDOW_TYPE", false);
+
+        data[0] = XInternAtom(xctx.dpy, "_NET_WM_WINDOW_TYPE_NOTIFICATION", false);
+        data[1] = XInternAtom(xctx.dpy, "_NET_WM_WINDOW_TYPE_UTILITY", false);
+
+        XChangeProperty(xctx.dpy, win, net_wm_window_type, XA_ATOM, 32,
+                PropModeReplace, (unsigned char *) data, 2L);
 
-    Atom net_wm_window_type =
-            XInternAtom(xctx.dpy, "_NET_WM_WINDOW_TYPE", false);
-    Atom net_wm_window_type_notification =
-            XInternAtom(xctx.dpy, "_NET_WM_WINDOW_TYPE_NOTIFICATION", false);
-    Atom net_wm_window_type_utility =
-            XInternAtom(xctx.dpy, "_NET_WM_WINDOW_TYPE_UTILITY", false);
+        /* set state above */
+        Atom net_wm_state =
+                XInternAtom(xctx.dpy, "_NET_WM_STATE", false);
 
-    data[0] = net_wm_window_type_notification;
-    data[1] = net_wm_window_type_utility;
+        data[0] = XInternAtom(xctx.dpy, "_NET_WM_STATE_ABOVE", false);
 
-    XChangeProperty(xctx.dpy, win, net_wm_window_type, XA_ATOM, 32,
-            PropModeReplace, (unsigned char *) &data, 1L);
+        XChangeProperty(xctx.dpy, win, net_wm_state, XA_ATOM, 32,
+                PropModeReplace, (unsigned char *) data, 1L);
 }
 
         /*
@@ -906,7 +908,7 @@ static void x_win_setup(void)
                                                         DefaultScreen(xctx.dpy)),
                           CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
 
-        x_set_win_type(xctx.win);
+        x_set_wm(xctx.win);
         settings.transparency =
             settings.transparency > 100 ? 100 : settings.transparency;
         setopacity(xctx.win,
-- 
1.9.1