Skip to content

Commit

Permalink
Fix issue when moving window between retina/non-retina screens while …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Manolo Gouy authored and Manolo Gouy committed Oct 30, 2018
1 parent d65a5a0 commit 9e20113
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Fl_cocoa.mm
Expand Up @@ -1251,13 +1251,15 @@ - (void)windowDidMove:(NSNotification *)notif
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
Expand Down Expand Up @@ -1289,7 +1291,9 @@ - (void)windowDidResize:(NSNotification *)notif
[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
Expand Down

0 comments on commit 9e20113

Please sign in to comment.