rename nscreens to nscreen

This commit is contained in:
Julien Danjou 2008-01-24 13:48:49 +01:00
parent 5922d3a257
commit 240ee786d1
8 changed files with 23 additions and 23 deletions

View File

@ -292,7 +292,7 @@ main(int argc, char *argv[])
scan(); scan();
/* for each virtual screen */ /* for each virtual screen */
for(screen = 0; screen < globalconf.nscreens; screen++) for(screen = 0; screen < globalconf.nscreen; screen++)
setup(screen); setup(screen);
/* do this only for real screen */ /* do this only for real screen */

View File

@ -732,7 +732,7 @@ config_parse(const char *confpatharg)
} }
/* get the right screen section */ /* get the right screen section */
for(screen = 0; screen < globalconf.nscreens; screen++) for(screen = 0; screen < globalconf.nscreen; screen++)
config_parse_screen(cfg, screen); config_parse_screen(cfg, screen);
/* get general sections */ /* get general sections */
@ -754,7 +754,7 @@ config_parse(const char *confpatharg)
rule->isfloating = rules_get_float_from_str(cfg_getstr(cfgsectmp, "float")); rule->isfloating = rules_get_float_from_str(cfg_getstr(cfgsectmp, "float"));
rule->screen = cfg_getint(cfgsectmp, "screen"); rule->screen = cfg_getint(cfgsectmp, "screen");
rule->not_master = cfg_getbool(cfgsectmp, "not_master"); rule->not_master = cfg_getbool(cfgsectmp, "not_master");
if(rule->screen >= globalconf.nscreens) if(rule->screen >= globalconf.nscreen)
rule->screen = 0; rule->screen = 0;
rule_list_push(&globalconf.rules, rule); rule_list_push(&globalconf.rules, rule);

View File

@ -70,7 +70,7 @@ handle_event_buttonpress(XEvent *e)
Statusbar *statusbar; Statusbar *statusbar;
XButtonPressedEvent *ev = &e->xbutton; 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) for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next)
if(statusbar->sw->window == ev->window || statusbar->sw->window == ev->subwindow) if(statusbar->sw->window == ev->window || statusbar->sw->window == ev->subwindow)
switch(statusbar->position) switch(statusbar->position)
@ -257,7 +257,7 @@ handle_event_expose(XEvent *e)
Statusbar *statusbar; Statusbar *statusbar;
if(!ev->count) 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) for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next)
if(statusbar->sw->window == ev->window) if(statusbar->sw->window == ev->window)
{ {

View File

@ -99,7 +99,7 @@ layout_refresh(void)
int screen; int screen;
Bool arranged = False; Bool arranged = False;
for(screen = 0; screen < globalconf.nscreens; screen++) for(screen = 0; screen < globalconf.nscreen; screen++)
if(globalconf.screens[screen].need_arrange) if(globalconf.screens[screen].need_arrange)
{ {
arrange(screen); arrange(screen);

View File

@ -122,7 +122,7 @@ get_screen_bycoord(int x, int y)
if(!XineramaIsActive(globalconf.display)) if(!XineramaIsActive(globalconf.display))
return DefaultScreen(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); area = get_screen_area(i, NULL, NULL);
if((x < 0 || (x >= area.x && x < area.x + area.width)) 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); si = XineramaQueryScreens(globalconf.display, &xinerama_screen_number);
globalconf.screens = p_new(VirtScreen, 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 */ /* now check if screens overlaps (same x,y): if so, we take only the biggest one */
for(screen = 0; screen < xinerama_screen_number; screen++) for(screen = 0; screen < xinerama_screen_number; screen++)
{ {
drop = False; 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 if(si[screen].x_org == globalconf.screens[screen_to_test].geometry.x
&& si[screen].y_org == globalconf.screens[screen_to_test].geometry.y) && 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); MAX(si[screen].height, si[screen_to_test].height);
} }
if(!drop) 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 */ /* 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); VirtScreen *newscreens = p_new(VirtScreen, globalconf.nscreen);
memcpy(newscreens, globalconf.screens, globalconf.nscreens * sizeof(VirtScreen)); memcpy(newscreens, globalconf.screens, globalconf.nscreen * sizeof(VirtScreen));
p_delete(&globalconf.screens); p_delete(&globalconf.screens);
globalconf.screens = newscreens; globalconf.screens = newscreens;
} }
@ -192,9 +192,9 @@ screen_build_screens(void)
} }
else else
{ {
globalconf.nscreens = ScreenCount(globalconf.display); globalconf.nscreen = ScreenCount(globalconf.display);
globalconf.screens = p_new(VirtScreen, globalconf.nscreens); globalconf.screens = p_new(VirtScreen, globalconf.nscreen);
for(screen = 0; screen < globalconf.nscreens; screen++) for(screen = 0; screen < globalconf.nscreen; screen++)
{ {
globalconf.screens[screen].geometry.x = 0; globalconf.screens[screen].geometry.x = 0;
globalconf.screens[screen].geometry.y = 0; globalconf.screens[screen].geometry.y = 0;
@ -349,8 +349,8 @@ uicb_screen_focus(int screen, char *arg)
new_screen = screen + 1; new_screen = screen + 1;
if (new_screen < 0) if (new_screen < 0)
new_screen = globalconf.nscreens - 1; new_screen = globalconf.nscreen - 1;
if (new_screen > (globalconf.nscreens - 1)) if (new_screen > (globalconf.nscreen - 1))
new_screen = 0; new_screen = 0;
focus(focus_get_current_client(new_screen), True, new_screen); focus(focus_get_current_client(new_screen), True, new_screen);
@ -377,10 +377,10 @@ uicb_client_movetoscreen(int screen __attribute__ ((unused)), char *arg)
else else
new_screen = sel->screen + 1; new_screen = sel->screen + 1;
if(new_screen >= globalconf.nscreens) if(new_screen >= globalconf.nscreen)
new_screen = 0; new_screen = 0;
else if(new_screen < 0) else if(new_screen < 0)
new_screen = globalconf.nscreens - 1; new_screen = globalconf.nscreen - 1;
prev_screen = sel->screen; prev_screen = sel->screen;
move_client_to_screen(sel, new_screen, True); move_client_to_screen(sel, new_screen, True);

View File

@ -238,7 +238,7 @@ statusbar_refresh()
Statusbar *statusbar; Statusbar *statusbar;
Widget *widget; Widget *widget;
for(screen = 0; screen < globalconf.nscreens; screen++) for(screen = 0; screen < globalconf.nscreen; screen++)
for(statusbar = globalconf.screens[screen].statusbar; for(statusbar = globalconf.screens[screen].statusbar;
statusbar; statusbar;
statusbar = statusbar->next) statusbar = statusbar->next)

View File

@ -301,7 +301,7 @@ struct AwesomeConf
/** Logical screens */ /** Logical screens */
VirtScreen *screens; VirtScreen *screens;
/** Number of logical screens */ /** Number of logical screens */
int nscreens; int nscreen;
/** Rules list */ /** Rules list */
Rule *rules; Rule *rules;
/** Keys bindings list */ /** Keys bindings list */

2
uicb.c
View File

@ -52,7 +52,7 @@ run_uicb(char *cmd)
return -1; return -1;
} }
screen = atoi(cmd); screen = atoi(cmd);
if(screen >= globalconf.nscreens || screen < 0) if(screen >= globalconf.nscreen || screen < 0)
{ {
warn("Invalid screen specified: %i\n", screen); warn("Invalid screen specified: %i\n", screen);
return -1; return -1;