diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-23 21:18:58 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-23 21:18:58 (GMT) |
commit | e89ac98ff3acc055005af842978e6a38fc9b207a (patch) | |
tree | 15394e567a8d06a42f40d05f3f2bd000c933a68e /generic/tkTextTag.c | |
parent | 259182ceab7c7dda4a411f2fa1ea2475ad7e27d9 (diff) | |
parent | 64efa1daf6914fde585eed65c2ec0f5bf45f097b (diff) | |
download | tk-e89ac98ff3acc055005af842978e6a38fc9b207a.zip tk-e89ac98ff3acc055005af842978e6a38fc9b207a.tar.gz tk-e89ac98ff3acc055005af842978e6a38fc9b207a.tar.bz2 |
Merge 8.6
Diffstat (limited to 'generic/tkTextTag.c')
-rw-r--r-- | generic/tkTextTag.c | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index cb0993b..bda315e 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -1446,9 +1446,6 @@ TkTextBindProc( TkText *textPtr = clientData; int repick = 0; -# define AnyButtonMask \ - (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask) - textPtr->refCount++; /* @@ -1460,35 +1457,16 @@ TkTextBindProc( if (eventPtr->type == ButtonPress) { textPtr->flags |= BUTTON_DOWN; } else if (eventPtr->type == ButtonRelease) { - int mask; + unsigned int mask; - switch (eventPtr->xbutton.button) { - case Button1: - mask = Button1Mask; - break; - case Button2: - mask = Button2Mask; - break; - case Button3: - mask = Button3Mask; - break; - case Button4: - mask = Button4Mask; - break; - case Button5: - mask = Button5Mask; - break; - default: - mask = 0; - break; - } - if ((eventPtr->xbutton.state & AnyButtonMask) == (unsigned) mask) { + mask = TkGetButtonMask(eventPtr->xbutton.button); + if ((eventPtr->xbutton.state & ALL_BUTTONS) == mask) { textPtr->flags &= ~BUTTON_DOWN; repick = 1; } } else if ((eventPtr->type == EnterNotify) || (eventPtr->type == LeaveNotify)) { - if (eventPtr->xcrossing.state & AnyButtonMask) { + if (eventPtr->xcrossing.state & ALL_BUTTONS) { textPtr->flags |= BUTTON_DOWN; } else { textPtr->flags &= ~BUTTON_DOWN; @@ -1496,7 +1474,7 @@ TkTextBindProc( TkTextPickCurrent(textPtr, eventPtr); goto done; } else if (eventPtr->type == MotionNotify) { - if (eventPtr->xmotion.state & AnyButtonMask) { + if (eventPtr->xmotion.state & ALL_BUTTONS) { textPtr->flags |= BUTTON_DOWN; } else { textPtr->flags &= ~BUTTON_DOWN; @@ -1513,8 +1491,7 @@ TkTextBindProc( unsigned int oldState; oldState = eventPtr->xbutton.state; - eventPtr->xbutton.state &= ~(Button1Mask|Button2Mask - |Button3Mask|Button4Mask|Button5Mask); + eventPtr->xbutton.state &= ~ALL_BUTTONS; if (!(textPtr->flags & DESTROYED)) { TkTextPickCurrent(textPtr, eventPtr); } |