summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2018-02-20 12:09:32 +0000
committerManolo Gouy <Manolo>2018-02-20 12:09:32 +0000
commit31848b8565a4bd37c2918317e7bbc5ed1067e4b9 (patch)
treeb8c40e4c06cf57b3fb1e11378059719716335beb
parent06b925964d7f2c493415670d413dd682920cf7ad (diff)
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
-rw-r--r--src/Fl_cocoa.mm11
1 files changed, 6 insertions, 5 deletions
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);