From 12dedc26cdd98458204cc65e302caf2378c40bcb Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 8 May 2019 12:25:48 +0200 Subject: Adapt function fake_X_wm() to rescaled GUI. --- src/Fl_cocoa.mm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index d11b9d0ac..5cfd547de 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -1901,10 +1901,11 @@ static int fake_X_wm(Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by) { yoff = by + bt; dx = 2*bx; dy = 2*by + bt; - X = w->x()-xoff; - Y = w->y()-yoff; - W = w->w()+dx; - H = w->h()+dy; + float s = Fl::screen_driver()->scale(0); + X = w->x()*s-xoff; + Y = w->y()*s-yoff; + W = w->w()*s+dx; + H = w->h()*s+dy; if (w->parent()) return 0; @@ -1989,6 +1990,8 @@ static int fake_X_wm(Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by) { // Return the client area's top left corner in (X,Y) X+=xoff; Y+=yoff; + X /= s; + Y /= s; return ret; } -- cgit v1.2.3