diff options
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Events.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Events.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 94480c45c..5281b4b5c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -2782,7 +2782,8 @@ int nxagentHandleXkbKeyboardStateEvent(XEvent *X) { XkbEvent *xkbev = (XkbEvent *) X; - if (xkbev -> type == nxagentXkbInfo.EventBase + XkbEventCode && + if (nxagentXkbInfo.EventBase != -1 && + xkbev -> type == nxagentXkbInfo.EventBase + XkbEventCode && xkbev -> any.xkb_type == XkbStateNotify) { #ifdef TEST @@ -2890,9 +2891,21 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X) XFixesSelectionEvent *xfixesEvent = (XFixesSelectionEvent *) X; - if (nxagentXFixesInfo.Initialized == 0 || - xfixesEvent -> type != (nxagentXFixesInfo.EventBase + XFixesSelectionNotify)) - return 0; + if (nxagentXFixesInfo.Initialized == 0) + { + #ifdef DEBUG + fprintf(stderr, "nxagentHandleXFixesSelectionNotify: XFixes not initialized - doing nothing.\n"); + #endif + return 0; + } + + if (xfixesEvent -> type != (nxagentXFixesInfo.EventBase + XFixesSelectionNotify)) + { + #ifdef DEBUG + fprintf(stderr, "nxagentHandleXFixesSelectionNotify: event type is [%d] - doing nothing.\n", xfixesEvent->type); + #endif + return 0; + } #ifdef TEST fprintf(stderr, "nxagentHandleXFixesSelectionNotify: Handling event.\n"); @@ -3815,6 +3828,11 @@ int nxagentInitXkbKeyboardState(void) XkbEvent *xkbev = (XkbEvent *) &X; + if (nxagentXkbInfo.EventBase == -1) + { + return 1; + } + #ifdef TEST fprintf(stderr, "%s: Initializing XKB state.\n", __func__); #endif |