Rename a few configuration items.

SVN revision: 25079
This commit is contained in:
Kim Woelders 2006-08-23 21:04:53 +00:00
parent a70c359080
commit fb8bd3e398
9 changed files with 48 additions and 43 deletions

25
src/E.h
View File

@ -250,6 +250,10 @@ typedef struct
int timeout; int timeout;
} backgrounds; } backgrounds;
struct struct
{
int move_resistance;
} buttons;
struct
{ {
unsigned int num; unsigned int num;
int dragdir; int dragdir;
@ -262,6 +266,7 @@ typedef struct
int areas_nx; int areas_nx;
int areas_ny; int areas_ny;
char areas_wraparound; char areas_wraparound;
int edge_flip_resistance;
} desks; } desks;
struct struct
{ {
@ -329,6 +334,9 @@ typedef struct
int slidespeedcleanup; int slidespeedcleanup;
char ignore_struts; char ignore_struts;
char raise_fullscreen; char raise_fullscreen;
#ifdef HAS_XINERAMA
char extra_head; /* Not used */
#endif
} place; } place;
struct struct
{ {
@ -340,6 +348,11 @@ typedef struct
char *cmd_halt; char *cmd_halt;
} session; } session;
struct struct
{
char animate;
int speed;
} shading;
struct
{ {
char enable; char enable;
int edge_snap_dist; int edge_snap_dist;
@ -383,6 +396,7 @@ typedef struct
char warp_on_select; char warp_on_select;
int icon_mode; int icon_mode;
} warplist; } warplist;
struct struct
{ {
char argb_internal_objects; char argb_internal_objects;
@ -391,19 +405,10 @@ typedef struct
char argb_clients_inherit_attr; char argb_clients_inherit_attr;
char use_sync; char use_sync;
} testing; } testing;
int deskmode;
char animate_shading;
int shadespeed;
int button_move_resistance;
char autosave; char autosave;
char memory_paranoia; char memory_paranoia;
char save_under; char save_under;
int edge_flip_resistance;
/* Not used */
#ifdef HAS_XINERAMA
char extra_head; /* Not used */
#endif
} }
EConf; EConf;

View File

@ -584,8 +584,8 @@ ButtonEventMotion(Button * b, XEvent * ev __UNUSED__)
x = -x; x = -x;
if (y < 0) if (y < 0)
y = -y; y = -y;
if ((x > Conf.button_move_resistance) || if ((x > Conf.buttons.move_resistance) ||
(y > Conf.button_move_resistance)) (y > Conf.buttons.move_resistance))
Mode_buttons.move_pending = 0; Mode_buttons.move_pending = 0;
Mode_buttons.action_inhibit = 1; Mode_buttons.action_inhibit = 1;
} }

View File

@ -2492,10 +2492,10 @@ CB_ConfigureAreas(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
{ {
if (tmp_edge_resist < 1) if (tmp_edge_resist < 1)
tmp_edge_resist = 1; tmp_edge_resist = 1;
Conf.edge_flip_resistance = tmp_edge_resist; Conf.desks.edge_flip_resistance = tmp_edge_resist;
} }
else else
Conf.edge_flip_resistance = 0; Conf.desks.edge_flip_resistance = 0;
EdgeWindowsShow(); EdgeWindowsShow();
} }
autosave(); autosave();
@ -2573,7 +2573,7 @@ _DlgFillAreas(Dialog * d __UNUSED__, DItem * table, void *data __UNUSED__)
char s[64]; char s[64];
tmp_area_wraparound = Conf.desks.areas_wraparound; tmp_area_wraparound = Conf.desks.areas_wraparound;
tmp_edge_resist = Conf.edge_flip_resistance; tmp_edge_resist = Conf.desks.edge_flip_resistance;
if (tmp_edge_resist == 0) if (tmp_edge_resist == 0)
tmp_edge_flip = 0; tmp_edge_flip = 0;
else else
@ -2927,6 +2927,7 @@ static const CfgItem DesksCfgItems[] = {
CFG_FUNC_INT(Conf.desks, areas_nx, 2, AreasCfgFuncSizeX), CFG_FUNC_INT(Conf.desks, areas_nx, 2, AreasCfgFuncSizeX),
CFG_FUNC_INT(Conf.desks, areas_ny, 1, AreasCfgFuncSizeY), CFG_FUNC_INT(Conf.desks, areas_ny, 1, AreasCfgFuncSizeY),
CFG_ITEM_BOOL(Conf.desks, areas_wraparound, 0), CFG_ITEM_BOOL(Conf.desks, areas_wraparound, 0),
CFG_ITEM_INT(Conf.desks, edge_flip_resistance, 25),
}; };
#define N_CFG_ITEMS (sizeof(DesksCfgItems)/sizeof(CfgItem)) #define N_CFG_ITEMS (sizeof(DesksCfgItems)/sizeof(CfgItem))

