hotkey.patch revision 764
764N/Adiff -ur old/Xi/exevents.c new/Xi/exevents.c
764N/A--- Xi/exevents.c Wed May 27 13:40:54 2009
764N/A+++ Xi/exevents.c Thu May 28 16:56:37 2009
764N/A@@ -193,6 +193,10 @@
764N/A KeyClassPtr mk, dk; /* master, device */
764N/A BOOL sendNotify = FALSE;
764N/A int i;
764N/A+#ifdef SUNSOFT
764N/A+ DeviceIntPtr mdev = dixLookupPrivate(&master->devPrivates,
764N/A+ HotkeyMapDevicePrivateKey);
764N/A+#endif
764N/A
764N/A if (device == master)
764N/A return;
764N/A@@ -201,7 +205,11 @@
764N/A mk = master->key;
764N/A
764N/A if (device != dixLookupPrivate(&master->devPrivates,
764N/A+#ifdef SUNSOFT
764N/A+ CoreDevicePrivateKey) && (device != mdev)) {
764N/A+#else
764N/A CoreDevicePrivateKey)) {
764N/A+#endif
764N/A memcpy(mk->modifierMap, dk->modifierMap, MAP_LENGTH);
764N/A
764N/A if (dk->maxKeysPerModifier)
764N/Adiff -ur old/config/hal.c new/config/hal.c
764N/A--- config/hal.c Wed May 27 17:32:59 2009
764N/A+++ config/hal.c Thu Jul 16 18:24:46 2009
764N/A@@ -186,7 +186,63 @@
764N/A return FALSE;
764N/A }
764N/A
764N/A+#ifdef SUNSOFT
764N/A static void
764N/A+add_extra_device(char *driver)
764N/A+{
764N/A+ DeviceIntPtr dev;
764N/A+ char *config_info = NULL;
764N/A+ InputOption *options = NULL, *tmpo = NULL;
764N/A+
764N/A+ options = xcalloc(sizeof(*options), 1);
764N/A+ if (!options){
764N/A+ LogMessage(X_ERROR, "config/hal: couldn't allocate space for input options!\n");
764N/A+ goto unwind;
764N/A+ }
764N/A+
764N/A+ options->key = xstrdup("_source");
764N/A+ options->value = xstrdup("server/hal");
764N/A+ if (!options->key || !options->value) {
764N/A+ LogMessage(X_ERROR, "config/hal: couldn't allocate first key/value pair\n");
764N/A+ goto unwind;
764N/A+ }
764N/A+
764N/A+ add_option(&options, "driver", driver);
764N/A+ add_option(&options, "name", driver);
764N/A+
764N/A+ config_info = xalloc(strlen(driver) + 5); /* "hal:" and NULL */
764N/A+ if (!config_info) {
764N/A+ LogMessage(X_ERROR, "config/hal: couldn't allocate name\n");
764N/A+ goto unwind;
764N/A+ }
764N/A+ sprintf(config_info, "hal:%s", driver);
764N/A+
764N/A+ /* Check for duplicate devices */
764N/A+ if (device_is_duplicate(config_info))
764N/A+ goto unwind;
764N/A+
764N/A+ LogMessage(X_INFO, "config/hal: Adding input device %s\n", driver);
764N/A+ if (NewInputDeviceRequest(options, &dev) != Success) {
764N/A+ LogMessage(X_ERROR, "config/hal: NewInputDeviceRequest failed\n");
764N/A+ dev = NULL;
764N/A+ goto unwind;
764N/A+ }
764N/A+
764N/A+ dev->config_info = xstrdup(config_info);
764N/A+
764N/A+unwind:
764N/A+ if (config_info)
764N/A+ xfree(config_info);
764N/A+ while (!dev && (tmpo = options)) {
764N/A+ options = tmpo->next;
764N/A+ xfree(tmpo->key);
764N/A+ xfree(tmpo->value);
764N/A+ xfree(tmpo);
764N/A+ }
764N/A+}
764N/A+#endif
764N/A+
764N/A+static void
764N/A device_added(LibHalContext *hal_ctx, const char *udi)
764N/A {
764N/A char *path = NULL, *driver = NULL, *name = NULL, *config_info = NULL;
764N/A@@ -195,6 +251,9 @@
764N/A DBusError error;
764N/A struct xkb_options xkb_opts = {0};
764N/A int rc;
764N/A+#ifdef SUNSOFT
764N/A+ char *mdriver = NULL;
764N/A+#endif
764N/A
764N/A LibHalPropertySet *set = NULL;
764N/A LibHalPropertySetIterator set_iter;
764N/A@@ -398,6 +457,16 @@
764N/A if (xkb_opts.options)
764N/A add_option(&options, "xkb_options", xkb_opts.options);
764N/A
764N/A+#ifdef SUNSOFT
764N/A+ for (tmpo = options; tmpo; tmpo = tmpo->next) {
764N/A+ if (!strcmp(tmpo->key, "mdriver") && (tmpo->value))
764N/A+ mdriver = tmpo->value;
764N/A+ }
764N/A+
764N/A+ if (mdriver)
764N/A+ add_extra_device (mdriver);
764N/A+#endif
764N/A+
764N/A /* this isn't an error, but how else do you output something that the user can see? */
764N/A LogMessage(X_INFO, "config/hal: Adding input device %s\n", name);
764N/A if ((rc = NewInputDeviceRequest(options, &dev)) != Success) {
764N/Adiff -ur old/config/x11-input.fdi new/config/x11-input.fdi
764N/A--- config/x11-input.fdi Wed May 27 16:03:27 2009
764N/A+++ config/x11-input.fdi Thu Jul 16 18:01:18 2009
764N/A@@ -76,6 +76,12 @@
764N/A <!-- If we're using Linux, we use evdev by default (falling back to
764N/A kbd otherwise). -->
764N/A <merge key="input.x11_driver" type="string">kbd</merge>
764N/A+ <match key="/org/freedesktop/Hal/devices/computer:system.formfactor" string="laptop">
764N/A+ <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
764N/A+ string="SunOS">
764N/A+ <merge key="input.x11_options.mdriver" type="string">hotkey</merge>
764N/A+ </match>
764N/A+ </match>
764N/A <merge key="input.x11_options.XkbModel" type="string">pc105</merge>
764N/A <match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
764N/A string="Linux">
764N/Adiff -ur old/dix/devices.c new/dix/devices.c
764N/A--- dix/devices.c Thu Jul 16 18:26:35 2009
764N/A+++ dix/devices.c Thu Jul 16 18:30:12 2009
764N/A@@ -95,6 +95,10 @@
764N/A
764N/A static int CoreDevicePrivateKeyIndex;
764N/A DevPrivateKey CoreDevicePrivateKey = &CoreDevicePrivateKeyIndex;
764N/A+#ifdef SUNSOFT
764N/A+static int HotkeyMapDevicePrivateKeyIndex;
764N/A+DevPrivateKey HotkeyMapDevicePrivateKey = &HotkeyMapDevicePrivateKeyIndex;
764N/A+#endif
764N/A /* Used to sture classes currently not in use by an MD */
764N/A static int UnusedClassesPrivateKeyIndex;
764N/A DevPrivateKey UnusedClassesPrivateKey = &UnusedClassesPrivateKeyIndex;
764N/Adiff -ur old/include/inputstr.h new/include/inputstr.h
764N/A--- include/inputstr.h Wed May 27 13:18:36 2009
764N/A+++ include/inputstr.h Wed May 27 13:18:15 2009
764N/A@@ -64,6 +64,9 @@
764N/A #define EMASKSIZE MAXDEVICES + 1
764N/A
764N/A extern DevPrivateKey CoreDevicePrivateKey;
764N/A+#ifdef SUNSOFT
764N/A+extern DevPrivateKey HotkeyMapDevicePrivateKey;
764N/A+#endif
764N/A
764N/A /* Kludge: OtherClients and InputClients must be compatible, see code */
764N/A