diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2020-01-14 20:49:02 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2020-01-14 20:49:02 +0000 |
commit | 332defa5d8762e8c04e4e707c08ae3893173581f (patch) | |
tree | 3d1096bd168085fd8eac02831142c2466f9b2d26 /lib/libXt/src/Keyboard.c | |
parent | c6b1589c2baee04df73cce89e6ffdaabe9a91a87 (diff) |
Update to libXt 1.2.0. Tested by tb@
Diffstat (limited to 'lib/libXt/src/Keyboard.c')
-rw-r--r-- | lib/libXt/src/Keyboard.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/lib/libXt/src/Keyboard.c b/lib/libXt/src/Keyboard.c index c8ba863ba..7697275d0 100644 --- a/lib/libXt/src/Keyboard.c +++ b/lib/libXt/src/Keyboard.c @@ -104,12 +104,12 @@ static XtServerGrabPtr CheckServerGrabs( Widget *trace, Cardinal traceDepth) { - XtServerGrabPtr grab; Cardinal i; for (i = traceDepth; i > 0; i--) { - if ((grab = _XtCheckServerGrabsOnWidget(event, trace[i-1], KEYBOARD))) + XtServerGrabPtr grab; + if ((grab = _XtCheckServerGrabsOnWidget(event, trace[i-1], KEYBOARD))) return (grab); } return (XtServerGrabPtr)0; @@ -241,10 +241,10 @@ static Boolean IsOutside( */ XtTranslateCoords(w, 0, 0, &left, &top); /* We need to take borders into consideration */ - left = left - w->core.border_width; - top = top - w->core.border_width; - right = left + w->core.width + w->core.border_width; - bottom = top + w->core.height + w->core.border_width; + left = (Position) (left - w->core.border_width); + top = (Position) (top - w->core.border_width); + right = (Position) (left + w->core.width + w->core.border_width); + bottom = (Position) (top + w->core.height + w->core.border_width); if ( (e->x_root < left) || (e->y_root < top) || @@ -331,7 +331,6 @@ static Widget FindKeyDestination( { XtUngrabKeyboard(devGrab->widget, event->time); - devGrabType = XtNoServerGrab; } /* * if there isn't a grab with then check @@ -367,12 +366,12 @@ static Widget FindKeyDestination( } if ((grab = CheckServerGrabs((XEvent*)event, pseudoTrace, - pseudoTraceDepth))) + (Cardinal)pseudoTraceDepth))) { XtDevice device = &pdi->keyboard; device->grabType = XtPseudoPassiveServerGrab; - pdi->activatingKey = event->keycode; + pdi->activatingKey = (KeyCode) event->keycode; device->grab = *grab; if (grab @@ -395,7 +394,7 @@ Widget _XtProcessKeyboardEvent( XtPerDisplayInput pdi) { XtDevice device = &pdi->keyboard; - XtServerGrabPtr newGrab, devGrab = &device->grab; + XtServerGrabPtr devGrab = &device->grab; XtServerGrabRec prevGrabRec; XtServerGrabType prevGrabType = device->grabType; Widget dspWidget = NULL; @@ -407,11 +406,13 @@ Widget _XtProcessKeyboardEvent( { case KeyPress: { + XtServerGrabPtr newGrab; + if (event->keycode != 0 && /* Xlib XIM composed input */ !IsServerGrab(device->grabType) && (newGrab = CheckServerGrabs((XEvent*)event, pdi->trace, - pdi->traceDepth))) + (Cardinal) pdi->traceDepth))) { /* * honor pseudo-grab from prior event by X @@ -424,7 +425,7 @@ Widget _XtProcessKeyboardEvent( { /* Activate the grab */ device->grab = *newGrab; - pdi->activatingKey = event->keycode; + pdi->activatingKey = (KeyCode) event->keycode; device->grabType = XtPassiveServerGrab; } } @@ -574,9 +575,7 @@ void _XtHandleFocus( newFocalPoint = XtUnrelated; break; case NotifyInferior: - newFocalPoint = XtMyDescendant; return; - break; } break; } |