From 61eb23a9ea106e82e3fd0649e68859cb6e950e0f Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Mon, 29 Oct 2018 15:30:44 +0000 Subject: Fix handling of GL window moved between retina and non-retina screens. Part of the fix applies both to layer-backed and non layer-backed windows. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13090 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Gl_Window.cxx | 1 + src/Fl_cocoa.mm | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index 7d4ad1a3f..2835f129d 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -558,6 +558,7 @@ void Fl_Cocoa_Gl_Window_Driver::make_current_before() { if (d->changed_resolution()){ d->changed_resolution(false); invalidate(); + pWindow->valid(0); GLcontext_update(pWindow->context()); } } diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 759da3411..e1f5d44be 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1252,9 +1252,9 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; [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]) { - if (window->as_gl_window()) { // move layered GL window to different resolution - window->as_gl_window()->valid(0); - } else [(FLView*)[nsw contentView] viewFrameDidChange]; + if (!window->as_gl_window()) { // move layered non-GL window to different resolution + [(FLView*)[nsw contentView] viewFrameDidChange]; + } if (window->parent()) { [nsw setSubwindowFrame]; [[nsw contentView] display]; -- cgit v1.2.3