X11: simplify the use of member function Fl_X11_Screen_Driver::init_workarea().

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13044 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2018-09-07 09:24:35 +00:00
parent 3669f9a8cc
commit b6f65b1c87
4 changed files with 5 additions and 9 deletions

View File

@ -174,7 +174,6 @@ public:
void rescale_all_windows_from_screen(int screen, float f);
static void transient_scale_display(float f, int nscreen);
static int scale_handler(int event);
virtual void init_workarea() {}
virtual float desktop_scale_factor() {return 1;}
float use_startup_scale_factor();
enum APP_SCALING_CAPABILITY {

View File

@ -428,7 +428,6 @@ int Fl_Screen_Driver::scale_handler(int event)
if (f == old_f) return 1;
screen_dr->rescale_all_windows_from_screen(screen, f*initial_scale);
Fl_Screen_Driver::transient_scale_display(f, screen);
screen_dr->init_workarea();
Fl::handle(FL_ZOOM_EVENT, NULL);
return 1;
}

View File

@ -1302,7 +1302,7 @@ int fl_handle(const XEvent& thisevent)
#endif // USE_XRANDR
if (xevent.type == PropertyNotify && xevent.xproperty.atom == fl_NET_WORKAREA) {
Fl::screen_driver()->init_workarea();
((Fl_X11_Screen_Driver*)Fl::screen_driver())->init_workarea();
}
switch (xevent.type) {

View File

@ -212,8 +212,6 @@ static int fl_workarea_xywh[4] = { -1, -1, -1, -1 };
void Fl_X11_Screen_Driver::init_workarea()
{
if (!fl_display) open_display();
Atom actual;
unsigned long count, remaining;
int format;
@ -247,7 +245,7 @@ void Fl_X11_Screen_Driver::init_workarea()
int Fl_X11_Screen_Driver::x() {
if (fl_workarea_xywh[0] < 0) init_workarea();
if (!fl_display) open_display();
return fl_workarea_xywh[0]
#if USE_XFT
/ screens[0].scale
@ -256,7 +254,7 @@ int Fl_X11_Screen_Driver::x() {
}
int Fl_X11_Screen_Driver::y() {
if (fl_workarea_xywh[0] < 0) init_workarea();
if (!fl_display) open_display();
return fl_workarea_xywh[1]
#if USE_XFT
/ screens[0].scale
@ -265,7 +263,7 @@ int Fl_X11_Screen_Driver::y() {
}
int Fl_X11_Screen_Driver::w() {
if (fl_workarea_xywh[0] < 0) init_workarea();
if (!fl_display) open_display();
return fl_workarea_xywh[2]
#if USE_XFT
/ screens[0].scale
@ -274,7 +272,7 @@ int Fl_X11_Screen_Driver::w() {
}
int Fl_X11_Screen_Driver::h() {
if (fl_workarea_xywh[0] < 0) init_workarea();
if (!fl_display) open_display();
return fl_workarea_xywh[3]
#if USE_XFT
/ screens[0].scale