View File

@ -41,7 +41,7 @@ EdgeTimeout(int val, void *data __UNUSED__)
if (MenusActive()) if (MenusActive())
return; return;
if (!Conf.edge_flip_resistance) if (!Conf.desks.edge_flip_resistance)
return; return;
/* Quit if pointer has left screen */ /* Quit if pointer has left screen */
@ -110,14 +110,14 @@ EdgeEvent(int dir)
#if 0 #if 0
Eprintf("EdgeEvent %d -> %d\n", lastdir, dir); Eprintf("EdgeEvent %d -> %d\n", lastdir, dir);
#endif #endif
if (lastdir == dir || !Conf.edge_flip_resistance) if (lastdir == dir || !Conf.desks.edge_flip_resistance)
return; return;
RemoveTimerEvent("EDGE_TIMEOUT"); RemoveTimerEvent("EDGE_TIMEOUT");
if (dir >= 0) if (dir >= 0)
{ {
DoIn("EDGE_TIMEOUT", DoIn("EDGE_TIMEOUT",
((double)Conf.edge_flip_resistance) / 100.0, EdgeTimeout, ((double)Conf.desks.edge_flip_resistance) / 100.0, EdgeTimeout,
dir, NULL); dir, NULL);
} }
lastdir = dir; lastdir = dir;
@ -181,7 +181,7 @@ EdgeWindowsShow(void)
{ {
int ax, ay, cx, cy; int ax, ay, cx, cy;
if (Conf.edge_flip_resistance <= 0) if (Conf.desks.edge_flip_resistance <= 0)
{ {
EdgeWindowsHide(); EdgeWindowsHide();
return; return;

View File

@ -963,7 +963,7 @@ EwinShade(EWin * ewin)
if ((ewin->border) && (!strcmp(ewin->border->name, "BORDERLESS"))) if ((ewin->border) && (!strcmp(ewin->border->name, "BORDERLESS")))
return; return;
speed = Conf.shadespeed; speed = Conf.shading.speed;
x = EoGetX(ewin); x = EoGetX(ewin);
y = EoGetY(ewin); y = EoGetY(ewin);
@ -983,7 +983,7 @@ EwinShade(EWin * ewin)
EChangeWindowAttributes(EwinGetClientWin(ewin), CWWinGravity, &att); EChangeWindowAttributes(EwinGetClientWin(ewin), CWWinGravity, &att);
EwinBorderMinShadeSize(ewin, &b, &c); EwinBorderMinShadeSize(ewin, &b, &c);
a = w; a = w;
if ((Conf.animate_shading) || (ewin->type == EWIN_TYPE_MENU)) if ((Conf.shading.animate) || (ewin->type == EWIN_TYPE_MENU))
{ {
ETimedLoopInit(0, 1024, speed); ETimedLoopInit(0, 1024, speed);
for (k = 0; k < 1024;) for (k = 0; k < 1024;)
@ -1015,7 +1015,7 @@ EwinShade(EWin * ewin)
EwinBorderMinShadeSize(ewin, &b, &c); EwinBorderMinShadeSize(ewin, &b, &c);
a = w; a = w;
c = x + w; c = x + w;
if ((Conf.animate_shading) || (ewin->type == EWIN_TYPE_MENU)) if ((Conf.shading.animate) || (ewin->type == EWIN_TYPE_MENU))
{ {
ETimedLoopInit(0, 1024, speed); ETimedLoopInit(0, 1024, speed);
for (k = 0; k < 1024;) for (k = 0; k < 1024;)
@ -1047,7 +1047,7 @@ EwinShade(EWin * ewin)
EChangeWindowAttributes(EwinGetClientWin(ewin), CWWinGravity, &att); EChangeWindowAttributes(EwinGetClientWin(ewin), CWWinGravity, &att);
EwinBorderMinShadeSize(ewin, &c, &b); EwinBorderMinShadeSize(ewin, &c, &b);
a = h; a = h;
if ((Conf.animate_shading) || (ewin->type == EWIN_TYPE_MENU)) if ((Conf.shading.animate) || (ewin->type == EWIN_TYPE_MENU))
{ {
ETimedLoopInit(0, 1024, speed); ETimedLoopInit(0, 1024, speed);
for (k = 0; k < 1024;) for (k = 0; k < 1024;)
@ -1079,7 +1079,7 @@ EwinShade(EWin * ewin)
EwinBorderMinShadeSize(ewin, &c, &b); EwinBorderMinShadeSize(ewin, &c, &b);
a = h; a = h;
c = y + h; c = y + h;
if ((Conf.animate_shading) || (ewin->type == EWIN_TYPE_MENU)) if ((Conf.shading.animate) || (ewin->type == EWIN_TYPE_MENU))
{ {
ETimedLoopInit(0, 1024, speed); ETimedLoopInit(0, 1024, speed);
for (k = 0; k < 1024;) for (k = 0; k < 1024;)
@ -1137,7 +1137,7 @@ EwinUnShade(EWin * ewin)
if (!ewin->state.shaded || ewin->state.iconified) if (!ewin->state.shaded || ewin->state.iconified)
return; return;
speed = Conf.shadespeed; speed = Conf.shading.speed;
x = EoGetX(ewin); x = EoGetX(ewin);
y = EoGetY(ewin); y = EoGetY(ewin);
@ -1166,7 +1166,7 @@ EwinUnShade(EWin * ewin)
ewin->client.w, ewin->client.h); ewin->client.w, ewin->client.h);
EMapWindow(EwinGetClientWin(ewin)); EMapWindow(EwinGetClientWin(ewin));
EMapWindow(ewin->win_container); EMapWindow(ewin->win_container);
if ((Conf.animate_shading) || (ewin->type == EWIN_TYPE_MENU)) if ((Conf.shading.animate) || (ewin->type == EWIN_TYPE_MENU))
{ {
ETimedLoopInit(0, 1024, speed); ETimedLoopInit(0, 1024, speed);
for (k = 0; k < 1024;) for (k = 0; k < 1024;)
@ -1204,7 +1204,7 @@ EwinUnShade(EWin * ewin)
ewin->client.h); ewin->client.h);
EMapWindow(EwinGetClientWin(ewin)); EMapWindow(EwinGetClientWin(ewin));
EMapWindow(ewin->win_container); EMapWindow(ewin->win_container);
if ((Conf.animate_shading) || (ewin->type == EWIN_TYPE_MENU)) if ((Conf.shading.animate) || (ewin->type == EWIN_TYPE_MENU))
{ {
ETimedLoopInit(0, 1024, speed); ETimedLoopInit(0, 1024, speed);
for (k = 0; k < 1024;) for (k = 0; k < 1024;)
@ -1242,7 +1242,7 @@ EwinUnShade(EWin * ewin)
ewin->client.w, ewin->client.h); ewin->client.w, ewin->client.h);
EMapWindow(EwinGetClientWin(ewin)); EMapWindow(EwinGetClientWin(ewin));
EMapWindow(ewin->win_container); EMapWindow(ewin->win_container);
if ((Conf.animate_shading) || (ewin->type == EWIN_TYPE_MENU)) if ((Conf.shading.animate) || (ewin->type == EWIN_TYPE_MENU))
{ {
ETimedLoopInit(0, 1024, speed); ETimedLoopInit(0, 1024, speed);
for (k = 0; k < 1024;) for (k = 0; k < 1024;)
@ -1280,7 +1280,7 @@ EwinUnShade(EWin * ewin)
ewin->client.w, ewin->client.h); ewin->client.w, ewin->client.h);
EMapWindow(EwinGetClientWin(ewin)); EMapWindow(EwinGetClientWin(ewin));
EMapWindow(ewin->win_container); EMapWindow(ewin->win_container);
if ((Conf.animate_shading) || (ewin->type == EWIN_TYPE_MENU)) if ((Conf.shading.animate) || (ewin->type == EWIN_TYPE_MENU))
{ {
ETimedLoopInit(0, 1024, speed); ETimedLoopInit(0, 1024, speed);
for (k = 0; k < 1024;) for (k = 0; k < 1024;)

View File

@ -1555,7 +1555,7 @@ SubmenuShowTimeout(int val __UNUSED__, void *dat)
/* Disable menu item events while sliding */ /* Disable menu item events while sliding */
MenusSetEvents(0); MenusSetEvents(0);
SlideEwinsTo(menus, fx, fy, tx, ty, i, Conf.shadespeed); SlideEwinsTo(menus, fx, fy, tx, ty, i, Conf.shading.speed);
MenusSetEvents(1); MenusSetEvents(1);
if (Conf.menus.warp) if (Conf.menus.warp)

View File

@ -108,6 +108,8 @@ MiscSighan(int sig, void *prm __UNUSED__)
static const CfgItem MiscCfgItems[] = { static const CfgItem MiscCfgItems[] = {
CFG_ITEM_INT(Conf, buttons.move_resistance, 10),
CFG_ITEM_BOOL(Conf, dialogs.headers, 0), CFG_ITEM_BOOL(Conf, dialogs.headers, 0),
CFG_ITEM_BOOL(Conf, dialogs.button_image, 0), CFG_ITEM_BOOL(Conf, dialogs.button_image, 0),
@ -145,6 +147,9 @@ static const CfgItem MiscCfgItems[] = {
CFG_ITEM_STR(Conf, session.cmd_reboot), CFG_ITEM_STR(Conf, session.cmd_reboot),
CFG_ITEM_STR(Conf, session.cmd_halt), CFG_ITEM_STR(Conf, session.cmd_halt),
CFG_ITEM_BOOL(Conf, shading.animate, 1),
CFG_ITEM_INT(Conf, shading.speed, 8000),
CFG_ITEM_BOOL(Conf, snap.enable, 1), CFG_ITEM_BOOL(Conf, snap.enable, 1),
CFG_ITEM_INT(Conf, snap.edge_snap_dist, 8), CFG_ITEM_INT(Conf, snap.edge_snap_dist, 8),
CFG_ITEM_INT(Conf, snap.screen_snap_dist, 32), CFG_ITEM_INT(Conf, snap.screen_snap_dist, 32),
@ -158,14 +163,9 @@ static const CfgItem MiscCfgItems[] = {
CFG_ITEM_BOOL(Conf, testing.argb_clients_inherit_attr, 0), CFG_ITEM_BOOL(Conf, testing.argb_clients_inherit_attr, 0),
CFG_ITEM_BOOL(Conf, testing.use_sync, 1), CFG_ITEM_BOOL(Conf, testing.use_sync, 1),
CFG_ITEM_INT(Conf, deskmode, MODE_NONE),
CFG_ITEM_BOOL(Conf, animate_shading, 1),
CFG_ITEM_INT(Conf, shadespeed, 8000),
CFG_ITEM_INT(Conf, button_move_resistance, 5),
CFG_ITEM_BOOL(Conf, autosave, 1), CFG_ITEM_BOOL(Conf, autosave, 1),
CFG_ITEM_BOOL(Conf, memory_paranoia, 1), CFG_ITEM_BOOL(Conf, memory_paranoia, 1),
CFG_ITEM_BOOL(Conf, save_under, 0), CFG_ITEM_BOOL(Conf, save_under, 0),
CFG_ITEM_INT(Conf, edge_flip_resistance, 25),
}; };
#define N_CFG_ITEMS ((int)(sizeof(MiscCfgItems)/sizeof(CfgItem))) #define N_CFG_ITEMS ((int)(sizeof(MiscCfgItems)/sizeof(CfgItem)))

View File

@ -69,7 +69,6 @@ ScreenInit(void)
return; return;
Mode.display.xinerama_active = XineramaIsActive(disp); Mode.display.xinerama_active = XineramaIsActive(disp);
Conf.extra_head = 0;
if (Mode.display.xinerama_active) if (Mode.display.xinerama_active)
screens = XineramaQueryScreens(disp, &num_screens); screens = XineramaQueryScreens(disp, &num_screens);

View File

@ -207,14 +207,14 @@ CB_ConfigurePlacement(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
Conf.place.slidespeedmap = tmp_map_slide_speed; Conf.place.slidespeedmap = tmp_map_slide_speed;
Conf.place.slidespeedcleanup = tmp_cleanup_slide_speed; Conf.place.slidespeedcleanup = tmp_cleanup_slide_speed;
Conf.animate_shading = tmp_animate_shading; Conf.shading.animate = tmp_animate_shading;
Conf.shadespeed = tmp_shade_speed; Conf.shading.speed = tmp_shade_speed;
Conf.place.ignore_struts = tmp_place_ignore_struts; Conf.place.ignore_struts = tmp_place_ignore_struts;
Conf.place.raise_fullscreen = tmp_raise_fullscreen; Conf.place.raise_fullscreen = tmp_raise_fullscreen;
#ifdef HAS_XINERAMA #ifdef HAS_XINERAMA
if (Mode.display.xinerama_active) if (Mode.display.xinerama_active)
Conf.extra_head = tmp_extra_head; Conf.place.extra_head = tmp_extra_head;
#endif #endif
} }
autosave(); autosave();
@ -237,14 +237,14 @@ _DlgFillPlacement(Dialog * d __UNUSED__, DItem * table, void *data __UNUSED__)
tmp_map_slide_speed = Conf.place.slidespeedmap; tmp_map_slide_speed = Conf.place.slidespeedmap;
tmp_cleanup_slide_speed = Conf.place.slidespeedcleanup; tmp_cleanup_slide_speed = Conf.place.slidespeedcleanup;
tmp_animate_shading = Conf.animate_shading; tmp_animate_shading = Conf.shading.animate;
tmp_shade_speed = Conf.shadespeed; tmp_shade_speed = Conf.shading.speed;
tmp_place_ignore_struts = Conf.place.ignore_struts; tmp_place_ignore_struts = Conf.place.ignore_struts;
tmp_raise_fullscreen = Conf.place.raise_fullscreen; tmp_raise_fullscreen = Conf.place.raise_fullscreen;
#ifdef HAS_XINERAMA #ifdef HAS_XINERAMA
tmp_extra_head = Conf.extra_head; tmp_extra_head = Conf.place.extra_head;
#endif #endif
DialogItemTableSetOptions(table, 2, 0, 1, 0); DialogItemTableSetOptions(table, 2, 0, 1, 0);
@ -368,7 +368,7 @@ _DlgFillPlacement(Dialog * d __UNUSED__, DItem * table, void *data __UNUSED__)
DialogItemSetText(di, _("Raise fullscreen windows")); DialogItemSetText(di, _("Raise fullscreen windows"));
DialogItemCheckButtonSetPtr(di, &tmp_raise_fullscreen); DialogItemCheckButtonSetPtr(di, &tmp_raise_fullscreen);
#ifdef HAS_XINERAMA #ifdef HAS_XINERAMA_no /* Not implemented */
if (Mode.display.xinerama_active) if (Mode.display.xinerama_active)
{ {
di = DialogAddItem(table, DITEM_CHECKBUTTON); di = DialogAddItem(table, DITEM_CHECKBUTTON);