author | Alan Coopersmith <Alan.Coopersmith@Oracle.COM> |
Mon, 09 May 2011 14:58:28 -0700 | |
changeset 1124 | 7bc7e624f965 |
parent 1088 | 1c99106ccbe0 |
child 1179 | 4ad971e180c3 |
permissions | -rw-r--r-- |
1124
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
1 |
diff --git a/Xi/exevents.c b/Xi/exevents.c |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
2 |
index 327873e..717f275 100644 |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
3 |
--- a/Xi/exevents.c |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
4 |
+++ b/Xi/exevents.c |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
5 |
@@ -187,7 +187,16 @@ CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master) |
1088
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
6 |
{ |
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
7 |
KeyClassPtr mk = master->key; |
1088
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
8 |
|
764 | 9 |
+#ifdef SUNSOFT |
10 |
+ DeviceIntPtr mdev = dixLookupPrivate(&master->devPrivates, |
|
11 |
+ HotkeyMapDevicePrivateKey); |
|
12 |
+#endif |
|
1088
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
13 |
+ |
764 | 14 |
+#ifdef SUNSOFT |
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
15 |
+ if ((device == master) || (device == mdev)) |
764 | 16 |
+#else |
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
17 |
if (device == master) |
764 | 18 |
+#endif |
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
19 |
return; |
764 | 20 |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
21 |
mk->sourceid = device->id; |
1124
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
22 |
diff --git a/Xi/extinit.c b/Xi/extinit.c |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
23 |
index 82df7eb..6b99fae 100644 |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
24 |
--- a/Xi/extinit.c |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
25 |
+++ b/Xi/extinit.c |
1088
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
26 |
@@ -371,6 +371,10 @@ extern XExtensionVersion XIVersion; |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
27 |
|
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
28 |
Mask PropagateMask[MAXDEVICES]; |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
29 |
|
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
30 |
+#ifdef SUNSOFT |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
31 |
+DevPrivateKeyRec HotkeyMapDevicePrivateKeyRec; |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
32 |
+#endif |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
33 |
+ |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
34 |
/***************************************************************** |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
35 |
* |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
36 |
* Versioning support |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
37 |
@@ -1255,6 +1259,11 @@ XInputExtensionInit(void) |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
38 |
if (!dixRegisterPrivateKey(&XIClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(XIClientRec))) |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
39 |
FatalError("Cannot request private for XI.\n"); |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
40 |
|
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
41 |
+#ifdef SUNSOFT |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
42 |
+ if (!dixRegisterPrivateKey(&HotkeyMapDevicePrivateKeyRec, PRIVATE_DEVICE, 0)) |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
43 |
+ FatalError("Cannot request private for hotkey.\n"); |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
44 |
+#endif |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
45 |
+ |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
46 |
if (!AddCallback(&ClientStateCallback, XIClientCallback, 0)) |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
47 |
FatalError("Failed to add callback to XI.\n"); |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
48 |
|
1124
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
49 |
diff --git a/config/hal.c b/config/hal.c |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
50 |
index 297520a..44c1582 100644 |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
51 |
--- a/config/hal.c |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
52 |
+++ b/config/hal.c |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
53 |
@@ -123,6 +123,63 @@ get_prop_string_array(LibHalContext *hal_ctx, const char *udi, const char *prop) |
1088
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
54 |
return ret; |
764 | 55 |
} |
56 |
||
57 |
+#ifdef SUNSOFT |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
58 |
+static void |
764 | 59 |
+add_extra_device(char *driver) |
60 |
+{ |
|
61 |
+ DeviceIntPtr dev; |
|
62 |
+ char *config_info = NULL; |
|
63 |
+ InputOption *options = NULL, *tmpo = NULL; |
|
1088
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
64 |
+ InputAttributes attrs = {0}; |
764 | 65 |
+ |
66 |
+ options = xcalloc(sizeof(*options), 1); |
|
67 |
+ if (!options){ |
|
68 |
+ LogMessage(X_ERROR, "config/hal: couldn't allocate space for input options!\n"); |
|
69 |
+ goto unwind; |
|
70 |
+ } |
|
71 |
+ |
|
72 |
+ options->key = xstrdup("_source"); |
|
73 |
+ options->value = xstrdup("server/hal"); |
|
74 |
+ if (!options->key || !options->value) { |
|
75 |
+ LogMessage(X_ERROR, "config/hal: couldn't allocate first key/value pair\n"); |
|
76 |
+ goto unwind; |
|
77 |
+ } |
|
78 |
+ |
|
79 |
+ add_option(&options, "driver", driver); |
|
80 |
+ add_option(&options, "name", driver); |
|
81 |
+ |
|
82 |
+ config_info = xalloc(strlen(driver) + 5); /* "hal:" and NULL */ |
|
83 |
+ if (!config_info) { |
|
84 |
+ LogMessage(X_ERROR, "config/hal: couldn't allocate name\n"); |
|
85 |
+ goto unwind; |
|
86 |
+ } |
|
87 |
+ sprintf(config_info, "hal:%s", driver); |
|
88 |
+ |
|
89 |
+ /* Check for duplicate devices */ |
|
90 |
+ if (device_is_duplicate(config_info)) |
|
91 |
+ goto unwind; |
|
92 |
+ |
|
93 |
+ LogMessage(X_INFO, "config/hal: Adding input device %s\n", driver); |
|
1088
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
94 |
+ if (NewInputDeviceRequest(options, &attrs, &dev) != Success) { |
764 | 95 |
+ LogMessage(X_ERROR, "config/hal: NewInputDeviceRequest failed\n"); |
96 |
+ dev = NULL; |
|
97 |
+ goto unwind; |
|
98 |
+ } |
|
99 |
+ |
|
100 |
+ dev->config_info = xstrdup(config_info); |
|
101 |
+ |
|
102 |
+unwind: |
|
103 |
+ if (config_info) |
|
104 |
+ xfree(config_info); |
|
105 |
+ while (!dev && (tmpo = options)) { |
|
106 |
+ options = tmpo->next; |
|
107 |
+ xfree(tmpo->key); |
|
108 |
+ xfree(tmpo->value); |
|
109 |
+ xfree(tmpo); |
|
110 |
+ } |
|
111 |
+} |
|
112 |
+#endif |
|
113 |
+ |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
114 |
static void |
764 | 115 |
device_added(LibHalContext *hal_ctx, const char *udi) |
116 |
{ |
|
1124
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
117 |
@@ -134,6 +191,9 @@ device_added(LibHalContext *hal_ctx, const char *udi) |
764 | 118 |
DBusError error; |
119 |
struct xkb_options xkb_opts = {0}; |
|
120 |
int rc; |
|
121 |
+#ifdef SUNSOFT |
|
122 |
+ char *mdriver = NULL; |
|
123 |
+#endif |
|
124 |
||
125 |
LibHalPropertySet *set = NULL; |
|
126 |
LibHalPropertySetIterator set_iter; |
|
1124
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
127 |
@@ -377,6 +437,16 @@ device_added(LibHalContext *hal_ctx, const char *udi) |
764 | 128 |
add_option(&options, "xkb_options", xkb_opts.options); |
1124
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
129 |
add_option(&options, "config_info", config_info); |
764 | 130 |
|
131 |
+#ifdef SUNSOFT |
|
132 |
+ for (tmpo = options; tmpo; tmpo = tmpo->next) { |
|
133 |
+ if (!strcmp(tmpo->key, "mdriver") && (tmpo->value)) |
|
134 |
+ mdriver = tmpo->value; |
|
135 |
+ } |
|
136 |
+ |
|
137 |
+ if (mdriver) |
|
138 |
+ add_extra_device (mdriver); |
|
139 |
+#endif |
|
140 |
+ |
|
141 |
/* this isn't an error, but how else do you output something that the user can see? */ |
|
142 |
LogMessage(X_INFO, "config/hal: Adding input device %s\n", name); |
|
1088
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
143 |
if ((rc = NewInputDeviceRequest(options, &attrs, &dev)) != Success) { |
1124
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
144 |
diff --git a/config/x11-input.fdi b/config/x11-input.fdi |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
145 |
index b263f36..425aec2 100644 |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
146 |
--- a/config/x11-input.fdi |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
147 |
+++ b/config/x11-input.fdi |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
148 |
@@ -71,6 +71,12 @@ |
764 | 149 |
<!-- If we're using Linux, we use evdev by default (falling back to |
150 |
kbd otherwise). --> |
|
151 |
<merge key="input.x11_driver" type="string">kbd</merge> |
|
152 |
+ <match key="/org/freedesktop/Hal/devices/computer:system.formfactor" string="laptop"> |
|
153 |
+ <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" |
|
154 |
+ string="SunOS"> |
|
155 |
+ <merge key="input.x11_options.mdriver" type="string">hotkey</merge> |
|
156 |
+ </match> |
|
157 |
+ </match> |
|
158 |
<merge key="input.x11_options.XkbModel" type="string">pc105</merge> |
|
159 |
<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" |
|
160 |
string="Linux"> |
|
1124
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
161 |
diff --git a/include/inputstr.h b/include/inputstr.h |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
162 |
index b74ee04..808f36f 100644 |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
163 |
--- a/include/inputstr.h |
7bc7e624f965
7042476 Xorg 1.10 & associated module updates [PSARC/2011/214]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
1088
diff
changeset
|
164 |
+++ b/include/inputstr.h |
1088
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
165 |
@@ -57,6 +57,11 @@ SOFTWARE. |
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
166 |
#include "geext.h" |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
167 |
#include "privates.h" |
764 | 168 |
|
169 |
+#ifdef SUNSOFT |
|
1088
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
170 |
+extern _X_EXPORT DevPrivateKeyRec HotkeyMapDevicePrivateKeyRec; |
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
171 |
+#define HotkeyMapDevicePrivateKey (&HotkeyMapDevicePrivateKeyRec) |
764 | 172 |
+#endif |
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
173 |
+ |
1088
1c99106ccbe0
6983602 Xorg 1.9 integration [PSARC/2011/008]
Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
parents:
851
diff
changeset
|
174 |
#define BitIsOn(ptr, bit) (!!(((BYTE *) (ptr))[(bit)>>3] & (1 << ((bit) & 7)))) |
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
175 |
#define SetBit(ptr, bit) (((BYTE *) (ptr))[(bit)>>3] |= (1 << ((bit) & 7))) |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
176 |
#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7))) |