diff --git a/awesome.c b/awesome.c index d2ca3643..0c8f79cb 100644 --- a/awesome.c +++ b/awesome.c @@ -292,7 +292,7 @@ main(int argc, char *argv[]) scan(); /* for each virtual screen */ - for(screen = 0; screen < globalconf.nscreens; screen++) + for(screen = 0; screen < globalconf.nscreen; screen++) setup(screen); /* do this only for real screen */ diff --git a/config.c b/config.c index 5f69f072..b9edaaa1 100644 --- a/config.c +++ b/config.c @@ -732,7 +732,7 @@ config_parse(const char *confpatharg) } /* get the right screen section */ - for(screen = 0; screen < globalconf.nscreens; screen++) + for(screen = 0; screen < globalconf.nscreen; screen++) config_parse_screen(cfg, screen); /* get general sections */ @@ -754,7 +754,7 @@ config_parse(const char *confpatharg) rule->isfloating = rules_get_float_from_str(cfg_getstr(cfgsectmp, "float")); rule->screen = cfg_getint(cfgsectmp, "screen"); rule->not_master = cfg_getbool(cfgsectmp, "not_master"); - if(rule->screen >= globalconf.nscreens) + if(rule->screen >= globalconf.nscreen) rule->screen = 0; rule_list_push(&globalconf.rules, rule); diff --git a/event.c b/event.c index 01e7a3f4..1b7ba4c5 100644 --- a/event.c +++ b/event.c @@ -70,7 +70,7 @@ handle_event_buttonpress(XEvent *e) Statusbar *statusbar; XButtonPressedEvent *ev = &e->xbutton; - for(screen = 0; screen < globalconf.nscreens; screen++) + for(screen = 0; screen < globalconf.nscreen; screen++) for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next) if(statusbar->sw->window == ev->window || statusbar->sw->window == ev->subwindow) switch(statusbar->position) @@ -257,7 +257,7 @@ handle_event_expose(XEvent *e) Statusbar *statusbar; if(!ev->count) - for(screen = 0; screen < globalconf.nscreens; screen++) + for(screen = 0; screen < globalconf.nscreen; screen++) for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next) if(statusbar->sw->window == ev->window) { diff --git a/layout.c b/layout.c index 10cdf94c..c462cb2b 100644 --- a/layout.c +++ b/layout.c @@ -99,7 +99,7 @@ layout_refresh(void) int screen; Bool arranged = False; - for(screen = 0; screen < globalconf.nscreens; screen++) + for(screen = 0; screen < globalconf.nscreen; screen++) if(globalconf.screens[screen].need_arrange) { arrange(screen); diff --git a/screen.c b/screen.c index c87a78de..98419f27 100644 --- a/screen.c +++ b/screen.c @@ -122,7 +122,7 @@ get_screen_bycoord(int x, int y) if(!XineramaIsActive(globalconf.display)) return DefaultScreen(globalconf.display); - for(i = 0; i < globalconf.nscreens; i++) + for(i = 0; i < globalconf.nscreen; i++) { area = get_screen_area(i, NULL, NULL); if((x < 0 || (x >= area.x && x < area.x + area.width)) @@ -157,13 +157,13 @@ screen_build_screens(void) { si = XineramaQueryScreens(globalconf.display, &xinerama_screen_number); globalconf.screens = p_new(VirtScreen, xinerama_screen_number); - globalconf.nscreens = 0; + globalconf.nscreen = 0; /* now check if screens overlaps (same x,y): if so, we take only the biggest one */ for(screen = 0; screen < xinerama_screen_number; screen++) { drop = False; - for(screen_to_test = 0; screen_to_test < globalconf.nscreens; screen_to_test++) + for(screen_to_test = 0; screen_to_test < globalconf.nscreen; screen_to_test++) if(si[screen].x_org == globalconf.screens[screen_to_test].geometry.x && si[screen].y_org == globalconf.screens[screen_to_test].geometry.y) { @@ -176,14 +176,14 @@ screen_build_screens(void) MAX(si[screen].height, si[screen_to_test].height); } if(!drop) - globalconf.screens[globalconf.nscreens++].geometry = screen_xsi_to_area(si[screen]); + globalconf.screens[globalconf.nscreen++].geometry = screen_xsi_to_area(si[screen]); } /* realloc smaller if xinerama_screen_number != screen registered */ - if(xinerama_screen_number != globalconf.nscreens) + if(xinerama_screen_number != globalconf.nscreen) { - VirtScreen *newscreens = p_new(VirtScreen, globalconf.nscreens); - memcpy(newscreens, globalconf.screens, globalconf.nscreens * sizeof(VirtScreen)); + VirtScreen *newscreens = p_new(VirtScreen, globalconf.nscreen); + memcpy(newscreens, globalconf.screens, globalconf.nscreen * sizeof(VirtScreen)); p_delete(&globalconf.screens); globalconf.screens = newscreens; } @@ -192,9 +192,9 @@ screen_build_screens(void) } else { - globalconf.nscreens = ScreenCount(globalconf.display); - globalconf.screens = p_new(VirtScreen, globalconf.nscreens); - for(screen = 0; screen < globalconf.nscreens; screen++) + globalconf.nscreen = ScreenCount(globalconf.display); + globalconf.screens = p_new(VirtScreen, globalconf.nscreen); + for(screen = 0; screen < globalconf.nscreen; screen++) { globalconf.screens[screen].geometry.x = 0; globalconf.screens[screen].geometry.y = 0; @@ -349,8 +349,8 @@ uicb_screen_focus(int screen, char *arg) new_screen = screen + 1; if (new_screen < 0) - new_screen = globalconf.nscreens - 1; - if (new_screen > (globalconf.nscreens - 1)) + new_screen = globalconf.nscreen - 1; + if (new_screen > (globalconf.nscreen - 1)) new_screen = 0; focus(focus_get_current_client(new_screen), True, new_screen); @@ -377,10 +377,10 @@ uicb_client_movetoscreen(int screen __attribute__ ((unused)), char *arg) else new_screen = sel->screen + 1; - if(new_screen >= globalconf.nscreens) + if(new_screen >= globalconf.nscreen) new_screen = 0; else if(new_screen < 0) - new_screen = globalconf.nscreens - 1; + new_screen = globalconf.nscreen - 1; prev_screen = sel->screen; move_client_to_screen(sel, new_screen, True); diff --git a/statusbar.c b/statusbar.c index 3313a239..a9ecf570 100644 --- a/statusbar.c +++ b/statusbar.c @@ -238,7 +238,7 @@ statusbar_refresh() Statusbar *statusbar; Widget *widget; - for(screen = 0; screen < globalconf.nscreens; screen++) + for(screen = 0; screen < globalconf.nscreen; screen++) for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next) diff --git a/structs.h b/structs.h index 93195e97..081286ec 100644 --- a/structs.h +++ b/structs.h @@ -301,7 +301,7 @@ struct AwesomeConf /** Logical screens */ VirtScreen *screens; /** Number of logical screens */ - int nscreens; + int nscreen; /** Rules list */ Rule *rules; /** Keys bindings list */ diff --git a/uicb.c b/uicb.c index 0b83ac39..6dd208a7 100644 --- a/uicb.c +++ b/uicb.c @@ -52,7 +52,7 @@ run_uicb(char *cmd) return -1; } screen = atoi(cmd); - if(screen >= globalconf.nscreens || screen < 0) + if(screen >= globalconf.nscreen || screen < 0) { warn("Invalid screen specified: %i\n", screen); return -1;