author | Alan Coopersmith <Alan.Coopersmith@Sun.COM> |
Sat, 05 Dec 2009 22:13:03 -0800 | |
changeset 851 | d428083dbbdd |
parent 764 | ab397169f258 |
child 1088 | 1c99106ccbe0 |
permissions | -rw-r--r-- |
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
1 |
diff -urp -x '*~' -x '*.orig' Xi/exevents.c Xi/exevents.c |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
2 |
--- Xi/exevents.c 2009-11-22 16:35:01.000000000 -0800 |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
3 |
+++ Xi/exevents.c 2009-12-02 18:58:25.404138833 -0800 |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
4 |
@@ -198,8 +198,16 @@ CopyKeyClass(DeviceIntPtr device, Device |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
5 |
KeyClassPtr mk = master->key; |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
6 |
KeyClassPtr dk = device->key; |
764 | 7 |
int i; |
8 |
+#ifdef SUNSOFT |
|
9 |
+ DeviceIntPtr mdev = dixLookupPrivate(&master->devPrivates, |
|
10 |
+ HotkeyMapDevicePrivateKey); |
|
11 |
+#endif |
|
12 |
||
13 |
+#ifdef SUNSOFT |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
14 |
+ if ((device == master) || (device == mdev)) |
764 | 15 |
+#else |
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
16 |
if (device == master) |
764 | 17 |
+#endif |
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
18 |
return; |
764 | 19 |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
20 |
mk->sourceid = device->id; |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
21 |
diff -urp -x '*~' -x '*.orig' config/hal.c config/hal.c |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
22 |
--- config/hal.c 2009-11-22 16:35:01.000000000 -0800 |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
23 |
+++ config/hal.c 2009-12-02 18:58:25.404450482 -0800 |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
24 |
@@ -186,6 +186,62 @@ device_is_duplicate(char *config_info) |
764 | 25 |
return FALSE; |
26 |
} |
|
27 |
||
28 |
+#ifdef SUNSOFT |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
29 |
+static void |
764 | 30 |
+add_extra_device(char *driver) |
31 |
+{ |
|
32 |
+ DeviceIntPtr dev; |
|
33 |
+ char *config_info = NULL; |
|
34 |
+ InputOption *options = NULL, *tmpo = NULL; |
|
35 |
+ |
|
36 |
+ options = xcalloc(sizeof(*options), 1); |
|
37 |
+ if (!options){ |
|
38 |
+ LogMessage(X_ERROR, "config/hal: couldn't allocate space for input options!\n"); |
|
39 |
+ goto unwind; |
|
40 |
+ } |
|
41 |
+ |
|
42 |
+ options->key = xstrdup("_source"); |
|
43 |
+ options->value = xstrdup("server/hal"); |
|
44 |
+ if (!options->key || !options->value) { |
|
45 |
+ LogMessage(X_ERROR, "config/hal: couldn't allocate first key/value pair\n"); |
|
46 |
+ goto unwind; |
|
47 |
+ } |
|
48 |
+ |
|
49 |
+ add_option(&options, "driver", driver); |
|
50 |
+ add_option(&options, "name", driver); |
|
51 |
+ |
|
52 |
+ config_info = xalloc(strlen(driver) + 5); /* "hal:" and NULL */ |
|
53 |
+ if (!config_info) { |
|
54 |
+ LogMessage(X_ERROR, "config/hal: couldn't allocate name\n"); |
|
55 |
+ goto unwind; |
|
56 |
+ } |
|
57 |
+ sprintf(config_info, "hal:%s", driver); |
|
58 |
+ |
|
59 |
+ /* Check for duplicate devices */ |
|
60 |
+ if (device_is_duplicate(config_info)) |
|
61 |
+ goto unwind; |
|
62 |
+ |
|
63 |
+ LogMessage(X_INFO, "config/hal: Adding input device %s\n", driver); |
|
64 |
+ if (NewInputDeviceRequest(options, &dev) != Success) { |
|
65 |
+ LogMessage(X_ERROR, "config/hal: NewInputDeviceRequest failed\n"); |
|
66 |
+ dev = NULL; |
|
67 |
+ goto unwind; |
|
68 |
+ } |
|
69 |
+ |
|
70 |
+ dev->config_info = xstrdup(config_info); |
|
71 |
+ |
|
72 |
+unwind: |
|
73 |
+ if (config_info) |
|
74 |
+ xfree(config_info); |
|
75 |
+ while (!dev && (tmpo = options)) { |
|
76 |
+ options = tmpo->next; |
|
77 |
+ xfree(tmpo->key); |
|
78 |
+ xfree(tmpo->value); |
|
79 |
+ xfree(tmpo); |
|
80 |
+ } |
|
81 |
+} |
|
82 |
+#endif |
|
83 |
+ |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
84 |
static void |
764 | 85 |
device_added(LibHalContext *hal_ctx, const char *udi) |
86 |
{ |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
87 |
@@ -195,6 +251,9 @@ device_added(LibHalContext *hal_ctx, con |
764 | 88 |
DBusError error; |
89 |
struct xkb_options xkb_opts = {0}; |
|
90 |
int rc; |
|
91 |
+#ifdef SUNSOFT |
|
92 |
+ char *mdriver = NULL; |
|
93 |
+#endif |
|
94 |
||
95 |
LibHalPropertySet *set = NULL; |
|
96 |
LibHalPropertySetIterator set_iter; |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
97 |
@@ -398,6 +457,16 @@ device_added(LibHalContext *hal_ctx, con |
764 | 98 |
if (xkb_opts.options) |
99 |
add_option(&options, "xkb_options", xkb_opts.options); |
|
100 |
||
101 |
+#ifdef SUNSOFT |
|
102 |
+ for (tmpo = options; tmpo; tmpo = tmpo->next) { |
|
103 |
+ if (!strcmp(tmpo->key, "mdriver") && (tmpo->value)) |
|
104 |
+ mdriver = tmpo->value; |
|
105 |
+ } |
|
106 |
+ |
|
107 |
+ if (mdriver) |
|
108 |
+ add_extra_device (mdriver); |
|
109 |
+#endif |
|
110 |
+ |
|
111 |
/* this isn't an error, but how else do you output something that the user can see? */ |
|
112 |
LogMessage(X_INFO, "config/hal: Adding input device %s\n", name); |
|
113 |
if ((rc = NewInputDeviceRequest(options, &dev)) != Success) { |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
114 |
diff -urp -x '*~' -x '*.orig' config/x11-input.fdi config/x11-input.fdi |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
115 |
--- config/x11-input.fdi 2009-10-27 23:56:19.000000000 -0700 |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
116 |
+++ config/x11-input.fdi 2009-12-02 18:58:25.404611476 -0800 |
764 | 117 |
@@ -76,6 +76,12 @@ |
118 |
<!-- If we're using Linux, we use evdev by default (falling back to |
|
119 |
kbd otherwise). --> |
|
120 |
<merge key="input.x11_driver" type="string">kbd</merge> |
|
121 |
+ <match key="/org/freedesktop/Hal/devices/computer:system.formfactor" string="laptop"> |
|
122 |
+ <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" |
|
123 |
+ string="SunOS"> |
|
124 |
+ <merge key="input.x11_options.mdriver" type="string">hotkey</merge> |
|
125 |
+ </match> |
|
126 |
+ </match> |
|
127 |
<merge key="input.x11_options.XkbModel" type="string">pc105</merge> |
|
128 |
<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name" |
|
129 |
string="Linux"> |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
130 |
diff -urp -x '*~' -x '*.orig' dix/devices.c dix/devices.c |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
131 |
--- dix/devices.c 2009-12-02 18:58:23.505610344 -0800 |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
132 |
+++ dix/devices.c 2009-12-02 18:58:25.405167943 -0800 |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
133 |
@@ -91,6 +91,10 @@ SOFTWARE. |
764 | 134 |
|
135 |
static int CoreDevicePrivateKeyIndex; |
|
136 |
DevPrivateKey CoreDevicePrivateKey = &CoreDevicePrivateKeyIndex; |
|
137 |
+#ifdef SUNSOFT |
|
138 |
+static int HotkeyMapDevicePrivateKeyIndex; |
|
139 |
+DevPrivateKey HotkeyMapDevicePrivateKey = &HotkeyMapDevicePrivateKeyIndex; |
|
140 |
+#endif |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
141 |
/* Used to store classes currently not in use by an MD */ |
764 | 142 |
static int UnusedClassesPrivateKeyIndex; |
143 |
DevPrivateKey UnusedClassesPrivateKey = &UnusedClassesPrivateKeyIndex; |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
144 |
diff -urp -x '*~' -x '*.orig' include/inputstr.h include/inputstr.h |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
145 |
--- include/inputstr.h 2009-11-22 16:35:01.000000000 -0800 |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
146 |
+++ include/inputstr.h 2009-12-02 18:58:25.405410778 -0800 |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
147 |
@@ -56,6 +56,10 @@ SOFTWARE. |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
148 |
#include "geext.h" |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
149 |
#include "privates.h" |
764 | 150 |
|
151 |
+#ifdef SUNSOFT |
|
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
152 |
+extern _X_EXPORT DevPrivateKey HotkeyMapDevicePrivateKey; |
764 | 153 |
+#endif |
851
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
154 |
+ |
d428083dbbdd
6905171 X11R7.5 / Xorg 1.7.3 integration
Alan Coopersmith <Alan.Coopersmith@Sun.COM>
parents:
764
diff
changeset
|
155 |
#define BitIsOn(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
|
156 |
#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
|
157 |
#define ClearBit(ptr, bit) (((BYTE *)(ptr))[(bit)>>3] &= ~(1 << ((bit) & 7))) |