summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-07-24 18:41:44 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-07-24 18:41:53 +0200
commit5839817c51f819ba39ee67c315bcc49f25770e79 (patch)
tree3b176f5311348098db836bfa23bce8c33ed7ea3d
parent118c67c8043374e36e4c3c4e9ace94fab16483ed (diff)
Fix problem when calling Fl_Window::fullscreen_off() in certain circumstances.
The problem was discovered in fltk.coredev "Crashing regression in MacOS code"
-rw-r--r--src/Fl_cocoa.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index efbccc820..3aeea9e9c 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -3190,6 +3190,11 @@ void Fl_Cocoa_Window_Driver::fullscreen_off(int X, int Y, int W, int H) {
[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];
} else
#endif
{