From b4995f979d127cea667b4e2b71c91e9db4ab52ef Mon Sep 17 00:00:00 2001 From: maxim nikonov Date: Fri, 6 Feb 2026 18:12:40 +0500 Subject: wip --- src/Fl_Screen_Driver.cxx | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/Fl_Screen_Driver.cxx') diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx index 3a25f6ec7..a091cea62 100644 --- a/src/Fl_Screen_Driver.cxx +++ b/src/Fl_Screen_Driver.cxx @@ -145,7 +145,8 @@ int Fl_Screen_Driver::screen_num(int x, int y) int screen = 0; if (num_screens < 0) init(); - for (int i = 0; i < num_screens; i ++) { + int i; + for (i = 0; i < num_screens; i ++) { int sx, sy, sw, sh; screen_xywh(sx, sy, sw, sh, i); if ((x >= sx) && (x < (sx+sw)) && (y >= sy) && (y < (sy+sh))) { @@ -176,7 +177,8 @@ int Fl_Screen_Driver::screen_num(int x, int y, int w, int h) int best_screen = 0; float best_intersection = 0.; if (num_screens < 0) init(); - for (int i = 0; i < num_screens; i++) { + int i; + for (i = 0; i < num_screens; i++) { int sx = 0, sy = 0, sw = 0, sh = 0; screen_xywh(sx, sy, sw, sh, i); float sintersection = fl_intersection(x, y, w, h, sx, sy, sw, sh); @@ -234,10 +236,12 @@ Image depths can differ between "to" and "from". uchar *tobytes = (uchar*)to->array + to_y * to_ld + to_x * to->d(); const uchar *frombytes = from->array; int need_alpha = (from->d() == 3 && to->d() == 4); - for (int i = 0; i < from->h(); i++) { + int i; + for (i = 0; i < from->h(); i++) { if (from->d() == to->d()) memcpy(tobytes, frombytes, from->w() * from->d()); else { - for (int j = 0; j < from->w(); j++) { + int j; + for (j = 0; j < from->w(); j++) { memcpy(tobytes + j * to->d(), frombytes + j * from->d(), from->d()); if (need_alpha) *(tobytes + j * to->d() + 3) = 0xff; } @@ -281,7 +285,8 @@ Fl_RGB_Image *Fl_Screen_Driver::traverse_to_gl_subwindows(Fl_Group *g, int x, in if (!full_img) return NULL; float full_img_scale = (full_img && w > 0 ? float(full_img->data_w())/w : 1); int n = (captured_subwin ? 0 : g->children()); - for (int i = 0; i < n; i++) { + int i; + for (i = 0; i < n; i++) { Fl_Widget *c = g->child(i); if ( !c->visible() || !c->as_group()) continue; if ( c->as_window() ) { @@ -564,7 +569,8 @@ int Fl_Screen_Driver::scale_handler(int event) if (f == old_f) return 1; if (screen_dr->rescalable() == SYSTEMWIDE_APP_SCALING) { float old_f = screen_dr->scale(0); - for (int i = 0; i < Fl::screen_count(); i++) { + int i; + for (i = 0; i < Fl::screen_count(); i++) { screen_dr->rescale_all_windows_from_screen(i, f * initial_scale, old_f); } } else { @@ -587,11 +593,12 @@ void Fl_Screen_Driver::use_startup_scale_factor() if ((p = fl_getenv("FLTK_SCALING_FACTOR"))) { float factor = 1; sscanf(p, "%f", &factor); + int i; if (rescalable() == SYSTEMWIDE_APP_SCALING) { float new_val = factor * scale(0); - for (int i = 0; i < s_count; i++) scale(i, new_val); + for (i = 0; i < s_count; i++) scale(i, new_val); } else { - for (int i = 0; i < s_count; i++) scale(i, factor * scale(i)); + for (i = 0; i < s_count; i++) scale(i, factor * scale(i)); } } } -- cgit v1.2.3