Rewrite Fl_X11_Window_Driver::resize_after_screen_change() to call Fl_Window_Driver::resize_after_scale_change()

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12362 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2017-07-28 07:46:33 +00:00
parent bf033e7191
commit 60567b12ef
2 changed files with 2 additions and 12 deletions

View File

@ -269,8 +269,8 @@ void Fl_Window_Driver::resize_after_scale_change(int ns, float old_f, float new_
W = pWindow->w(); H = pWindow->h();
}
is_a_rescale = true;
pWindow->resize(pWindow->x()*old_f/new_f, pWindow->y()*old_f/new_f, W, H);
size_range();
pWindow->resize(pWindow->x()*old_f/new_f, pWindow->y()*old_f/new_f, W, H);
is_a_rescale = false;
}

View File

@ -696,18 +696,8 @@ Fl_X11_Window_Driver::type_for_resize_window_between_screens Fl_X11_Window_Drive
void Fl_X11_Window_Driver::resize_after_screen_change(void *data) {
Fl_Window *win = (Fl_Window*)data;
int oldx, oldy;
XWindowAttributes actual;
XGetWindowAttributes(fl_display, fl_xid(win), &actual);
Window cr;
XTranslateCoordinates(fl_display, fl_xid(win), actual.root, 0, 0, &oldx, &oldy, &cr);
float f = Fl::screen_driver()->scale(data_for_resize_window_between_screens_.screen);
Fl_X11_Window_Driver::driver(win)->screen_num(data_for_resize_window_between_screens_.screen);
Fl_Display_Device::display_device()->driver()->scale(f);
is_a_rescale = true;
win->driver()->size_range();
win->resize(oldx/f, oldy/f, win->w(), win->h());
is_a_rescale = false;
win->driver()->resize_after_scale_change(data_for_resize_window_between_screens_.screen, f, f);
data_for_resize_window_between_screens_.busy = false;
}