]> git.zerfleddert.de Git - micropolis/commitdiff
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 fe5cc4e4fa81d81e6a8a85aac0aeaebe66ccf029..0bf8a3953c1db304b7a754b73028a2f251483cf8 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. */
     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
     };
     static unsigned int state[] = {
        Button1Mask, Button2Mask, Button3Mask, Button4Mask, Button5Mask
     };
index a5cc780015ccdaf908e48142e3566eb1a667441b..0083e51203e1ff6fd47bee5102745355130f3297 100644 (file)
@@ -41,6 +41,9 @@
 #define META_MASK      (AnyModifier<<1)
 #define ALT_MASK       (AnyModifier<<2)
 
 #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:
 /*
  * One of the following structures is maintained for each display
  * containing a window managed by Tk:
index 9b6e4b2eb9df337b9b0ebbf64aebb329a3609b8d..7ea2b22722649c4dab0f9e408e9175a3fa01734a 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->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));
        scalePtr->flags |= BUTTON_PRESSED;
        SetScaleValue(scalePtr, PixelToValue(scalePtr,
                eventPtr->xbutton.x, eventPtr->xbutton.y));
index 6cec27aa12f146ea0d2c66f217ad9dfac929e0fa..bb843bc31317b6b7d61fb867b85f8dc2ed54bffa 100644 (file)
@@ -974,7 +974,7 @@ ScrollbarMouseProc(clientData, eventPtr)
                    eventPtr->xmotion.y));
        }
     } else if ((eventPtr->type == ButtonPress)
                    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(
        scrollPtr->pressField = scrollPtr->mouseField;
        if (scrollPtr->pressField != SLIDER) {
            scrollPtr->autoRepeat = Tk_CreateTimerHandler(
Impressum, Datenschutz