aboutsummaryrefslogtreecommitdiff
path: root/doc/nx-X11_vs_XOrg69_patches/nx-X11_programs_Xserver_randr_randr.c.X.original
blob: d19f82022f1a739e2e06228c8ebeae7d41b934f6 (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
--- ./nx-X11/programs/Xserver/randr/randr.c.X.original	2015-02-13 14:03:44.792440567 +0100
+++ ./nx-X11/programs/Xserver/randr/randr.c	2015-02-10 19:13:13.616692925 +0100
@@ -25,6 +25,23 @@
  *	    Keith Packard, Intel Corporation
  */
 
+/**************************************************************************/
+/*                                                                        */
+/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/.         */
+/*                                                                        */
+/* NX-X11, NX protocol compression and NX extensions to this software     */
+/* are copyright of NoMachine. Redistribution and use of the present      */
+/* software is allowed according to terms specified in the file LICENSE   */
+/* which comes in the source distribution.                                */
+/*                                                                        */
+/* Check http://www.nomachine.com/licensing.html for applicability.       */
+/*                                                                        */
+/* NX and NoMachine are trademarks of Medialogic S.p.A.                   */
+/*                                                                        */
+/* All rights reserved.                                                   */
+/*                                                                        */
+/**************************************************************************/
+
 #define NEED_REPLIES
 #define NEED_EVENTS
 #ifdef HAVE_DIX_CONFIG_H
@@ -56,9 +73,14 @@
 int	RREventBase;
 int	RRErrorBase;
 RESTYPE RRClientType, RREventType; /* resource types for event masks */
-DevPrivateKey RRClientPrivateKey = &RRClientPrivateKey;
 
+#ifndef NXAGENT_SERVER
+DevPrivateKey RRClientPrivateKey = &RRClientPrivateKey;
 DevPrivateKey rrPrivKey = &rrPrivKey;
+#else
+int	RRClientPrivateIndex;
+int	rrPrivIndex = -1;
+#endif
 
 static void
 RRClientCallback (CallbackListPtr	*list,
@@ -203,6 +225,10 @@
 {
     if (RRGeneration != serverGeneration)
     {
+        #ifdef NXAGENT_SERVER
+	if ((rrPrivIndex = AllocateScreenPrivateIndex()) < 0)
+	    return FALSE;
+        #endif
 	if (!RRModeInit ())
 	    return FALSE;
 	if (!RRCrtcInit ())
@@ -324,10 +350,18 @@
 
     if (RRNScreens == 0) return;
 
+    #ifndef NXAGENT_SERVER
     if (!dixRequestPrivate(RRClientPrivateKey,
 				sizeof (RRClientRec) +
 				screenInfo.numScreens * sizeof (RRTimesRec)))
 	return;
+    #else
+    RRClientPrivateIndex = AllocateClientPrivateIndex ();
+    if (!AllocateClientPrivate (RRClientPrivateIndex,
+				sizeof (RRClientRec) +
+				screenInfo.numScreens * sizeof (RRTimesRec)))
+	return;
+    #endif
     if (!AddCallback (&ClientStateCallback, RRClientCallback, 0))
 	return;