From 31848b8565a4bd37c2918317e7bbc5ed1067e4b9 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 20 Feb 2018 12:09:32 +0000 Subject: MacOS: correct handling of window tabbing/untabbing together with GUI rescaling. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12681 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 12e9a7bd9..da0ccb14d 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1311,7 +1311,7 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; { FLWindow *nsw = (FLWindow*)[notif object]; Fl_Window *window = [nsw getFl_Window]; - if (abs([[nsw contentView] frame].size.height - window->h() * fl_graphics_driver->scale()) > 0.5) { + if (fabs([[nsw contentView] frame].size.height - window->h() * fl_graphics_driver->scale()) > 5.) { // the contentView, but not the window frame, is resized. This happens with tabbed windows. [self windowDidResize:notif]; return; @@ -2308,10 +2308,11 @@ static FLTextInputContext* fltextinputcontext_instance = nil; fl_lock_function(); FLWindow *cw = (FLWindow*)[self window]; Fl_Window *window = [cw getFl_Window]; - if ( !window->parent() && window->border() && abs(rect.size.height - window->h() * fl_graphics_driver->scale()) > 0.5 ) { // this happens with tabbed window - window->resize([cw frame].origin.x/fl_graphics_driver->scale(), - (main_screen_height - ([cw frame].origin.y + rect.size.height))/fl_graphics_driver->scale(), - rect.size.width/fl_graphics_driver->scale(), rect.size.height/fl_graphics_driver->scale()); + float s = fl_graphics_driver->scale(); + if ( !window->parent() && window->border() && fabs(rect.size.height - window->h() * s) > 5. ) { // this happens with tabbed windows + window->resize([cw frame].origin.x/s, + (main_screen_height - ([cw frame].origin.y + rect.size.height))/s, + rect.size.width/s, rect.size.height/s); } through_drawRect = YES; Fl_Cocoa_Window_Driver *d = Fl_Cocoa_Window_Driver::driver(window); -- cgit v1.2.3