summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2019-08-04 13:42:54 (GMT)
committerfvogel <fvogelnew1@free.fr>2019-08-04 13:42:54 (GMT)
commit7299fbfe28c6d480a6227ec9a56a0cd5b83d4189 (patch)
tree36d664098c2c1648aa798ff881b6dbca3c420867 /generic
parent32fbb2c92c0ec4ff085e02de627fc0426638ec17 (diff)
downloadtk-7299fbfe28c6d480a6227ec9a56a0cd5b83d4189.zip
tk-7299fbfe28c6d480a6227ec9a56a0cd5b83d4189.tar.gz
tk-7299fbfe28c6d480a6227ec9a56a0cd5b83d4189.tar.bz2
Cherrypicked [3b3c3b02]: Remove the crazy function UpdateButtonEventState which was causing trouble.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkEvent.c67
-rw-r--r--generic/tkInt.h2
2 files changed, 1 insertions, 68 deletions
diff --git a/generic/tkEvent.c b/generic/tkEvent.c
index 891f667..69c19ed 100644
--- a/generic/tkEvent.c
+++ b/generic/tkEvent.c
@@ -559,71 +559,6 @@ GetButtonMask(
/*
*----------------------------------------------------------------------
*
- * UpdateButtonEventState --
- *
- * Update the button event state in our TkDisplay using the XEvent
- * passed. We also may modify the the XEvent passed to fit some aspects
- * of our TkDisplay.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The TkDisplay's private button state may be modified. The eventPtr's
- * state may be updated to reflect masks stored in our TkDisplay that the
- * event doesn't contain. The eventPtr may also be modified to not
- * contain a button state for the window in which it was not pressed in.
- *
- *----------------------------------------------------------------------
- */
-
-static void
-UpdateButtonEventState(
- XEvent *eventPtr)
-{
- TkDisplay *dispPtr;
- int allButtonsMask = Button1Mask | Button2Mask | Button3Mask
- | Button4Mask | Button5Mask;
-
- switch (eventPtr->type) {
- case ButtonPress:
- dispPtr = TkGetDisplay(eventPtr->xbutton.display);
- dispPtr->mouseButtonWindow = eventPtr->xbutton.window;
- eventPtr->xbutton.state |= dispPtr->mouseButtonState;
-
- dispPtr->mouseButtonState |= GetButtonMask(eventPtr->xbutton.button);
- break;
-
- case ButtonRelease:
- dispPtr = TkGetDisplay(eventPtr->xbutton.display);
- dispPtr->mouseButtonWindow = None;
- dispPtr->mouseButtonState &= ~GetButtonMask(eventPtr->xbutton.button);
- eventPtr->xbutton.state |= dispPtr->mouseButtonState;
- break;
-
- case MotionNotify:
- dispPtr = TkGetDisplay(eventPtr->xmotion.display);
- if (dispPtr->mouseButtonState & allButtonsMask) {
- if (eventPtr->xbutton.window != dispPtr->mouseButtonWindow) {
- /*
- * This motion event should not be interpreted as a button
- * press + motion event since this is not the same window the
- * button was pressed down in.
- */
-
- dispPtr->mouseButtonState &= ~allButtonsMask;
- dispPtr->mouseButtonWindow = None;
- } else {
- eventPtr->xmotion.state |= dispPtr->mouseButtonState;
- }
- }
- break;
- }
-}
-
-/*
- *----------------------------------------------------------------------
- *
* InvokeClientMessageHandlers --
*
* Iterate the list of handlers and invoke the function pointer for each.
@@ -1220,8 +1155,6 @@ Tk_HandleEvent(
ThreadSpecificData *tsdPtr =
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- UpdateButtonEventState(eventPtr);
-
/*
* If the generic handler processed this event we are done and can return.
*/
diff --git a/generic/tkInt.h b/generic/tkInt.h
index 199641d..18a20c1 100644
--- a/generic/tkInt.h
+++ b/generic/tkInt.h
@@ -513,7 +513,7 @@ typedef struct TkDisplay {
*/
int mouseButtonState; /* Current mouse button state for this
- * display. */
+ * display. NOT USED as of 8.6.10 */
Window mouseButtonWindow; /* Window the button state was set in, added
* in Tk 8.4. */
Tk_Window warpWindow;