aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Events.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-11-09 15:33:02 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2018-11-09 15:33:02 +0100
commitfccef5fc5794c3aab5c28dbe354c3dc3a86cc07b (patch)
tree2afaa1a03cf49ef01796a4013513f01bdaf58eca /nx-X11/programs/Xserver/hw/nxagent/Events.c
parent122db3fde2b934df206567abc0c8b431962ce4b3 (diff)
parent3965f24befb21f469b887d4c69b9defc861831fb (diff)
downloadnx-libs-fccef5fc5794c3aab5c28dbe354c3dc3a86cc07b.tar.gz
nx-libs-fccef5fc5794c3aab5c28dbe354c3dc3a86cc07b.tar.bz2
nx-libs-fccef5fc5794c3aab5c28dbe354c3dc3a86cc07b.zip
Merge branch 'uli42-pr/xkb_1.3.0.0' into 3.6.x
Attributes GH PR #717: https://github.com/ArcticaProject/nx-libs/pull/717
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Events.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c26
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