+2003-03-07 Padraig O'Briain <padraig.obriain@sun.com>
+
+ [needed by GOK, to fix bugs 107985 and 107988]
+ * registryd/deviceeventcontroller.c:
+ (spi_dec_clear_unlatch_pending):
+ New method, unsets the 'unlatch' mask for XkbStateNotifyEvents.
+ (spi_dec_set_unlatch_pending):Revised DEBUG comment.
+ (spi_dec_init_mouse_listener):Emit warning if mouse button
+ passive grab fails.
+ (spi_device_event_controller_forward_mouse_event):
+ Removed unnecessary parens from a conditional.
+ (global_filter_fn):Added TODO comment.
+ (impl_generate_keyboard_event):
+ Cancel a pending relatch if a 'delatching' key was
+ synthesized.
+
2003-03-07 Padraig O'Briain <padraig.obriain@sun.com>
* atk-bridge/bridge.c:
DEControllerPrivateData *priv =
g_object_get_qdata (G_OBJECT (controller), spi_dec_private_quark);
#ifdef SPI_XKB_DEBUG
- if (priv->xkb_latch_mask) fprintf (stderr, "unlatch pending! %x\n", mask);
+ if (priv->xkb_latch_mask) fprintf (stderr, "unlatch pending! %x\n",
+ priv->xkb_latch_mask);
#endif
priv->pending_xkb_mod_relatch_mask |= priv->xkb_latch_mask;
}
+static void
+spi_dec_clear_unlatch_pending (SpiDEController *controller)
+{
+ DEControllerPrivateData *priv =
+ g_object_get_qdata (G_OBJECT (controller), spi_dec_private_quark);
+ priv->xkb_latch_mask = 0;
+}
+
static gboolean
spi_dec_button_update_and_emit (SpiDEController *controller,
guint mask_return)
if (display)
{
- XGrabButton (display, AnyButton, AnyModifier,
+ if (XGrabButton (display, AnyButton, AnyModifier,
gdk_x11_get_default_root_xwindow (),
True, ButtonPressMask | ButtonReleaseMask,
- GrabModeSync, GrabModeAsync, None, None);
+ GrabModeSync, GrabModeAsync, None, None) != Success)
+ fprintf (stderr, "WARNING: could not grab mouse buttons!\n");
XSync (display, False);
#ifdef SPI_DEBUG
fprintf (stderr, "mouse buttons grabbed\n");
int button = xbutton_event->button;
unsigned int mouse_button_state = xbutton_event->state;
-
+
switch (button)
{
case 1:
/* if client wants to consume this event, and XKB latch state was
* unset by this button event, we reset it
*/
- if (is_consumed && (xkb_mod_unlatch_occurred))
+ if (is_consumed && xkb_mod_unlatch_occurred)
spi_dec_set_unlatch_pending (controller, mouse_mask_state);
XAllowEvents (spi_get_display (),
&= ~(XkbAX_StickyKeysFBMask);
XkbChangeControls (display, priv->xkb_desc, &changes);
}
+ /* TODO: account for lock as well as latch */
XkbLatchModifiers (display,
XkbUseCoreKbd,
priv->pending_xkb_mod_relatch_mask,
SpiDEController *controller =
SPI_DEVICE_EVENT_CONTROLLER (bonobo_object (servant));
long key_synth_code;
+ KeySym keysym;
#ifdef SPI_DEBUG
fprintf (stderr, "synthesizing keystroke %ld, type %d\n",
{
DBG (-1, g_warning ("Error emitting keystroke"));
}
+ if (synth_type == Accessibility_KEY_SYM) {
+ keysym = keycode;
+ }
+ else {
+ keysym = XkbKeycodeToKeysym (spi_get_display (), keycode, 0, 0);
+ }
+ if (XkbKeysymToModifiers (spi_get_display (), keysym) == 0)
+ {
+ spi_dec_clear_unlatch_pending (controller);
+ }
}
/* Accessibility::DEController::generateMouseEvent */