From 2ccf88b6db0b3429cd18f17d027ad21fb36e6b1d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 18 Oct 2006 05:42:58 +0000 Subject: [PATCH] new event filtering mustn't apply to primitive dialogs svn: r4625 --- src/mred/mredmac.cxx | 10 ++++++++-- src/wxmac/src/mac/wx_app.cc | 5 +++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/mred/mredmac.cxx b/src/mred/mredmac.cxx index da087d599f..20d5bc6e1b 100644 --- a/src/mred/mredmac.cxx +++ b/src/mred/mredmac.cxx @@ -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); @@ -389,9 +392,12 @@ static OSStatus unhide_cursor_handler(EventHandlerCallRef inHandlerCallRef, } static OSStatus smuggle_handler(EventHandlerCallRef inHandlerCallRef, - EventRef inEvent, - void *inUserData) + EventRef inEvent, + void *inUserData) { + if (wx_leave_all_input_alone) + return eventNotHandledErr; + wxSmuggleOutEvent(inEvent); return noErr; } diff --git a/src/wxmac/src/mac/wx_app.cc b/src/wxmac/src/mac/wx_app.cc index 595d4767d0..df9f7466b8 100644 --- a/src/wxmac/src/mac/wx_app.cc +++ b/src/wxmac/src/mac/wx_app.cc @@ -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: */