From 5e34b5264af9d5e8924c1e5376d6e13269e4a072 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 13 Jul 1999 05:36:27 +0000 Subject: [PATCH] Use [NSWindow worksWhenModal] git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4578 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSApplication.m | 25 +++++++++++++++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3857a8b5d..deec2e852 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Jul 13 6:44:00 1999 Richard Frith-Macdonald + + * Source/NSApplication.m: In ([-runModalSession:]) pay attention to + ([NSWindow worksWhenModal]). + 1999-07-12 Michael Hanni * Source/NSMenu.m: added code to convert anything that conforms to diff --git a/Source/NSApplication.m b/Source/NSApplication.m index bb0e872c5..cd1efe4f6 100644 --- a/Source/NSApplication.m +++ b/Source/NSApplication.m @@ -462,10 +462,15 @@ NSApplication *NSApp = nil; do { event = DPSGetEvent(ctxt, NSAnyEventMask, limit, NSDefaultRunLoopMode); - if (event != nil && [event window] == theSession->window) + if (event != nil) { - DPSPostEvent(ctxt, event, YES); - found = YES; + NSWindow *eventWindow = [event window]; + + if (eventWindow == theSession->window || [eventWindow worksWhenModal]) + { + DPSPostEvent(ctxt, event, YES); + found = YES; + } } } while (found == NO && theSession->runState == NSRunContinuesResponse); @@ -479,10 +484,18 @@ NSApplication *NSApp = nil; pool = [NSAutoreleasePool new]; event = DPSGetEvent(ctxt, NSAnyEventMask, limit, NSDefaultRunLoopMode); - if (event != nil && [event window] == theSession->window) + if (event != nil) { - ASSIGN(current_event, event); - found = YES; + NSWindow *eventWindow = [event window]; + + if (eventWindow == theSession->window || [eventWindow worksWhenModal]) + { + ASSIGN(current_event, event); + } + else + { + found = NO; + } } else {