diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-07-27 17:04:16 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-07-27 17:04:27 +0200 |
| commit | b40e218c01497b529dea7f35a734e28e4f26049d (patch) | |
| tree | d96b19112e2e01c2b534b61b58db5ac260031fcd | |
| parent | e3270a6032960c00a667d47f426a1e046a4da847 (diff) | |
Fix for "Crashing regression in MacOS code" in fltk.coredev.
| -rw-r--r-- | src/Fl_cocoa.mm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 3aeea9e9c..934dd2f78 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -3186,15 +3186,17 @@ void Fl_Cocoa_Window_Driver::fullscreen_off(int X, int Y, int W, int H) { NSInteger level = NSNormalWindowLevel; if (pWindow->modal()) level = modal_window_level(); else if (pWindow->non_modal()) level = non_modal_window_level(); + /* Hide (orderOut) and later show (orderFront) the window to avoid a crash that + occurs in a very specific situation: the dock is at bottom and + H is larger than the maximum value for the display. + See "Crashing regression in MacOS code" in fltk.coredev. + */ + [nswin orderOut:nil]; [nswin setLevel:level]; [nswin setStyleMask:calc_win_style(pWindow)]; //10.6 restore_window_title_and_icon(pWindow, icon_image); pWindow->resize(X, Y, W, H); - // at least under macOS 10.15.5-6, NSViewFrameDidChangeNotification is not sent - // if the dock is at bottom (but is sent if the dock is at left!) - NSNotification *notif = [NSNotification notificationWithName:NSViewFrameDidChangeNotification - object:[nswin contentView]]; - [[FLWindowDelegate singleInstance] view_did_resize:notif]; + [nswin orderFront:nil]; } else #endif { |
