still more NumLock fixes, this time for scrollbars and sliders
authorMichael Gernoth <michael@gernoth.net>
Sat, 26 Jan 2008 18:55:51 +0000 (19:55 +0100)
committerMichael Gernoth <michael@gernoth.net>
Sat, 26 Jan 2008 18:55:51 +0000 (19:55 +0100)
src/tk/tkgrab.c
src/tk/tkint.h
src/tk/tkscale.c
src/tk/tkscrbar.c

index fe5cc4e..0bf8a39 100644 (file)
@@ -498,8 +498,6 @@ TkPointerEvent(eventPtr, winPtr)
     int appGrabbed = 0;                        /* Non-zero means event is being
                                         * reported to an application that is
                                         * affected by the grab. */
-#define ALL_BUTTONS \
-       (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask)
     static unsigned int state[] = {
        Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask
     };
index a5cc780..0083e51 100644 (file)
@@ -41,6 +41,9 @@
 #define META_MASK      (AnyModifier<<1)
 #define ALT_MASK       (AnyModifier<<2)
 
+#define ALL_BUTTONS \
+       (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask)
+
 /*
  * One of the following structures is maintained for each display
  * containing a window managed by Tk:
index 9b6e4b2..7ea2b22 100644 (file)
@@ -1317,7 +1317,7 @@ ScaleMouseProc(clientData, eventPtr)
                eventPtr->xmotion.x, eventPtr->xmotion.y));
     } else if ((eventPtr->type == ButtonPress)
 /*         && (eventPtr->xbutton.button == Button1) */
-           && (eventPtr->xbutton.state == 0)) {
+           && ((eventPtr->xbutton.state & ALL_BUTTONS) == 0)) {
        scalePtr->flags |= BUTTON_PRESSED;
        SetScaleValue(scalePtr, PixelToValue(scalePtr,
                eventPtr->xbutton.x, eventPtr->xbutton.y));
index 6cec27a..bb843bc 100644 (file)
@@ -974,7 +974,7 @@ ScrollbarMouseProc(clientData, eventPtr)
                    eventPtr->xmotion.y));
        }
     } else if ((eventPtr->type == ButtonPress)
-           && (eventPtr->xbutton.state == 0)) {
+           && ((eventPtr->xbutton.state & ALL_BUTTONS) == 0)) {
        scrollPtr->pressField = scrollPtr->mouseField;
        if (scrollPtr->pressField != SLIDER) {
            scrollPtr->autoRepeat = Tk_CreateTimerHandler(
Impressum, Datenschutz