Skip to content

Commit

Permalink
Avoid repetitive calls to Fl_Screen_Driver::screen_count()
Browse files Browse the repository at this point in the history
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12942 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Manolo Gouy authored and Manolo Gouy committed Jun 15, 2018
1 parent 793a66a commit 34990a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Fl_Screen_Driver.cxx
Expand Up @@ -451,10 +451,10 @@ void Fl_Screen_Driver::open_display()
static bool been_here = false;
if (!been_here) {
been_here = true;
screen_count(); // initialize, but ignore return value
int scount = screen_count(); // keep here
if (rescalable()) {
float factor = use_startup_scale_factor();
if (factor) for (int i = 0; i < screen_count(); i++) scale(i, factor);
if (factor) for (int i = 0; i < scount; i++) scale(i, factor);
Fl::add_handler(Fl_Screen_Driver::scale_handler);
int mx, my;
int ns = Fl::screen_driver()->get_mouse(mx, my);
Expand Down

0 comments on commit 34990a9

Please sign in to comment.