From b9216b37ad51c161154f75d6d81c6290df20ff4f Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 29 Jan 2015 10:14:57 +0100 Subject: [PATCH] Restructure code a bit to avoid warning about unused variable --- unix/xserver/hw/vnc/InputXKB.c | 43 ++++++++++++++++------------------ 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/unix/xserver/hw/vnc/InputXKB.c b/unix/xserver/hw/vnc/InputXKB.c index e639d5ee..8d7ae569 100644 --- a/unix/xserver/hw/vnc/InputXKB.c +++ b/unix/xserver/hw/vnc/InputXKB.c @@ -628,35 +628,32 @@ static void vncXkbProcessDeviceEvent(int screenNum, DeviceIntPtr dev) { unsigned int backupctrls; + XkbControlsPtr ctrls; - if (event->device_event.sourceid == vncKeyboardDev->id) { - XkbControlsPtr ctrls; + if (event->device_event.sourceid != vncKeyboardDev->id) { + dev->public.processInputProc(event, dev); + return; + } - /* - * We need to bypass AccessX since it is timing sensitive and - * the network can cause fake event delays. - */ - ctrls = dev->key->xkbInfo->desc->ctrls; - backupctrls = ctrls->enabled_ctrls; - ctrls->enabled_ctrls &= ~XkbAllFilteredEventsMask; + /* + * We need to bypass AccessX since it is timing sensitive and + * the network can cause fake event delays. + */ + ctrls = dev->key->xkbInfo->desc->ctrls; + backupctrls = ctrls->enabled_ctrls; + ctrls->enabled_ctrls &= ~XkbAllFilteredEventsMask; - /* - * This flag needs to be set for key repeats to be properly - * respected. - */ - if ((event->device_event.type == ET_KeyPress) && - key_is_down(dev, event->device_event.detail.key, KEY_PROCESSED)) - event->device_event.key_repeat = TRUE; - } + /* + * This flag needs to be set for key repeats to be properly + * respected. + */ + if ((event->device_event.type == ET_KeyPress) && + key_is_down(dev, event->device_event.detail.key, KEY_PROCESSED)) + event->device_event.key_repeat = TRUE; dev->public.processInputProc(event, dev); - if (event->device_event.sourceid == vncKeyboardDev->id) { - XkbControlsPtr ctrls; - - ctrls = dev->key->xkbInfo->desc->ctrls; - ctrls->enabled_ctrls = backupctrls; - } + ctrls->enabled_ctrls = backupctrls; } #endif /* XORG >= 117 */ -- 2.39.5