diff --git a/src/E.h b/src/E.h index 44d4028e..4bc9c299 100644 --- a/src/E.h +++ b/src/E.h @@ -356,7 +356,7 @@ int Esnprintf(va_alist); #define ENLIGHTENMENT_CONF_NUM_DESKTOPS 32 /* the cast is so -1 will == UINT_MAX */ #define DESKTOPS_WRAP_NUM(x) \ - (((unsigned int) (x)) % conf.desks.numdesktops) + (((unsigned int) (x)) % conf.desks.num) #define LIST_FINDBY_NAME 0 #define LIST_FINDBY_ID 1 @@ -1107,13 +1107,6 @@ typedef struct _desktops { int current; Desk desk[ENLIGHTENMENT_CONF_NUM_DESKTOPS]; - int dragdir; - int dragbar_width; - int dragbar_ordering; - int dragbar_length; - char slidein; - int slidespeed; - char hiqualitybg; } Desktops; @@ -1141,6 +1134,8 @@ typedef struct { struct { + int nx; + int ny; char wraparound; } areas; struct @@ -1150,8 +1145,15 @@ typedef struct } autoraise; struct { + int num; char wraparound; - char numdesktops; + int dragdir; + int dragbar_width; + int dragbar_ordering; + int dragbar_length; + char slidein; + int slidespeed; + char hiqualitybg; } desks; struct { @@ -1207,7 +1209,7 @@ typedef struct } tooltips; struct { - signed char enable; + char enable; char warpsticky; char warpshaded; char warpiconified; @@ -2156,7 +2158,6 @@ char *FindFile(const char *file); int LoadConfigFile(const char *file); int LoadEConfig(char *themelocation); void SaveUserControlConfig(FILE * autosavefile); -void RecoverUserConfig(void); /* theme.c functions */ void BadThemeDialog(void); diff --git a/src/actions.c b/src/actions.c index dd1d857d..85be16f8 100644 --- a/src/actions.c +++ b/src/actions.c @@ -584,7 +584,7 @@ spawnMenu(EWin * ewin, void *params) if (mode.cur_menu_depth > 0) EDBUG_RETURN(0); - for (i = 0; i < conf.desks.numdesktops; i++) + for (i = 0; i < conf.desks.num; i++) { if (mode.context_win == desks.desk[i].win) { @@ -965,7 +965,7 @@ ActionsHandleMotion(void) case MODE_DESKDRAG: dx = mode.x - mode.px; dy = mode.y - mode.py; - switch (desks.dragdir) + switch (conf.desks.dragdir) { case 0: if ((desks.desk[mode.deskdrag].x + dx) < 0) @@ -1903,16 +1903,16 @@ doDragdirSet(EWin * edummy, void *params) int i; EDBUG(6, "doDragdirSet"); - pd = desks.dragdir; + pd = conf.desks.dragdir; if (params) - desks.dragdir = atoi((char *)params); + conf.desks.dragdir = atoi((char *)params); else { - desks.dragdir++; - if (desks.dragdir > 3) - desks.dragdir = 0; + conf.desks.dragdir++; + if (conf.desks.dragdir > 3) + conf.desks.dragdir = 0; } - if (pd != desks.dragdir) + if (pd != conf.desks.dragdir) { GotoDesktop(desks.current); for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++) @@ -1937,16 +1937,16 @@ doDragbarOrderSet(EWin * edummy, void *params) Button *b; EDBUG(6, "doDragbarOrderSet"); - pd = desks.dragbar_ordering; + pd = conf.desks.dragbar_ordering; if (params) - desks.dragbar_ordering = atoi((char *)params); + conf.desks.dragbar_ordering = atoi((char *)params); else { - desks.dragbar_ordering++; - if (desks.dragbar_ordering > 5) - desks.dragbar_ordering = 0; + conf.desks.dragbar_ordering++; + if (conf.desks.dragbar_ordering > 5) + conf.desks.dragbar_ordering = 0; } - if (pd != desks.dragbar_ordering) + if (pd != conf.desks.dragbar_ordering) { while ((b = RemoveItem("_DESKTOP_DRAG_CONTROL", 0, LIST_FINDBY_NAME, LIST_TYPE_BUTTON))) @@ -1965,10 +1965,10 @@ doDragbarWidthSet(EWin * edummy, void *params) Button *b; EDBUG(6, "doDragbarWidthSet"); - pd = desks.dragbar_width; + pd = conf.desks.dragbar_width; if (params) - desks.dragbar_width = atoi((char *)params); - if (pd != desks.dragbar_width) + conf.desks.dragbar_width = atoi((char *)params); + if (pd != conf.desks.dragbar_width) { while ((b = RemoveItem("_DESKTOP_DRAG_CONTROL", 0, LIST_FINDBY_NAME, LIST_TYPE_BUTTON))) @@ -1987,10 +1987,10 @@ doDragbarLengthSet(EWin * edummy, void *params) Button *b; EDBUG(6, "doDragbarLengthSet"); - pd = desks.dragbar_length; + pd = conf.desks.dragbar_length; if (params) - desks.dragbar_length = atoi((char *)params); - if (pd != desks.dragbar_length) + conf.desks.dragbar_length = atoi((char *)params); + if (pd != conf.desks.dragbar_length) { while ((b = RemoveItem("_DESKTOP_DRAG_CONTROL", 0, LIST_FINDBY_NAME, LIST_TYPE_BUTTON))) @@ -2007,13 +2007,13 @@ doDeskSlideSet(EWin * edummy, void *params) { EDBUG(6, "doDeskSlideSet"); if (params) - desks.slidein = atoi((char *)params); + conf.desks.slidein = atoi((char *)params); else { - if (desks.slidein) - desks.slidein = 0; + if (conf.desks.slidein) + conf.desks.slidein = 0; else - desks.slidein = 1; + conf.desks.slidein = 1; } autosave(); EDBUG_RETURN(0); @@ -2024,7 +2024,7 @@ doDeskSlideSpeedSet(EWin * edummy, void *params) { EDBUG(6, "doDeskSlideSpeedSet"); if (params) - desks.slidespeed = atoi((char *)params); + conf.desks.slidespeed = atoi((char *)params); autosave(); EDBUG_RETURN(0); } @@ -2034,13 +2034,13 @@ doHiQualityBgSet(EWin * edummy, void *params) { EDBUG(6, "doHiQualityBgSet"); if (params) - desks.hiqualitybg = atoi((char *)params); + conf.desks.hiqualitybg = atoi((char *)params); else { - if (desks.hiqualitybg) - desks.hiqualitybg = 0; + if (conf.desks.hiqualitybg) + conf.desks.hiqualitybg = 0; else - desks.hiqualitybg = 1; + conf.desks.hiqualitybg = 1; } autosave(); EDBUG_RETURN(0); diff --git a/src/areas.c b/src/areas.c index ce3c9961..181ed199 100644 --- a/src/areas.c +++ b/src/areas.c @@ -114,8 +114,8 @@ SetAreaSize(int aw, int ah) aw = 1; if (ah < 1) ah = 1; - area_w = aw; - area_h = ah; + conf.areas.nx = area_w = aw; + conf.areas.ny = area_h = ah; HintsSetViewportConfig(); PagerReArea(); EDBUG_RETURN_; @@ -278,7 +278,7 @@ SetCurrentArea(int ax, int ay) lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN); if (lst) { - if (desks.slidein) + if (conf.desks.slidein) { int wnum = 0; Window *wl = NULL; @@ -313,7 +313,7 @@ SetCurrentArea(int ax, int ay) -(root.h * (ay - desks.desk[desks.current].current_area_y)), - desks.slidespeed); + conf.desks.slidespeed); Efree(wl); } /* move the windows to their final positions */ diff --git a/src/borders.c b/src/borders.c index 907d772c..81d2c6f7 100644 --- a/src/borders.c +++ b/src/borders.c @@ -66,53 +66,48 @@ DetermineEwinFloat(EWin * ewin, int dx, int dy) EDBUG(5, "DetermineEwinFloat"); - if ((ewin->desktop != 0) && (ewin->floating < 2) - && ((desks.desk[ewin->desktop].x != 0) - || (desks.desk[ewin->desktop].y != 0) - || (desks.current != ewin->desktop))) + if ((ewin->desktop != 0) && (ewin->floating < 2) && + ((desks.desk[ewin->desktop].x != 0) || + (desks.desk[ewin->desktop].y != 0) || (desks.current != ewin->desktop))) { - if ((desks.dragdir == 0) - && (((ewin->x + dx < 0) || ((ewin->x + dx + ewin->w <= root.w) - && - ((DesktopAt - (desks.desk[ewin->desktop].x + - ewin->x + dx + ewin->w - 1, - desks.desk[ewin->desktop].y) != - ewin->desktop)))))) - dofloat = 1; - if ((desks.dragdir == 1) - && (((ewin->x + dx + ewin->w > root.w) || ((ewin->x + dx >= 0) - && - ((DesktopAt - (desks.desk - [ewin->desktop].x + - ewin->x + dx, - desks. - desk[ewin->desktop]. - y) != - ewin->desktop)))))) - dofloat = 1; - if ((desks.dragdir == 2) - && - (((ewin-> - y + dy < 0) || ((ewin->y + dy + ewin->h <= root.h) - && - ((DesktopAt - (desks.desk[ewin->desktop].x, - desks.desk[ewin->desktop].y + ewin->y + dy + - ewin->h - 1) != ewin->desktop)))))) - dofloat = 1; - if ((desks.dragdir == 3) - && (((ewin->y + dy + ewin->h > root.h) || ((ewin->y + dy >= 0) - && - ((DesktopAt - (desks.desk - [ewin->desktop].x, - desks. - desk[ewin->desktop].y - + ewin->y + dy) != - ewin->desktop)))))) - dofloat = 1; + switch (conf.desks.dragdir) + { + case 0: + if (((ewin->x + dx < 0) || + ((ewin->x + dx + ewin->w <= root.w) && + ((DesktopAt + (desks.desk[ewin->desktop].x + ewin->x + dx + ewin->w - 1, + desks.desk[ewin->desktop].y) != ewin->desktop))))) + dofloat = 1; + break; + case 1: + if (((ewin->x + dx + ewin->w > root.w) || + ((ewin->x + dx >= 0) && + ((DesktopAt + (desks.desk[ewin->desktop].x + ewin->x + dx, + desks.desk[ewin->desktop].y) != ewin->desktop))))) + dofloat = 1; + break; + case 2: + if (((ewin->y + dy < 0) || + ((ewin->y + dy + ewin->h <= root.h) && + ((DesktopAt + (desks.desk[ewin->desktop].x, + desks.desk[ewin->desktop].y + ewin->y + dy + ewin->h - + 1) != ewin->desktop))))) + dofloat = 1; + break; + case 3: + if (((ewin->y + dy + ewin->h > root.h) || + ((ewin->y + dy >= 0) && + ((DesktopAt + (desks.desk[ewin->desktop].x, + desks.desk[ewin->desktop].y + ewin->y + dy) != + ewin->desktop))))) + dofloat = 1; + break; + } + if (dofloat) FloatEwinAt(ewin, ewin->x + desks.desk[ewin->desktop].x, ewin->y + desks.desk[ewin->desktop].y); diff --git a/src/comms.c b/src/comms.c index 868e82e5..f3ec1d60 100644 --- a/src/comms.c +++ b/src/comms.c @@ -541,7 +541,7 @@ HandleComms(XClientMessageEvent * ev) DesktopAccounting(); desks.desk[i].viewable = view; desks.desk[i].bg = bg; - if (i < conf.desks.numdesktops) + if (i < conf.desks.num) { if (desks.desk[i].viewable) RefreshDesktop(i); @@ -581,7 +581,7 @@ HandleComms(XClientMessageEvent * ev) DesktopAccounting(); desks.desk[i].viewable = view; desks.desk[i].bg = NULL; - if (i < conf.desks.numdesktops) + if (i < conf.desks.num) { if (desks.desk[i].viewable) RefreshDesktop(i); @@ -1337,45 +1337,45 @@ HandleComms(XClientMessageEvent * ev) else if (!strcmp(w, "DRAGDIR:")) { word(s, wd, w); - if (desks.dragdir != atoi(w)) + if (conf.desks.dragdir != atoi(w)) dragbar_change = 1; - desks.dragdir = atoi(w); + conf.desks.dragdir = atoi(w); } else if (!strcmp(w, "DRAGBARWIDTH:")) { word(s, wd, w); - if (desks.dragbar_width != atoi(w)) + if (conf.desks.dragbar_width != atoi(w)) dragbar_change = 1; - desks.dragbar_width = atoi(w); + conf.desks.dragbar_width = atoi(w); } else if (!strcmp(w, "DRAGBARORDERING:")) { word(s, wd, w); - if (desks.dragbar_ordering != atoi(w)) + if (conf.desks.dragbar_ordering != atoi(w)) dragbar_change = 1; - desks.dragbar_ordering = atoi(w); + conf.desks.dragbar_ordering = atoi(w); } else if (!strcmp(w, "DRAGBARLENGTH:")) { word(s, wd, w); - if (desks.dragbar_length != atoi(w)) + if (conf.desks.dragbar_length != atoi(w)) dragbar_change = 1; - desks.dragbar_length = atoi(w); + conf.desks.dragbar_length = atoi(w); } else if (!strcmp(w, "DESKSLIDEIN:")) { word(s, wd, w); - desks.slidein = atoi(w); + conf.desks.slidein = atoi(w); } else if (!strcmp(w, "DESKSLIDESPEED:")) { word(s, wd, w); - desks.slidespeed = atoi(w); + conf.desks.slidespeed = atoi(w); } else if (!strcmp(w, "HIQUALITYBG:")) { word(s, wd, w); - desks.hiqualitybg = atoi(w); + conf.desks.hiqualitybg = atoi(w); } else if (!strcmp(w, "TRANSIENTSFOLLOWLEADER:")) { @@ -1528,10 +1528,11 @@ HandleComms(XClientMessageEvent * ev) conf.memory_paranoia, conf.tooltips.enable, conf.tooltips.delay, conf.autoraise.enable, conf.autoraise.delay, conf.dock.startx, conf.dock.starty, - conf.save_under, conf.menuslide, conf.desks.numdesktops, - desks.dragdir, desks.dragbar_width, desks.dragbar_ordering, - desks.dragbar_length, desks.slidein, desks.slidespeed, - desks.hiqualitybg, conf.focus.transientsfollowleader, + conf.save_under, conf.menuslide, conf.desks.num, + conf.desks.dragdir, conf.desks.dragbar_width, + conf.desks.dragbar_ordering, conf.desks.dragbar_length, + conf.desks.slidein, conf.desks.slidespeed, + conf.desks.hiqualitybg, conf.focus.transientsfollowleader, conf.focus.switchfortransientmap, a, b, conf.focus.all_new_windows_get_focus, conf.focus.new_transients_get_focus, @@ -1562,7 +1563,7 @@ HandleComms(XClientMessageEvent * ev) buf[0] = 0; Esnprintf(buf, sizeof(buf), "Number of desks is %d\n", - conf.desks.numdesktops); + conf.desks.num); CommsSend(c, buf); } else @@ -1570,23 +1571,23 @@ HandleComms(XClientMessageEvent * ev) int i, num; EWin **lst; - conf.desks.numdesktops = atoi(w); - if (conf.desks.numdesktops <= 0) - conf.desks.numdesktops = 1; - else if (conf.desks.numdesktops > ENLIGHTENMENT_CONF_NUM_DESKTOPS) - conf.desks.numdesktops = ENLIGHTENMENT_CONF_NUM_DESKTOPS; + conf.desks.num = atoi(w); + if (conf.desks.num <= 0) + conf.desks.num = 1; + else if (conf.desks.num > ENLIGHTENMENT_CONF_NUM_DESKTOPS) + conf.desks.num = ENLIGHTENMENT_CONF_NUM_DESKTOPS; lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN); if (lst) { for (i = 0; i < num; i++) { - if (lst[i]->desktop >= conf.desks.numdesktops) - MoveEwinToDesktop(lst[i], conf.desks.numdesktops - 1); + if (lst[i]->desktop >= conf.desks.num) + MoveEwinToDesktop(lst[i], conf.desks.num - 1); } Efree(lst); } - if (desks.current >= conf.desks.numdesktops) - GotoDesktop(conf.desks.numdesktops - 1); + if (desks.current >= conf.desks.num) + GotoDesktop(conf.desks.num - 1); } } else if (!strcmp(w, "get_client_info")) diff --git a/src/config.c b/src/config.c index cd53deb3..8c6080c4 100644 --- a/src/config.c +++ b/src/config.c @@ -36,6 +36,7 @@ extern char *__XOS2RedirRoot(const char *); static char is_autosave = 0; static void SkipTillEnd(FILE * ConfigFile); +static void RecoverUserConfig(void); #define SKIP_If_EXISTS(name, type) \ if (FindItem(name, 0, LIST_FINDBY_NAME, type)) \ @@ -625,15 +626,11 @@ Config_Control(FILE * ConfigFile) conf.menuslide = i2; break; case CONTROL_NUMDESKTOPS: - conf.desks.numdesktops = i2; - if (conf.desks.numdesktops <= 0) - { - conf.desks.numdesktops = 1; - } - else if (conf.desks.numdesktops > ENLIGHTENMENT_CONF_NUM_DESKTOPS) - { - conf.desks.numdesktops = ENLIGHTENMENT_CONF_NUM_DESKTOPS; - } + conf.desks.num = i2; + if (conf.desks.num <= 0) + conf.desks.num = 1; + else if (conf.desks.num > ENLIGHTENMENT_CONF_NUM_DESKTOPS) + conf.desks.num = ENLIGHTENMENT_CONF_NUM_DESKTOPS; break; case CONTROL_MEMORYPARANOIA: conf.memory_paranoia = i2; @@ -669,8 +666,7 @@ Config_Control(FILE * ConfigFile) conf.focus.raise_after_next_focus = i2; break; case CONTROL_DISPLAY_WARP: - if (conf.warplist.enable >= 0) - conf.warplist.enable = i2; + conf.warplist.enable = i2; break; case CONTROL_WARP_ON_NEXT_FOCUS: conf.focus.warp_on_next_focus = i2; @@ -723,22 +719,22 @@ Config_Control(FILE * ConfigFile) conf.group_swapmove = i2; break; case DESKTOP_DRAGDIR: - desks.dragdir = i2; + conf.desks.dragdir = i2; break; case DESKTOP_DRAGBAR_WIDTH: - desks.dragbar_width = i2; + conf.desks.dragbar_width = i2; break; case DESKTOP_DRAGBAR_ORDERING: - desks.dragbar_ordering = i2; + conf.desks.dragbar_ordering = i2; break; case DESKTOP_DRAGBAR_LENGTH: - desks.dragbar_length = i2; + conf.desks.dragbar_length = i2; break; case DESKTOP_SLIDEIN: - desks.slidein = i2; + conf.desks.slidein = i2; break; case DESKTOP_SLIDESPEED: - desks.slidespeed = i2; + conf.desks.slidespeed = i2; break; case CONTROL_SHADESPEED: conf.shadespeed = i2; @@ -765,11 +761,12 @@ Config_Control(FILE * ConfigFile) conf.warplist.warpfocused = i2; break; case DESKTOP_HIQUALITYBG: - desks.hiqualitybg = i2; + conf.desks.hiqualitybg = i2; break; case DESKTOP_AREA_SIZE: sscanf(s, "%i %i %i", &i1, &i2, &i3); - SetAreaSize(i2, i3); + conf.areas.nx = i2; + conf.areas.ny = i3; break; case CONTROL_AREA_WRAPAROUND: conf.areas.wraparound = i2; @@ -3827,7 +3824,7 @@ SaveUserControlConfig(FILE * autosavefile) ActionClass *ac; Action *aa; int i, num, flags, j; - int a, b, r, g; + int b, r, g; EDBUG(5, "SaveUserControlConfig"); if (autosavefile) @@ -3845,13 +3842,13 @@ SaveUserControlConfig(FILE * autosavefile) fprintf(autosavefile, "317 %i\n", (int)conf.slidespeedcleanup); fprintf(autosavefile, "320 %i\n", (int)conf.desktop_bg_timeout); fprintf(autosavefile, "321 %i\n", (int)conf.button_move_resistance); - fprintf(autosavefile, "400 %i\n", (int)desks.dragdir); - fprintf(autosavefile, "401 %i\n", (int)desks.dragbar_width); - fprintf(autosavefile, "402 %i\n", (int)desks.dragbar_ordering); - fprintf(autosavefile, "403 %i\n", (int)desks.dragbar_length); - fprintf(autosavefile, "404 %i\n", (int)desks.slidein); - fprintf(autosavefile, "405 %i\n", (int)desks.slidespeed); - fprintf(autosavefile, "406 %i\n", (int)desks.hiqualitybg); + fprintf(autosavefile, "400 %i\n", (int)conf.desks.dragdir); + fprintf(autosavefile, "401 %i\n", (int)conf.desks.dragbar_width); + fprintf(autosavefile, "402 %i\n", (int)conf.desks.dragbar_ordering); + fprintf(autosavefile, "403 %i\n", (int)conf.desks.dragbar_length); + fprintf(autosavefile, "404 %i\n", (int)conf.desks.slidein); + fprintf(autosavefile, "405 %i\n", (int)conf.desks.slidespeed); + fprintf(autosavefile, "406 %i\n", (int)conf.desks.hiqualitybg); fprintf(autosavefile, "1370 %i\n", (int)conf.dockapp_support); fprintf(autosavefile, "325 %i\n", (int)conf.dock.dirmode); fprintf(autosavefile, "326 %i\n", (int)conf.shadespeed); @@ -3864,13 +3861,13 @@ SaveUserControlConfig(FILE * autosavefile) (int)conf.dock.starty); fprintf(autosavefile, "334 %i\n", (int)conf.memory_paranoia); fprintf(autosavefile, "332 %i\n", (int)conf.menuslide); - fprintf(autosavefile, "333 %i\n", (int)conf.desks.numdesktops); + fprintf(autosavefile, "333 %i\n", (int)conf.desks.num); fprintf(autosavefile, "335 %i\n", (int)conf.focus.transientsfollowleader); fprintf(autosavefile, "336 %i\n", (int)conf.focus.switchfortransientmap); - GetAreaSize(&a, &b); - fprintf(autosavefile, "407 %i %i\n", a, b); + fprintf(autosavefile, "407 %i %i\n", (int)conf.areas.nx, + (int)conf.areas.ny); fprintf(autosavefile, "340 %i\n", (int)conf.focus.all_new_windows_get_focus); fprintf(autosavefile, "341 %i\n", @@ -4216,7 +4213,7 @@ SaveUserControlConfig(FILE * autosavefile) EDBUG_RETURN_; } -void +static void RecoverUserConfig(void) { if (is_autosave) diff --git a/src/desktops.c b/src/desktops.c index 1bd8fd44..986a0080 100644 --- a/src/desktops.c +++ b/src/desktops.c @@ -125,38 +125,38 @@ ChangeNumberOfDesktops(int quantity) int pnum, i, num; EWin **lst; - pnum = conf.desks.numdesktops; + pnum = conf.desks.num; for (i = quantity; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++) LowerDesktop(i); - conf.desks.numdesktops = quantity; + conf.desks.num = quantity; - if (conf.desks.numdesktops <= 0) - conf.desks.numdesktops = 1; - else if (conf.desks.numdesktops > ENLIGHTENMENT_CONF_NUM_DESKTOPS) - conf.desks.numdesktops = ENLIGHTENMENT_CONF_NUM_DESKTOPS; + if (conf.desks.num <= 0) + conf.desks.num = 1; + else if (conf.desks.num > ENLIGHTENMENT_CONF_NUM_DESKTOPS) + conf.desks.num = ENLIGHTENMENT_CONF_NUM_DESKTOPS; lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN); if (lst) { for (i = 0; i < num; i++) { - if (lst[i]->desktop >= conf.desks.numdesktops) - MoveEwinToDesktop(lst[i], conf.desks.numdesktops - 1); + if (lst[i]->desktop >= conf.desks.num) + MoveEwinToDesktop(lst[i], conf.desks.num - 1); } Efree(lst); } - if (conf.desks.numdesktops > pnum) + if (conf.desks.num > pnum) { - for (i = pnum; i < conf.desks.numdesktops; i++) + for (i = pnum; i < conf.desks.num; i++) NewPagerForDesktop(i); } - else if (conf.desks.numdesktops < pnum) + else if (conf.desks.num < pnum) { - for (i = conf.desks.numdesktops; i < pnum; i++) + for (i = conf.desks.num; i < pnum; i++) DisablePagersForDesktop(i); } - if (desks.current >= conf.desks.numdesktops) - GotoDesktop(conf.desks.numdesktops - 1); + if (desks.current >= conf.desks.num) + GotoDesktop(conf.desks.num - 1); HintsSetDesktopConfig(); } @@ -550,7 +550,7 @@ SetBackgroundTo(Window win, Background * dsk, char setbg) gc = 0; rt = imlib_context_get_dither(); - if (desks.hiqualitybg) + if (conf.desks.hiqualitybg) { imlib_context_set_dither(1); #if 0 @@ -898,7 +898,7 @@ InitDesktopControls() } b = NULL; - if (desks.dragdir < 2) + if (conf.desks.dragdir < 2) { ic = FindItem("DESKTOP_DRAGBUTTON_VERT", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); @@ -927,7 +927,7 @@ InitDesktopControls() LIST_TYPE_ICLASS); } - switch (desks.dragbar_ordering) + switch (conf.desks.dragbar_ordering) { case 0: m = 0; @@ -966,48 +966,48 @@ InitDesktopControls() break; } - switch (desks.dragdir) + switch (conf.desks.dragdir) { case 0: - w[0] = w[1] = w[2] = h[0] = h[1] = desks.dragbar_width; - if (desks.dragbar_length == 0) - h[2] = root.h - (desks.dragbar_width * 2); + w[0] = w[1] = w[2] = h[0] = h[1] = conf.desks.dragbar_width; + if (conf.desks.dragbar_length == 0) + h[2] = root.h - (conf.desks.dragbar_width * 2); else - h[2] = desks.dragbar_length; + h[2] = conf.desks.dragbar_length; x[0] = x[1] = x[2] = 0; y[m] = 0; y[n] = y[m] + h[m]; y[o] = y[n] + h[n]; break; case 1: - w[0] = w[1] = w[2] = h[0] = h[1] = desks.dragbar_width; - if (desks.dragbar_length == 0) - h[2] = root.h - (desks.dragbar_width * 2); + w[0] = w[1] = w[2] = h[0] = h[1] = conf.desks.dragbar_width; + if (conf.desks.dragbar_length == 0) + h[2] = root.h - (conf.desks.dragbar_width * 2); else - h[2] = desks.dragbar_length; - x[0] = x[1] = x[2] = root.w - desks.dragbar_width; + h[2] = conf.desks.dragbar_length; + x[0] = x[1] = x[2] = root.w - conf.desks.dragbar_width; y[m] = 0; y[n] = y[m] + h[m]; y[o] = y[n] + h[n]; break; case 2: - h[0] = h[1] = h[2] = w[0] = w[1] = desks.dragbar_width; - if (desks.dragbar_length == 0) - w[2] = root.w - (desks.dragbar_width * 2); + h[0] = h[1] = h[2] = w[0] = w[1] = conf.desks.dragbar_width; + if (conf.desks.dragbar_length == 0) + w[2] = root.w - (conf.desks.dragbar_width * 2); else - w[2] = desks.dragbar_length; + w[2] = conf.desks.dragbar_length; y[0] = y[1] = y[2] = 0; x[m] = 0; x[n] = x[m] + w[m]; x[o] = x[n] + w[n]; break; case 3: - h[0] = h[1] = h[2] = w[0] = w[1] = desks.dragbar_width; - if (desks.dragbar_length == 0) - w[2] = root.w - (desks.dragbar_width * 2); + h[0] = h[1] = h[2] = w[0] = w[1] = conf.desks.dragbar_width; + if (conf.desks.dragbar_length == 0) + w[2] = root.w - (conf.desks.dragbar_width * 2); else - w[2] = desks.dragbar_length; - y[0] = y[1] = y[2] = root.h - desks.dragbar_width; + w[2] = conf.desks.dragbar_length; + y[0] = y[1] = y[2] = root.h - conf.desks.dragbar_width; x[m] = 0; x[n] = x[m] + w[m]; x[o] = x[n] + w[n]; @@ -1016,7 +1016,7 @@ InitDesktopControls() break; } - if (desks.dragbar_width > 0) + if (conf.desks.dragbar_width > 0) { b = ButtonCreate("_DESKTOP_DRAG_CONTROL", ic2, ac2, NULL, NULL, -1, FLAG_FIXED, 1, 99999, 1, 99999, 0, 0, x[0], 0, @@ -1033,23 +1033,23 @@ InitDesktopControls() } if (i > 0) { - if (desks.dragdir == 0) + if (conf.desks.dragdir == 0) { b = ButtonCreate("_DESKTOP_DESKRAY_DRAG_CONTROL", ic4, ac, NULL, NULL, 1, FLAG_FIXED_VERT, 1, 99999, 1, 99999, 0, 0, desks.desk[i].x, 0, desks.desk[i].y, 0, 0, 0, 0, 0, 1, 0, 1); } - else if (desks.dragdir == 1) + else if (conf.desks.dragdir == 1) { b = ButtonCreate("_DESKTOP_DESKRAY_DRAG_CONTROL", ic4, ac, NULL, NULL, 1, FLAG_FIXED_VERT, 1, 99999, 1, 99999, 0, 0, desks.desk[i].x + root.w - - desks.dragbar_width, 0, desks.desk[i].y, 0, - 0, 0, 0, 0, 1, 0, 1); + conf.desks.dragbar_width, 0, desks.desk[i].y, + 0, 0, 0, 0, 0, 1, 0, 1); } - else if (desks.dragdir == 2) + else if (conf.desks.dragdir == 2) { b = ButtonCreate("_DESKTOP_DESKRAY_DRAG_CONTROL", ic4, ac, NULL, NULL, 1, FLAG_FIXED_HORIZ, 1, 99999, 1, @@ -1062,7 +1062,8 @@ InitDesktopControls() NULL, NULL, 1, FLAG_FIXED_HORIZ, 1, 99999, 1, 99999, 0, 0, desks.desk[i].x, 0, desks.desk[i].y + root.h - - desks.dragbar_width, 0, 0, 0, 0, 0, 1, 0, 1); + conf.desks.dragbar_width, 0, 0, 0, 0, 0, 1, + 0, 1); } AddItem(b, b->name, 2, LIST_TYPE_BUTTON); desks.desk[i].tag = b; @@ -1224,12 +1225,12 @@ GotoDesktop(int num) if (conf.desks.wraparound) { - if (num >= conf.desks.numdesktops) + if (num >= conf.desks.num) num = 0; else if (num < 0) - num = conf.desks.numdesktops - 1; + num = conf.desks.num - 1; } - if (num < 0 || num >= conf.desks.numdesktops || num == desks.current) + if (num < 0 || num >= conf.desks.num || num == desks.current) EDBUG_RETURN_; pdesk = desks.current; @@ -1260,35 +1261,35 @@ GotoDesktop(int num) if (num > 0) { - if (desks.slidein) + if (conf.desks.slidein) { if (!desks.desk[num].viewable) { - switch (desks.dragdir) + switch (conf.desks.dragdir) { case 0: MoveDesktop(num, root.w, 0); RaiseDesktop(num); SlideWindowTo(desks.desk[num].win, root.w, 0, 0, 0, - desks.slidespeed); + conf.desks.slidespeed); break; case 1: MoveDesktop(num, -root.w, 0); RaiseDesktop(num); SlideWindowTo(desks.desk[num].win, -root.w, 0, 0, 0, - desks.slidespeed); + conf.desks.slidespeed); break; case 2: MoveDesktop(num, 0, root.h); RaiseDesktop(num); SlideWindowTo(desks.desk[num].win, 0, root.h, 0, 0, - desks.slidespeed); + conf.desks.slidespeed); break; case 3: MoveDesktop(num, 0, -root.h); RaiseDesktop(num); SlideWindowTo(desks.desk[num].win, 0, -root.h, 0, 0, - desks.slidespeed); + conf.desks.slidespeed); break; default: break; @@ -1298,7 +1299,7 @@ GotoDesktop(int num) { GetWinXY(desks.desk[num].win, &x, &y); SlideWindowTo(desks.desk[num].win, desks.desk[num].x, - desks.desk[num].y, 0, 0, desks.slidespeed); + desks.desk[num].y, 0, 0, conf.desks.slidespeed); RaiseDesktop(num); } StackDesktops(); @@ -1339,7 +1340,7 @@ MoveDesktop(int num, int x, int y) EDBUG(3, "MoveDesktop"); if (num < 0) EDBUG_RETURN_; - if (num >= conf.desks.numdesktops) + if (num >= conf.desks.num) EDBUG_RETURN_; if (num == 0) EDBUG_RETURN_; @@ -1444,7 +1445,7 @@ RaiseDesktop(int num) EDBUG(3, "RaiseDesktop"); - if ((num < 0) || (num >= conf.desks.numdesktops)) + if ((num < 0) || (num >= conf.desks.num)) EDBUG_RETURN_; FocusNewDeskBegin(); @@ -1483,7 +1484,7 @@ LowerDesktop(int num) { EDBUG(3, "LowerDesktop"); - if ((num <= 0) || (num >= conf.desks.numdesktops)) + if ((num <= 0) || (num >= conf.desks.num)) EDBUG_RETURN_; FocusNewDeskBegin(); @@ -1513,7 +1514,7 @@ HideDesktop(int num) { EDBUG(3, "HideDesktop"); - if ((num < 0) || (num >= conf.desks.numdesktops)) + if ((num < 0) || (num >= conf.desks.num)) EDBUG_RETURN_; if (num == 0) EDBUG_RETURN_; @@ -1536,7 +1537,7 @@ ShowDesktop(int num) if (num < 0) EDBUG_RETURN_; - if (num >= conf.desks.numdesktops) + if (num >= conf.desks.num) EDBUG_RETURN_; desks.desk[num].viewable = 1; @@ -1684,7 +1685,7 @@ UncoverDesktop(int num) EDBUG(3, "UncoverDesktop"); if (num < 0) EDBUG_RETURN_; - if (num >= conf.desks.numdesktops) + if (num >= conf.desks.num) EDBUG_RETURN_; desks.desk[num].viewable = 1; RefreshDesktop(num); diff --git a/src/evhandlers.c b/src/evhandlers.c index 63ccf90e..af1d3dac 100644 --- a/src/evhandlers.c +++ b/src/evhandlers.c @@ -67,7 +67,7 @@ ToolTipTimeout(int val, void *data) int i; int show = 1; - for (i = 0; i < conf.desks.numdesktops; i++) + for (i = 0; i < conf.desks.num; i++) { if (win == desks.desk[i].win) show = 0; @@ -778,7 +778,7 @@ HandleMouseDown(XEvent * ev) mode.y = ev->xbutton.y_root; desk_click = -1; - for (i = 0; i < conf.desks.numdesktops; i++) + for (i = 0; i < conf.desks.num; i++) { if (win == desks.desk[i].win) { diff --git a/src/ewmh.c b/src/ewmh.c index dbfae379..707c6cd3 100644 --- a/src/ewmh.c +++ b/src/ewmh.c @@ -274,14 +274,14 @@ EWMH_SetDesktopCount(void) EDBUG(6, "EWMH_SetDesktopCount"); - val = conf.desks.numdesktops; + val = conf.desks.num; _ATOM_SET_CARD32(_NET_NUMBER_OF_DESKTOPS, root.win, &val, 1); - for (i = 0; i < conf.desks.numdesktops; i++) + for (i = 0; i < conf.desks.num; i++) { wl[i] = desks.desk[i].win; } - _ATOM_SET_WINDOW(_NET_VIRTUAL_ROOTS, root.win, &wl, conf.desks.numdesktops); + _ATOM_SET_WINDOW(_NET_VIRTUAL_ROOTS, root.win, &wl, conf.desks.num); EDBUG_RETURN_; } @@ -295,7 +295,7 @@ EWMH_SetDesktopNames(void) EDBUG(6, "EWMH_SetDesktopNames"); s = buf; - for (i = 0; i < conf.desks.numdesktops; i++) + for (i = 0; i < conf.desks.num; i++) s += sprintf(s, "Desk-%d", i) + 1; _ATOM_SET_UTF8_STRING_LIST(_NET_DESKTOP_NAMES, root.win, buf, s - buf); @@ -325,11 +325,11 @@ EWMH_SetWorkArea(void) EDBUG(6, "EWMH_SetWorkArea"); - n_coord = 4 * conf.desks.numdesktops; + n_coord = 4 * conf.desks.num; p_coord = Emalloc(n_coord * sizeof(CARD32)); if (p_coord) { - for (i = 0; i < conf.desks.numdesktops; i++) + for (i = 0; i < conf.desks.num; i++) { p_coord[4 * i] = 0; p_coord[4 * i + 1] = 0; @@ -360,11 +360,11 @@ EWMH_SetDesktopViewport(void) int n_coord, i; EDBUG(6, "EWMH_SetDesktopViewport"); - n_coord = 2 * conf.desks.numdesktops; + n_coord = 2 * conf.desks.num; p_coord = Emalloc(n_coord * sizeof(CARD32)); if (p_coord) { - for (i = 0; i < conf.desks.numdesktops; i++) + for (i = 0; i < conf.desks.num; i++) { p_coord[2 * i] = desks.desk[i].current_area_x * root.w; p_coord[2 * i + 1] = desks.desk[i].current_area_y * root.h; diff --git a/src/finders.c b/src/finders.c index e3cbb0e0..7ea23c40 100644 --- a/src/finders.c +++ b/src/finders.c @@ -172,7 +172,7 @@ FindActionClass(Window win) EDBUG_RETURN(ewin->border->part[i].aclass); } - for (i = 0; i < conf.desks.numdesktops; i++) + for (i = 0; i < conf.desks.num; i++) { ActionClass *ac; diff --git a/src/gnome.c b/src/gnome.c index d69a35de..2ea2674c 100644 --- a/src/gnome.c +++ b/src/gnome.c @@ -613,7 +613,7 @@ GNOME_SetDeskCount(void) EDBUG(6, "GNOME_SetDeskCount"); if (!atom_set) atom_set = XInternAtom(disp, XA_WIN_WORKSPACE_COUNT, False); - val = conf.desks.numdesktops; + val = conf.desks.num; XChangeProperty(disp, root.win, atom_set, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1); EDBUG_RETURN_; @@ -648,17 +648,17 @@ GNOME_SetDeskNames(void) EDBUG(6, "GNOME_SetDeskNames"); if (!atom_set) atom_set = XInternAtom(disp, XA_WIN_WORKSPACE_NAMES, False); - for (i = 0; i < conf.desks.numdesktops; i++) + for (i = 0; i < conf.desks.num; i++) { Esnprintf(s, sizeof(s), "%i", i); names[i] = duplicate(s); } - if (XStringListToTextProperty(names, conf.desks.numdesktops, &text)) + if (XStringListToTextProperty(names, conf.desks.num, &text)) { XSetTextProperty(disp, root.win, &text, atom_set); XFree(text.value); } - for (i = 0; i < conf.desks.numdesktops; i++) + for (i = 0; i < conf.desks.num; i++) if (names[i]) Efree(names[i]); EDBUG_RETURN_; diff --git a/src/icccm.c b/src/icccm.c index 0a7b6849..f3be325c 100644 --- a/src/icccm.c +++ b/src/icccm.c @@ -595,7 +595,7 @@ ICCCM_GetGeoms(EWin * ewin, Atom atom_change) int dsk; dsk = ewin->desktop; - if ((dsk < 0) || (dsk >= conf.desks.numdesktops)) + if ((dsk < 0) || (dsk >= conf.desks.num)) dsk = desks.current; ewin->client.x -= desks.desk[dsk].x; ewin->client.y -= desks.desk[dsk].y; diff --git a/src/ipc.c b/src/ipc.c index 12fae4af..44321cee 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -3180,15 +3180,15 @@ IPC_FX(char *params, Client * c) word(params, 2, word2); if (!strcmp(word2, "on")) { - desks.slidein = 1; + conf.desks.slidein = 1; } else if (!strcmp(word2, "off")) { - desks.slidein = 0; + conf.desks.slidein = 0; } else if (!strcmp(word2, "?")) { - if (desks.slidein) + if (conf.desks.slidein) Esnprintf(buf, sizeof(buf), "deskslide: on"); else Esnprintf(buf, sizeof(buf), "deskslide: off"); @@ -3296,51 +3296,51 @@ IPC_FX(char *params, Client * c) move = 0; if (!strcmp(word2, "off")) { - desks.dragbar_width = 0; + conf.desks.dragbar_width = 0; move = 1; } else if (!strcmp(word2, "on")) { - desks.dragbar_width = 16; + conf.desks.dragbar_width = 16; move = 1; } else if (!strcmp(word2, "bottom")) { - desks.dragbar_width = 16; - desks.dragdir = 3; + conf.desks.dragbar_width = 16; + conf.desks.dragdir = 3; move = 1; } else if (!strcmp(word2, "right")) { - desks.dragbar_width = 16; - desks.dragdir = 1; + conf.desks.dragbar_width = 16; + conf.desks.dragdir = 1; move = 1; } else if (!strcmp(word2, "left")) { - desks.dragbar_width = 16; - desks.dragdir = 0; + conf.desks.dragbar_width = 16; + conf.desks.dragdir = 0; move = 1; } else if (!strcmp(word2, "top")) { - desks.dragbar_width = 16; - desks.dragdir = 2; + conf.desks.dragbar_width = 16; + conf.desks.dragdir = 2; move = 1; } else if (!strcmp(word2, "?")) { - if (desks.dragbar_width) + if (conf.desks.dragbar_width) { - if (desks.dragdir == 1) + if (conf.desks.dragdir == 1) { Esnprintf(buf, sizeof(buf), "Dragbar: right"); } - else if (desks.dragdir == 2) + else if (conf.desks.dragdir == 2) { Esnprintf(buf, sizeof(buf), "Dragbar: top"); } - else if (desks.dragdir == 3) + else if (conf.desks.dragdir == 3) { Esnprintf(buf, sizeof(buf), "Dragbar: bottom"); } @@ -4105,8 +4105,7 @@ IPC_NumDesks(char *params, Client * c) { if (!strcmp(params, "?")) { - Esnprintf(buf, sizeof(buf), "Number of Desks: %d", - conf.desks.numdesktops); + Esnprintf(buf, sizeof(buf), "Number of Desks: %d", conf.desks.num); } else { diff --git a/src/main.c b/src/main.c index 6b2e2012..0cf3ceb0 100644 --- a/src/main.c +++ b/src/main.c @@ -249,6 +249,7 @@ main(int argc, char **argv) desks.desk[0].viewable = 0; /* now we're going to load the configuration/theme */ LoadEConfig(themepath); + SetAreaSize(conf.areas.nx, conf.areas.ny); desks.desk[0].viewable = 1; RefreshDesktop(0); @@ -314,19 +315,19 @@ main(int argc, char **argv) /* let's make sure we set this up and go to our desk anyways */ ICCCM_GetMainEInfo(); GotoDesktop(desks.current); - if (desks.current < (conf.desks.numdesktops - 1)) + if (desks.current < (conf.desks.num - 1)) { char ps = 0; if (!conf.mapslide) { - ps = desks.slidein; - desks.slidein = 0; + ps = conf.desks.slidein; + conf.desks.slidein = 0; } GotoDesktop(desks.current + 1); GotoDesktop(desks.current - 1); if (!conf.mapslide) - desks.slidein = ps; + conf.desks.slidein = ps; } else if (desks.current > 0) { @@ -334,13 +335,13 @@ main(int argc, char **argv) if (!conf.mapslide) { - ps = desks.slidein; - desks.slidein = 0; + ps = conf.desks.slidein; + conf.desks.slidein = 0; } GotoDesktop(desks.current - 1); GotoDesktop(desks.current + 1); if (!conf.mapslide) - desks.slidein = ps; + conf.desks.slidein = ps; } XSync(disp, False); diff --git a/src/menus.c b/src/menus.c index 4824b281..a965581b 100644 --- a/src/menus.c +++ b/src/menus.c @@ -1838,7 +1838,7 @@ MenuCreateFromDesktops(char *name, MenuStyle * ms) m = MenuCreate(name); m->style = ms; lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN); - for (j = 0; j < conf.desks.numdesktops; j++) + for (j = 0; j < conf.desks.num; j++) { mm = MenuCreate("__SUBMENUDESK_E"); mm->style = ms; diff --git a/src/pager.c b/src/pager.c index 94112ac9..6cd57aad 100644 --- a/src/pager.c +++ b/src/pager.c @@ -329,7 +329,7 @@ PagerShow(Pager * p) { /* no snapshots ? first time ? make a row on the bottom left up */ MoveResizeEwin(ewin, 0, - root.h - (conf.desks.numdesktops - + root.h - (conf.desks.num - p->desktop) * ewin->h, ewin->client.w, ewin->client.h); } @@ -827,7 +827,7 @@ PagerEwinOutsideAreaUpdate(EWin * ewin) { int i; - for (i = 0; i < conf.desks.numdesktops; i++) + for (i = 0; i < conf.desks.num; i++) RedrawPagersForDesktop(i, 0); ForceUpdatePagersForDesktop(ewin->desktop); return; @@ -1393,7 +1393,7 @@ EnableAllPagers(void) if (!conf.pagers.enable) { conf.pagers.enable = 1; - for (i = 0; i < conf.desks.numdesktops; i++) + for (i = 0; i < conf.desks.num; i++) EnableSinglePagerForDesktop(i); UpdatePagerSel(); } @@ -1438,7 +1438,7 @@ DisableAllPagers(void) if (conf.pagers.enable) { - for (i = 0; i < conf.desks.numdesktops; i++) + for (i = 0; i < conf.desks.num; i++) DisablePagersForDesktop(i); conf.pagers.enable = 0; } diff --git a/src/settings.c b/src/settings.c index 9fc31dbe..c32d67d9 100644 --- a/src/settings.c +++ b/src/settings.c @@ -1116,7 +1116,7 @@ SettingsDesktops(void) } SoundPlay("SOUND_SETTINGS_DESKTOPS"); - tmp_desktops = conf.desks.numdesktops; + tmp_desktops = conf.desks.num; tmp_desktop_wraparound = conf.desks.wraparound; d = tmp_desk_dialog = DialogCreate("CONFIGURE_DESKTOPS"); @@ -2001,29 +2001,29 @@ CB_ConfigureFX(int val, void *data) conf.menusonscreen = tmp_menusonscreen; conf.mapslide = tmp_map_slide; conf.cleanupslide = tmp_cleanup_slide; - desks.slidein = tmp_desktop_slide; + conf.desks.slidein = tmp_desktop_slide; conf.animate_shading = tmp_animate_shading; conf.shadespeed = tmp_shade_speed; conf.slidemode = tmp_slide_mode; conf.slidespeedmap = tmp_map_slide_speed; conf.slidespeedcleanup = tmp_cleanup_slide_speed; - desks.slidespeed = tmp_desktop_slide_speed; + conf.desks.slidespeed = tmp_desktop_slide_speed; FX_Op("raindrops", tmp_effect_raindrops ? FX_OP_START : FX_OP_STOP); FX_Op("ripples", tmp_effect_ripples ? FX_OP_START : FX_OP_STOP); FX_Op("waves", tmp_effect_waves ? FX_OP_START : FX_OP_STOP); - if ((desks.dragdir != tmp_dragdir) || - ((tmp_dragbar) && (desks.dragbar_width < 1)) || - ((!tmp_dragbar) && (desks.dragbar_width > 0))) + if ((conf.desks.dragdir != tmp_dragdir) || + ((tmp_dragbar) && (conf.desks.dragbar_width < 1)) || + ((!tmp_dragbar) && (conf.desks.dragbar_width > 0))) { Button *b; if (tmp_dragbar) - desks.dragbar_width = 16; + conf.desks.dragbar_width = 16; else - desks.dragbar_width = -1; - desks.dragdir = tmp_dragdir; + conf.desks.dragbar_width = -1; + conf.desks.dragdir = tmp_dragdir; while ((b = RemoveItem("_DESKTOP_DRAG_CONTROL", 0, LIST_FINDBY_NAME, LIST_TYPE_BUTTON))) @@ -2056,18 +2056,18 @@ SettingsSpecialFX(void) tmp_menusonscreen = conf.menusonscreen; tmp_map_slide = conf.mapslide; tmp_cleanup_slide = conf.cleanupslide; - tmp_desktop_slide = desks.slidein; + tmp_desktop_slide = conf.desks.slidein; tmp_animate_shading = conf.animate_shading; - if (desks.dragbar_width < 1) + if (conf.desks.dragbar_width < 1) tmp_dragbar = 0; else tmp_dragbar = 1; - tmp_dragdir = desks.dragdir; + tmp_dragdir = conf.desks.dragdir; tmp_slide_mode = conf.slidemode; tmp_map_slide_speed = conf.slidespeedmap; tmp_shade_speed = conf.shadespeed; tmp_cleanup_slide_speed = conf.slidespeedcleanup; - tmp_desktop_slide_speed = desks.slidespeed; + tmp_desktop_slide_speed = conf.desks.slidespeed; tmp_effect_raindrops = FX_IsOn("raindrops"); tmp_effect_ripples = FX_IsOn("ripples"); @@ -2460,7 +2460,7 @@ CB_ConfigureBG(int val, void *data) if (val < 2) { conf.desktop_bg_timeout = tmp_bg_timeout; - desks.hiqualitybg = tmp_hiq; + conf.desks.hiqualitybg = tmp_hiq; conf.user_bg = tmp_userbg; ESetColor(&(tmp_bg->bg_solid), tmp_bg_r, tmp_bg_g, tmp_bg_b); tmp_bg->bg_tile = tmp_bg_tile; @@ -3298,7 +3298,7 @@ SettingsBackground(Background * bg) tmp_bg_yjust = 1024 - bg->bg.yjust; tmp_bg_xperc = bg->bg.xperc; tmp_bg_yperc = 1024 - bg->bg.yperc; - tmp_hiq = desks.hiqualitybg; + tmp_hiq = conf.desks.hiqualitybg; tmp_userbg = conf.user_bg; tmp_bg_timeout = conf.desktop_bg_timeout; diff --git a/src/setup.c b/src/setup.c index 3aec7fc0..f5830999 100644 --- a/src/setup.c +++ b/src/setup.c @@ -391,11 +391,20 @@ SetupX() /* Now we're going to set a bunch of default settings in E - in case we * don't ever get to load a config file for some odd reason. */ memset(&conf, 0, sizeof(EConf)); + conf.areas.nx = 2; + conf.areas.ny = 1; conf.areas.wraparound = 0; conf.autoraise.enable = 0; conf.autoraise.delay = 0.5; - conf.desks.numdesktops = 2; + conf.desks.num = 2; conf.desks.wraparound = 0; + conf.desks.dragdir = 2; + conf.desks.dragbar_width = 16; + conf.desks.dragbar_ordering = 1; + conf.desks.dragbar_length = 0; + conf.desks.slidein = 1; + conf.desks.slidespeed = 6000; + conf.desks.hiqualitybg = 1; conf.dialogs.headers = 0; conf.dock.dirmode = DOCK_DOWN; conf.dock.startx = 0; @@ -471,16 +480,6 @@ SetupX() conf.manual_placement = 0; conf.edge_flip_resistance = 15; - desks.dragdir = 2; - desks.dragbar_width = 16; - desks.dragbar_ordering = 1; - desks.dragbar_length = 0; - desks.slidein = 1; - desks.slidespeed = 6000; - desks.hiqualitybg = 1; - - SetAreaSize(2, 1); - ScreenInit(); MenusInit(); diff --git a/src/startup.c b/src/startup.c index db13fc9a..11c154df 100644 --- a/src/startup.c +++ b/src/startup.c @@ -209,16 +209,16 @@ CreateStartupDisplay(char start) EMapWindow(disp, win1); EMapWindow(disp, win2); - b1 = ECreateWindow(w1, 0, root.h - desks.dragbar_width, root.w, - desks.dragbar_width, 0); - b2 = ECreateWindow(w2, 0, 0, root.w, desks.dragbar_width, 0); + b1 = ECreateWindow(w1, 0, root.h - conf.desks.dragbar_width, root.w, + conf.desks.dragbar_width, 0); + b2 = ECreateWindow(w2, 0, 0, root.w, conf.desks.dragbar_width, 0); EMapRaised(disp, b1); EMapRaised(disp, b2); pq = queue_up; queue_up = 0; - IclassApply(ic, b1, root.w, desks.dragbar_width, 0, 0, 0, 0); - IclassApply(ic, b2, root.w, desks.dragbar_width, 0, 0, 0, 0); + IclassApply(ic, b1, root.w, conf.desks.dragbar_width, 0, 0, 0, 0); + IclassApply(ic, b2, root.w, conf.desks.dragbar_width, 0, 0, 0, 0); queue_up = pq; SetBackgroundTo(win1, bg, 1); SetBackgroundTo(win2, bg, 1);