mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Got rid of the whole event filtering mess again, I can't get it to work. Simply disabling the Tk event handling hook in _tkinter is not as nice, but at least it works.
This commit is contained in:
parent
ddc4fd03b1
commit
e9bcb5c766
1 changed files with 1 additions and 23 deletions
|
@ -82,24 +82,6 @@ static void InitNotifier _ANSI_ARGS_((void));
|
|||
static void NotifierExitHandler _ANSI_ARGS_((
|
||||
ClientData clientData));
|
||||
|
||||
/*
|
||||
** Routine to determine whether Tk is the "main event handler" at the moment or
|
||||
** something else (MacPython, IDE) is.
|
||||
** Currently we only check that the frontmost window is Tk based, it may be better
|
||||
** to also check whether we're inside a Tk mainloop().
|
||||
*/
|
||||
static int
|
||||
TkIsTheBoss(void)
|
||||
{
|
||||
WindowRef windowRef;
|
||||
|
||||
windowRef = FrontWindow();
|
||||
if ( !windowRef )
|
||||
return 0;
|
||||
if ( TkMacGetXWindow(windowRef) )
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
|
@ -174,8 +156,6 @@ HandleMacEvents(void)
|
|||
WindowRef windowRef;
|
||||
Rect mouseRect;
|
||||
|
||||
if ( !TkIsTheBoss() )
|
||||
return 0;
|
||||
/*
|
||||
* Check for mouse moved events. These events aren't placed on the
|
||||
* system event queue unless we call WaitNextEvent.
|
||||
|
@ -211,13 +191,11 @@ HandleMacEvents(void)
|
|||
*/
|
||||
|
||||
while (needsUpdate || (GetEvQHdr()->qHead != NULL)) {
|
||||
/* Give Python command-. handling a chance */
|
||||
PyMac_DoYield(0, 0);
|
||||
|
||||
GetGlobalMouse(¤tMouse);
|
||||
SetRect(&mouseRect, currentMouse.h, currentMouse.v,
|
||||
currentMouse.h + 1, currentMouse.v + 1);
|
||||
RectRgn(notifier.utilityRgn, &mouseRect);
|
||||
|
||||
WaitNextEvent(everyEvent, &theEvent, 5, notifier.utilityRgn);
|
||||
needsUpdate = 0;
|
||||
if ((notifier.eventProcPtr != NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue