new event filtering mustn't apply to primitive dialogs

svn: r4625
This commit is contained in:
Matthew Flatt 2006-10-18 05:42:58 +00:00
parent a9ab05d0f5
commit 2ccf88b6db
2 changed files with 13 additions and 2 deletions

View File

@ -41,6 +41,8 @@ static void MrDequeue(MrQueueElem *q);
WindowPtr MrEdMouseWindow(Point where);
WindowPtr MrEdKeyWindow();
int wx_leave_all_input_alone;
extern int wxTranslateRawKey(int key);
extern short wxMacDisableMods;
@ -342,6 +344,7 @@ void wxSmuggleOutEvent(EventRef ref)
UniChar *text;
UInt32 actualSize;
EventRef kref;
UInt32 val = 0;
GetEventParameter(ref, kEventParamTextInputSendKeyboardEvent,
typeEventRef, NULL, sizeof(EventRef), NULL, &kref);
@ -392,6 +395,9 @@ static OSStatus smuggle_handler(EventHandlerCallRef inHandlerCallRef,
EventRef inEvent,
void *inUserData)
{
if (wx_leave_all_input_alone)
return eventNotHandledErr;
wxSmuggleOutEvent(inEvent);
return noErr;
}

View File

@ -1385,10 +1385,13 @@ void wxApp::DoDefaultAboutItem(void)
//-----------------------------------------------------------------------------
extern int wx_leave_all_input_alone;
void wxPrimDialogSetUp()
{
wxUnhideCursor();
wxSetCursor(wxSTANDARD_CURSOR);
wx_leave_all_input_alone++;
}
void wxPrimDialogCleanUp()
@ -1396,6 +1399,8 @@ void wxPrimDialogCleanUp()
WindowPtr w;
EventRecord event;
--wx_leave_all_input_alone;
wxTheApp->AdjustCursor();
/* In case the front window wasn't active when we started: */