Skip to content

Commit

Permalink
X11: simplify the use of member function Fl_X11_Screen_Driver::init_w…
Browse files Browse the repository at this point in the history
…orkarea().

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13044 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Manolo Gouy authored and Manolo Gouy committed Sep 7, 2018
1 parent 3669f9a commit b6f65b1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/Fl_Screen_Driver.H
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion src/Fl_Screen_Driver.cxx
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Fl_x.cxx
Expand Up @@ -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) {
Expand Down
10 changes: 4 additions & 6 deletions src/drivers/X11/Fl_X11_Screen_Driver.cxx
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b6f65b1

Please sign in to comment.