summaryrefslogtreecommitdiff
path: root/src/Fl_cocoa.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl_cocoa.mm')
-rw-r--r--src/Fl_cocoa.mm12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 9c91a79f8..1c10d659b 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -3085,11 +3085,13 @@ void Fl_Window::size_range_() {
}
}
-void Fl_X::do_wait_for_expose()
-{ // this will make freshly created windows appear on the screen
- [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:nil inMode:NSDefaultRunLoopMode dequeue:NO];
- if (fl_mac_os_version >= 101100) { // this extra message seems necessary with 10.11
- [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:nil inMode:NSDefaultRunLoopMode dequeue:NO];
+void Fl_Window::wait_for_expose()
+{
+ if (shown()) {
+ // this makes freshly created windows appear on the screen, if they are not there already
+ NSModalSession session = [NSApp beginModalSessionForWindow:i->xid];
+ [NSApp runModalSession:session];
+ [NSApp endModalSession:session];
}
}