diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-07-02 17:16:39 -0700 |
---|---|---|
committer | Jim Grandy <jgrandy@authentic8.com> | 2013-08-22 12:49:40 -0700 |
commit | 112f6803189adb7b39364f60a21e6abf8050c46e (patch) | |
tree | df03e5e2fdf0f85a94edf94cb93c8cc6f98ebd5c | |
parent | 2036010e0c5f382dddad6a9760dfc6f7890b898c (diff) | |
download | xrdp-proprietary-112f6803189adb7b39364f60a21e6abf8050c46e.tar.gz xrdp-proprietary-112f6803189adb7b39364f60a21e6abf8050c46e.zip |
Hand-apply patches (keyboard autorepeat) from Authentic8 branch: b5b58fcbbd9eb57ff1ff4b8df8f4426c1c2881fb
-rw-r--r-- | xorg/X11R7.6/rdp/rdpinput.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/xorg/X11R7.6/rdp/rdpinput.c b/xorg/X11R7.6/rdp/rdpinput.c index 9fa7fa0a..5cef9458 100644 --- a/xorg/X11R7.6/rdp/rdpinput.c +++ b/xorg/X11R7.6/rdp/rdpinput.c @@ -58,6 +58,7 @@ static int g_tab_down = 0; /* this is toggled every time num lock key is released, not like the above *_down vars */ static int g_scroll_lock_down = 0; +static OsTimerPtr g_kbtimer = 0; #define MIN_KEY_CODE 8 #define MAX_KEY_CODE 255 @@ -315,10 +316,57 @@ rdpBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls) } /******************************************************************************/ +static CARD32 +rdpInDeferredUpdateCallback(OsTimerPtr timer, CARD32 now, pointer arg) +{ + //ErrorF("rdpInDeferredUpdateCallback:\n"); + + /* our keyboard device */ + XkbSetRepeatKeys(g_keyboard, -1, AutoRepeatModeOff); + /* the main one for the server */ + XkbSetRepeatKeys(inputInfo.keyboard, -1, AutoRepeatModeOff); + + return 0; +} + +/******************************************************************************/ void rdpChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl) { + XkbControlsPtr ctrls; + ErrorF("rdpChangeKeyboardControl:\n"); + ctrls = 0; + if (pDev != 0) + { + if (pDev->key != 0) + { + if (pDev->key->xkbInfo != 0) + { + if (pDev->key->xkbInfo->desc != 0) + { + if (pDev->key->xkbInfo->desc->ctrls != 0) + { + ctrls = pDev->key->xkbInfo->desc->ctrls; + } + } + } + } + } + if (ctrls != 0) + { + if (ctrls->enabled_ctrls & XkbRepeatKeysMask) + { + //ErrorF("rdpChangeKeyboardControl: autoRepeat on\n"); + /* schedual to turn off the autorepeat after 100 ms so any app + * polling it will be happy it's on */ + g_kbtimer = TimerSet(g_kbtimer, 0, 100, rdpInDeferredUpdateCallback, 0);\ + } + else + { + //ErrorF("rdpChangeKeyboardControl: autoRepeat off\n"); + } + } } /******************************************************************************/ |