aboutsummaryrefslogtreecommitdiff
path: root/debian/patches/108_nxagent_wine-close-delay.full.patch
blob: 7a9c18cf2a68040f2f60cac4f95e96bb44a5e95a (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
Description: Wine Close Delay
 Wine close delay.
 .
 Originally contributed by FreeNX Team (dimbor).
Forwarded: not-yet
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Last-Update: 2011-12-31
--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c
@@ -176,6 +176,14 @@
 
 static int nxagentForceExposure(WindowPtr pWin, pointer ptr);
 
+/* by dimbor */
+typedef struct
+{
+  CARD32 state;
+  Window icon;
+}
+nxagentWMStateRec;
+    
 /*
  * This is currently unused.
  */
@@ -1861,6 +1869,17 @@
   nxagentAddConfiguredWindow(pWin, CWStackingOrder);
   nxagentAddConfiguredWindow(pWin, CW_Shape);
 
+  /* add by dimbor */
+  if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin))
+  {
+    Atom prop = MakeAtom("WM_STATE", strlen("WM_STATE"), True);
+    nxagentWMStateRec wmState;
+    wmState.state = 1; /* NormalState */
+    wmState.icon = None;
+    if (ChangeWindowProperty(pWin, prop, prop, 32, 0, 2, &wmState, 1) != Success)
+      fprintf(stderr, "nxagentRealizeWindow: Additing WM_STATE fail.\n");
+  }
+
   #ifdef SHAPE
 
   /*
@@ -1907,6 +1926,17 @@
     return True;
   }
 
+  /* add by dimbor */
+  if (nxagentOption(Rootless) && nxagentWindowTopLevel(pWin))
+  {
+    Atom prop = MakeAtom("WM_STATE", strlen("WM_STATE"), True);
+    nxagentWMStateRec wmState;
+    wmState.state = 3; /* WithdrawnState */
+    wmState.icon = None;
+    if (ChangeWindowProperty(pWin, prop, prop, 32, 0, 2, &wmState, 1) != Success)
+      fprintf(stderr, "nxagentUnRealizeWindow: Changing WM_STATE failed.\n");
+  }
+
   XUnmapWindow(nxagentDisplay, nxagentWindow(pWin));
 
   return True;