diff options
| author | Manolo Gouy <Manolo> | 2018-10-30 08:12:03 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-10-30 08:12:03 +0000 |
| commit | 9e2011375763cfeda1fd17c5c9f9467420f66f78 (patch) | |
| tree | be7b76e47e08a64064ee4b3517654907ae56b8ec | |
| parent | d65a5a073c8bed0e742925a58997c832d5431011 (diff) | |
Fix issue when moving window between retina/non-retina screens while window is under progressive redraw.
The problem was visible with test/mandelbrot and with layer-backed views.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13100 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl_cocoa.mm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 3fe050188..e0b787c10 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1251,13 +1251,15 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; if (fl_mac_os_version < 101000) [nsw recursivelySendToSubwindows:@selector(setSubwindowFrame)]; [nsw checkSubwindowFrame]; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 - if (views_use_CA && [(FLView*)[nsw contentView] did_view_resolution_change]) { + FLView *view = (FLView*)[nsw contentView]; + if (views_use_CA && [view did_view_resolution_change]) { if (!window->as_gl_window()) { // move layered non-GL window to different resolution - [(FLView*)[nsw contentView] viewFrameDidChange]; + [view viewFrameDidChange]; + [view displayLayer:[view layer]]; // useful for Mandelbrot to recreate the layer's bitmap } if (fl_mac_os_version < 101401 && window->parent() && window->as_gl_window() && Fl::use_high_res_GL()) { Fl_Cocoa_Window_Driver *d = Fl_Cocoa_Window_Driver::driver(window); - [[nsw contentView] layer].contentsScale = d->mapped_to_retina() ? 2. : 1.; + [view layer].contentsScale = d->mapped_to_retina() ? 2. : 1.; } } #endif @@ -1289,7 +1291,9 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; [nsw recursivelySendToSubwindows:@selector(setSubwindowFrame)]; [nsw recursivelySendToSubwindows:@selector(checkSubwindowFrame)]; if (window->as_gl_window() && Fl_X::i(window)) d->in_windowDidResize(false); - if ([[nsw contentView] layer]) [(FLView*)[nsw contentView] viewFrameDidChange]; +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 + if (views_use_CA && [[nsw contentView] layer]) [(FLView*)[nsw contentView] viewFrameDidChange]; +#endif fl_unlock_function(); } - (void)windowDidResignKey:(NSNotification *)notif |
