diff --git a/src/E.h b/src/E.h index 1467581b..1a9c7c3a 100644 --- a/src/E.h +++ b/src/E.h @@ -377,7 +377,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)) % mode.numdesktops) + (((unsigned int) (x)) % conf.desks.numdesktops) #define LIST_FINDBY_NAME 0 #define LIST_FINDBY_ID 1 @@ -1156,38 +1156,80 @@ typedef struct _windowmatch } WindowMatch; -typedef struct _emode +/* Configuration parameters */ +typedef struct { - int mode; + struct + { + char wraparound; + } areas; + struct + { + char wraparound; + char numdesktops; + } desks; + struct + { + char headers; + } dialogs; + struct + { + char dirmode; + int startx; + int starty; + } dock; + struct + { + int mode; + char clickraises; + char transientsfollowleader; + char switchfortransientmap; + char all_new_windows_get_focus; + char new_transients_get_focus; + char new_transients_get_focus_if_group_focused; + char raise_on_next_focus; + char raise_after_next_focus; + char warp_on_next_focus; + char warp_after_next_focus; + } focus; + struct + { + char set_xroot_info_on_root_window; + } hints; + struct + { + char enable; + char zoom; + char title; + char hiq; + char snap; + int scanspeed; + int sel_button; + int win_button; + int menu_button; + } pagers; + struct + { + char enable; + int edge_snap_dist; + int screen_snap_dist; + } snap; + struct + { + char enable; + char showroottooltip; + double tiptime; + } tooltips; + struct + { + signed char enable; + char warpsticky; + char warpshaded; + char warpiconified; + char warpfocused; + } warplist; int deskmode; - char place; - char flipp; - char startup; - char xselect; - int next_move_x_plus; - int next_move_y_plus; - EWin *ewin; - Button *button; - int resize_detail; - int win_x, win_y, win_w, win_h; - int start_x, start_y; - char noewin; - char have_place_grab; - char action_inhibit; - char justclicked; - int focusmode; - char dockdirmode; - char primaryicondir; - char click_focus_grabbed; - EWin *focuswin; - EWin *realfocuswin; - EWin *mouse_over_win; - EWin *context_ewin; - int px, py, x, y; - char firstlast; int movemode; - int swapmovemode; - int swapcoord_x, swapcoord_y; int resizemode; int geominfomode; int slidemode; @@ -1197,88 +1239,85 @@ typedef struct _emode int slidespeedcleanup; char animate_shading; int shadespeed; - char doingslide; - int server_grabbed; int desktop_bg_timeout; - int deskdrag; char sound; int button_move_resistance; - char button_move_pending; - Colormap current_cmap; char autosave; char memory_paranoia; - Slideout *slideout; - Window context_win; - char tooltips; - double tiptime; char autoraise; double autoraisetime; char dockapp_support; /* wmdockapp only */ - int dockstartx; - int dockstarty; char save_under; + char menuslide; + char menusonscreen; + char manual_placement; + char manual_placement_mouse_pointer; + char warpmenus; + int edge_flip_resistance; + char user_bg; + GroupConfig group_config; + char group_swapmove; + + /* Not used */ + char primaryicondir; +#ifdef HAS_XINERAMA + char extra_head; /* Not used */ +#endif +#if 0 /* Not used */ + TextClass *icon_textclass; + int icon_mode; +#endif +} +EConf; + +/* State parameters */ +typedef struct +{ + int mode; + char place; + char flipp; + char startup; + char xselect; + int next_move_x_plus, next_move_y_plus; + EWin *ewin; + Button *button; + int resize_detail; + int win_x, win_y, win_w, win_h; + int start_x, start_y; + char noewin; + char have_place_grab; + char action_inhibit; + char justclicked; + char click_focus_grabbed; + EWin *focuswin; + EWin *realfocuswin; + EWin *mouse_over_win; + EWin *context_ewin; + EWin *moveresize_pending_ewin; + int px, py, x, y; + char firstlast; + int swapmovemode; + int swapcoord_x, swapcoord_y; + char doingslide; + int server_grabbed; + int deskdrag; + char button_move_pending; + Colormap current_cmap; + Slideout *slideout; + Window context_win; char cur_menu_mode; int cur_menu_depth; Menu *cur_menu[256]; - char menuslide; - char menusonscreen; - char warpmenus; - char warpsticky; - char warpshaded; - char warpiconified; - char warpfocused; - char numdesktops; - char transientsfollowleader; - char switchfortransientmap; - char snap; - int edge_snap_dist; - int screen_snap_dist; Window menu_cover_win; Window menu_win_covered; - char all_new_windows_get_focus; - char new_transients_get_focus; - char new_transients_get_focus_if_group_focused; - char manual_placement; - char manual_placement_mouse_pointer; -#ifdef HAS_XINERAMA - char extra_head; -#endif - char raise_on_next_focus; - char raise_after_next_focus; - signed char display_warp; - char warp_on_next_focus; - char warp_after_next_focus; - int edge_flip_resistance; - EWin *moveresize_pending_ewin; char borderpartpress; char windowdestroy; - int context_w; - int context_h; - char show_pagers; + int context_w, context_h; Pager *context_pager; - char pager_hiq; - char pager_snap; - char user_bg; - char pager_zoom; - char pager_title; char constrained; - int pager_scanspeed; - TextClass *icon_textclass; - int icon_mode; char nogroup; - GroupConfig group_config; - char group_swapmove; - char clickalways; char keybinds_changed; char firsttime; - char showroottooltip; - int pager_sel_button; - int pager_win_button; - int pager_menu_button; - char area_wraparound; - char dialog_headers; - char desktop_wraparound; - char hints_set_xroot_info_on_root_window; } EMode; @@ -2786,12 +2825,11 @@ extern FnlibData *pFnlibData; #endif extern List *lists; extern int event_base_shape; -extern Window comms_win; extern Root root; extern int (*(ActionFunctions[ACTION_NUMBEROF])) (void *); +extern EConf conf; extern EMode mode; extern Desktops desks; -extern Window grab_window; extern Window init_win1; extern Window init_win2; extern Window init_win_ext; diff --git a/src/actions.c b/src/actions.c index aec26ae3..de3378e0 100644 --- a/src/actions.c +++ b/src/actions.c @@ -363,7 +363,7 @@ EventAclass(XEvent * ev, ActionClass * a) EWin *ewin; ewin = mode.ewin; - if ((mode.movemode == 0) && (ewin) && (mode.mode == MODE_MOVE)) + if ((conf.movemode == 0) && (ewin) && (mode.mode == MODE_MOVE)) DetermineEwinFloat(ewin, 0, 0); } @@ -536,7 +536,7 @@ spawnMenu(void *params) EDBUG_RETURN(0); ewin = mode.ewin = GetFocusEwin(); - for (i = 0; i < mode.numdesktops; i++) + for (i = 0; i < conf.desks.numdesktops; i++) { if (mode.context_win == desks.desk[i].win) { @@ -871,7 +871,7 @@ doResize(void *params) EDBUG_RETURN(0); if (ewin->shaded) EDBUG_RETURN(0); - if (mode.resizemode > 0) + if (conf.resizemode > 0) { FX_Pause(); GrabX(); @@ -900,7 +900,7 @@ doResize(void *params) mode.win_w = ewin->client.w; mode.win_h = ewin->client.h; mode.firstlast = 0; - DrawEwinShape(ewin, mode.resizemode, ewin->x, ewin->y, ewin->client.w, + DrawEwinShape(ewin, conf.resizemode, ewin->x, ewin->y, ewin->client.w, ewin->client.h, mode.firstlast); mode.firstlast = 1; params = NULL; @@ -925,7 +925,7 @@ doResizeH(void *params) EDBUG_RETURN(0); if (ewin->shaded) EDBUG_RETURN(0); - if (mode.resizemode > 0) + if (conf.resizemode > 0) { FX_Pause(); GrabX(); @@ -948,7 +948,7 @@ doResizeH(void *params) mode.win_w = ewin->client.w; mode.win_h = ewin->client.h; mode.firstlast = 0; - DrawEwinShape(ewin, mode.resizemode, ewin->x, ewin->y, ewin->client.w, + DrawEwinShape(ewin, conf.resizemode, ewin->x, ewin->y, ewin->client.w, ewin->client.h, mode.firstlast); mode.firstlast = 1; params = NULL; @@ -973,7 +973,7 @@ doResizeV(void *params) EDBUG_RETURN(0); if (ewin->shaded) EDBUG_RETURN(0); - if (mode.resizemode > 0) + if (conf.resizemode > 0) { FX_Pause(); GrabX(); @@ -996,7 +996,7 @@ doResizeV(void *params) mode.win_w = ewin->client.w; mode.win_h = ewin->client.h; mode.firstlast = 0; - DrawEwinShape(ewin, mode.resizemode, ewin->x, ewin->y, ewin->client.w, + DrawEwinShape(ewin, conf.resizemode, ewin->x, ewin->y, ewin->client.w, ewin->client.h, mode.firstlast); mode.firstlast = 1; params = NULL; @@ -1015,7 +1015,7 @@ doResizeEnd(void *params) SoundPlay("SOUND_RESIZE_STOP"); if (!ewin) { - if (mode.resizemode > 0) + if (conf.resizemode > 0) UngrabX(); ForceUpdatePagersForDesktop(desks.current); EDBUG_RETURN(0); @@ -1026,14 +1026,14 @@ doResizeEnd(void *params) mode.ewin = NULL; mode.noewin = 0; mode.firstlast = 2; - DrawEwinShape(ewin, mode.resizemode, ewin->x, ewin->y, ewin->client.w, + DrawEwinShape(ewin, conf.resizemode, ewin->x, ewin->y, ewin->client.w, ewin->client.h, mode.firstlast); for (i = 0; i < ewin->border->num_winparts; i++) ewin->bits[i].no_expose = 1; ICCCM_Configure(ewin); HideCoords(); XSync(disp, False); - if (mode.resizemode > 0) + if (conf.resizemode > 0) { FX_Pause(); UngrabX(); @@ -1070,10 +1070,10 @@ doMoveImpl(void *params, char constrained) if (ewin->fixedpos) EDBUG_RETURN(0); mode.moveresize_pending_ewin = ewin; - real_move_mode = mode.movemode; - if (((ewin->groups) || (ewin->has_transients)) && (mode.movemode > 0)) - mode.movemode = 0; - if (mode.movemode > 0) + real_move_mode = conf.movemode; + if (((ewin->groups) || (ewin->has_transients)) && (conf.movemode > 0)) + conf.movemode = 0; + if (conf.movemode > 0) { FX_Pause(); GrabX(); @@ -1098,7 +1098,7 @@ doMoveImpl(void *params, char constrained) { FloatEwinAt(gwins[i], gwins[i]->x, gwins[i]->y); if (!mode.moveresize_pending_ewin) - DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x, gwins[i]->y, + DrawEwinShape(gwins[i], conf.movemode, gwins[i]->x, gwins[i]->y, gwins[i]->client.w, gwins[i]->client.h, mode.firstlast); } @@ -1156,11 +1156,11 @@ doMoveEnd(void *params) SoundPlay("SOUND_MOVE_STOP"); if (!ewin) { - if (mode.movemode > 0) + if (conf.movemode > 0) UngrabX(); if (!mode.moveresize_pending_ewin) ForceUpdatePagersForDesktop(desks.current); - mode.movemode = real_move_mode; + conf.movemode = real_move_mode; EDBUG_RETURN(0); } mode.mode = MODE_NONE; @@ -1177,7 +1177,7 @@ doMoveEnd(void *params) { wasresize = 1; for (i = 0; i < num; i++) - DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x, gwins[i]->y, + DrawEwinShape(gwins[i], conf.movemode, gwins[i]->x, gwins[i]->y, gwins[i]->client.w, gwins[i]->client.h, mode.firstlast); for (i = 0; i < num; i++) @@ -1186,7 +1186,7 @@ doMoveEnd(void *params) mode.moveresize_pending_ewin = NULL; for (i = 0; i < num; i++) { - if ((gwins[i]->floating) || (mode.movemode > 0)) + if ((gwins[i]->floating) || (conf.movemode > 0)) { if (gwins[i]->floating) MoveEwinToDesktopAt(gwins[i], d, @@ -1200,7 +1200,7 @@ doMoveEnd(void *params) MoveEwinToDesktopAt(gwins[i], d, gwins[i]->x, gwins[i]->y); gwins[i]->floating = 0; } - if ((mode.movemode > 0) && (gwins[i]->has_transients)) + if ((conf.movemode > 0) && (gwins[i]->has_transients)) { EWin **lst; int j, num2; @@ -1223,7 +1223,7 @@ doMoveEnd(void *params) mode.firstlast = 0; HideCoords(); XSync(disp, False); - if (mode.movemode > 0) + if (conf.movemode > 0) { FX_Pause(); UngrabX(); @@ -1232,7 +1232,7 @@ doMoveEnd(void *params) if (wasresize) ForceUpdatePagersForDesktop(desks.current); Efree(gwins); - mode.movemode = real_move_mode; + conf.movemode = real_move_mode; params = NULL; mode.nogroup = 0; mode.swapmovemode = 0; @@ -1340,8 +1340,8 @@ doCleanup(void *params) type = (char *)params; method = ARRANGE_BY_SIZE; - speed = mode.slidespeedcleanup; - doslide = mode.cleanupslide; + speed = conf.slidespeedcleanup; + doslide = conf.cleanupslide; if (params) { @@ -1564,7 +1564,7 @@ doNextDesktop(void *params) pd = desks.current; nd = desks.current + 1; - if (mode.desktop_wraparound && (nd >= mode.numdesktops)) + if (conf.desks.wraparound && (nd >= conf.desks.numdesktops)) nd = 0; GotoDesktop(nd); @@ -1586,8 +1586,8 @@ doPrevDesktop(void *params) pd = desks.current; nd = desks.current - 1; - if (mode.desktop_wraparound && (nd < 0)) - nd = mode.numdesktops - 1; + if (conf.desks.wraparound && (nd < 0)) + nd = conf.desks.numdesktops - 1; GotoDesktop(nd); if (desks.current != pd) @@ -1952,20 +1952,20 @@ doFocusModeSet(void *params) if (params) { if (!strcmp("pointer", (char *)params)) - mode.focusmode = FOCUS_POINTER; + conf.focus.mode = FOCUS_POINTER; else if (!strcmp("sloppy", (char *)params)) - mode.focusmode = FOCUS_SLOPPY; + conf.focus.mode = FOCUS_SLOPPY; else if (!strcmp("click", (char *)params)) - mode.focusmode = FOCUS_CLICK; + conf.focus.mode = FOCUS_CLICK; } else { - if (mode.focusmode == FOCUS_POINTER) - mode.focusmode = FOCUS_SLOPPY; - else if (mode.focusmode == FOCUS_SLOPPY) - mode.focusmode = FOCUS_CLICK; - else if (mode.focusmode == FOCUS_CLICK) - mode.focusmode = FOCUS_POINTER; + if (conf.focus.mode == FOCUS_POINTER) + conf.focus.mode = FOCUS_SLOPPY; + else if (conf.focus.mode == FOCUS_SLOPPY) + conf.focus.mode = FOCUS_CLICK; + else if (conf.focus.mode == FOCUS_CLICK) + conf.focus.mode = FOCUS_POINTER; } FixFocus(); autosave(); @@ -1981,17 +1981,17 @@ doMoveModeSet(void *params) EDBUG_RETURN(0); if (params) { - mode.movemode = atoi((char *)params); + conf.movemode = atoi((char *)params); } else { - mode.movemode++; - if (mode.movemode > 5) - mode.movemode = 0; + conf.movemode++; + if (conf.movemode > 5) + conf.movemode = 0; } #if !USE_IMLIB2 - if ((prImlib_Context) && (mode.movemode == 5)) - mode.movemode = 3; + if ((prImlib_Context) && (conf.movemode == 5)) + conf.movemode = 3; #endif autosave(); EDBUG_RETURN(0); @@ -2006,16 +2006,16 @@ doResizeModeSet(void *params) EDBUG_RETURN(0); if (params) { - mode.resizemode = atoi((char *)params); + conf.resizemode = atoi((char *)params); } else { - mode.resizemode++; - if (mode.resizemode > 4) - mode.resizemode = 0; + conf.resizemode++; + if (conf.resizemode > 4) + conf.resizemode = 0; } - if (mode.resizemode == 5) - mode.resizemode = 3; + if (conf.resizemode == 5) + conf.resizemode = 3; autosave(); EDBUG_RETURN(0); } @@ -2026,13 +2026,13 @@ doSlideModeSet(void *params) EDBUG(6, "doSlideModeSet"); if (params) { - mode.slidemode = atoi((char *)params); + conf.slidemode = atoi((char *)params); } else { - mode.slidemode++; - if (mode.slidemode > 4) - mode.slidemode = 0; + conf.slidemode++; + if (conf.slidemode > 4) + conf.slidemode = 0; } autosave(); EDBUG_RETURN(0); @@ -2044,14 +2044,14 @@ doCleanupSlideSet(void *params) EDBUG(6, "doCleanupSlideSet"); if (params) { - mode.cleanupslide = atoi((char *)params); + conf.cleanupslide = atoi((char *)params); } else { - if (mode.cleanupslide) - mode.cleanupslide = 0; + if (conf.cleanupslide) + conf.cleanupslide = 0; else - mode.cleanupslide = 1; + conf.cleanupslide = 1; } autosave(); EDBUG_RETURN(0); @@ -2062,13 +2062,13 @@ doMapSlideSet(void *params) { EDBUG(6, "doMapSlideSet"); if (params) - mode.mapslide = atoi((char *)params); + conf.mapslide = atoi((char *)params); else { - if (mode.mapslide) - mode.mapslide = 0; + if (conf.mapslide) + conf.mapslide = 0; else - mode.mapslide = 1; + conf.mapslide = 1; } autosave(); EDBUG_RETURN(0); @@ -2080,19 +2080,19 @@ doSoundSet(void *params) char snd; EDBUG(6, "doSoundSet"); - snd = mode.sound; + snd = conf.sound; if (params) - mode.sound = atoi((char *)params); + conf.sound = atoi((char *)params); else { - if (mode.sound) - mode.sound = 0; + if (conf.sound) + conf.sound = 0; else - mode.sound = 1; + conf.sound = 1; } - if (mode.sound != snd) + if (conf.sound != snd) { - if (mode.sound) + if (conf.sound) SoundInit(); else SoundExit(); @@ -2106,7 +2106,7 @@ doButtonMoveResistSet(void *params) { EDBUG(6, "doButtonMoveResistSet"); if (params) - mode.button_move_resistance = atoi((char *)params); + conf.button_move_resistance = atoi((char *)params); autosave(); EDBUG_RETURN(0); } @@ -2116,7 +2116,7 @@ doDesktopBgTimeoutSet(void *params) { EDBUG(6, "doDesktopBgTimeoutSet"); if (params) - mode.desktop_bg_timeout = atoi((char *)params); + conf.desktop_bg_timeout = atoi((char *)params); autosave(); EDBUG_RETURN(0); } @@ -2126,7 +2126,7 @@ doMapSlideSpeedSet(void *params) { EDBUG(6, "doMapSlideSpeedSet"); if (params) - mode.slidespeedmap = atoi((char *)params); + conf.slidespeedmap = atoi((char *)params); autosave(); EDBUG_RETURN(0); } @@ -2136,7 +2136,7 @@ doCleanupSlideSpeedSet(void *params) { EDBUG(6, "doCleanupSlideSpeedSet"); if (params) - mode.slidespeedcleanup = atoi((char *)params); + conf.slidespeedcleanup = atoi((char *)params); autosave(); EDBUG_RETURN(0); } @@ -2337,24 +2337,24 @@ doDeskray(void *params) if (!atoi((char *)params)) { HideDesktopTabs(); - mode.deskmode = MODE_NONE; + conf.deskmode = MODE_NONE; } else { - mode.deskmode = MODE_DESKRAY; + conf.deskmode = MODE_DESKRAY; ShowDesktopTabs(); } } else { - if (mode.deskmode == MODE_DESKRAY) + if (conf.deskmode == MODE_DESKRAY) { HideDesktopTabs(); - mode.deskmode = MODE_NONE; + conf.deskmode = MODE_NONE; } else { - mode.deskmode = MODE_DESKRAY; + conf.deskmode = MODE_DESKRAY; ShowDesktopTabs(); } } @@ -2366,13 +2366,13 @@ doAutosaveSet(void *params) { EDBUG(6, "doAutosaveSet"); if (params) - mode.autosave = atoi((char *)params); + conf.autosave = atoi((char *)params); else { - if (mode.autosave) - mode.autosave = 0; + if (conf.autosave) + conf.autosave = 0; else - mode.autosave = 1; + conf.autosave = 1; } EDBUG_RETURN(0); } @@ -2804,13 +2804,9 @@ doToolTipSet(void *params) EDBUG(6, "doToolTipSet"); if (params) - mode.tooltips = atoi((char *)params); + conf.tooltips.enable = atoi((char *)params); else - { - mode.tooltips++; - if (mode.tooltips > 1) - mode.tooltips = 0; - } + conf.tooltips.enable = !conf.tooltips.enable; autosave(); EDBUG_RETURN(0); } @@ -2858,9 +2854,9 @@ doFocusSet(void *params) DeIconifyEwin(ewin); if (ewin->shaded) UnShadeEwin(ewin); - if (mode.raise_on_next_focus || mode.raise_after_next_focus) + if (conf.focus.raise_on_next_focus || conf.focus.raise_after_next_focus) RaiseEwin(ewin); - if (mode.warp_on_next_focus) + if (conf.focus.warp_on_next_focus) XWarpPointer(disp, None, ewin->win, 0, 0, 0, 0, ewin->w / 2, ewin->h / 2); FocusToEWin(ewin); diff --git a/src/areas.c b/src/areas.c index a56bcbda..0097124a 100644 --- a/src/areas.c +++ b/src/areas.c @@ -29,28 +29,28 @@ static int area_h = 3; #define AREA_FIX(ax, ay) \ if (ax < 0) \ { \ -if (mode.area_wraparound) \ +if (conf.areas.wraparound) \ ax = area_w - 1; \ else \ ax = 0; \ } \ else if (ax >= area_w) \ { \ -if (mode.area_wraparound) \ +if (conf.areas.wraparound) \ ax = 0; \ else \ ax = area_w - 1; \ } \ if (ay < 0) \ { \ -if (mode.area_wraparound) \ +if (conf.areas.wraparound) \ ay = area_h - 1; \ else \ ay = 0; \ } \ else if (ay >= area_h) \ { \ -if (mode.area_wraparound) \ +if (conf.areas.wraparound) \ ay = 0; \ else \ ay = area_h - 1; \ @@ -274,7 +274,7 @@ SetCurrentArea(int ax, int ay) } /* if we're in move mode.... and its non opaque undraw our boxes */ - if ((mode.mode == MODE_MOVE) && (mode.ewin) && (mode.movemode > 0) + if ((mode.mode == MODE_MOVE) && (mode.ewin) && (conf.movemode > 0) && (!mode.moveresize_pending_ewin)) { lst = @@ -284,7 +284,7 @@ SetCurrentArea(int ax, int ay) { x = lst[i]->x; y = lst[i]->y; - DrawEwinShape(lst[i], mode.movemode, x, y, lst[i]->client.w, + DrawEwinShape(lst[i], conf.movemode, x, y, lst[i]->client.w, lst[i]->client.h, 3); } Efree(lst); @@ -310,7 +310,7 @@ SetCurrentArea(int ax, int ay) if ((lst[i]->desktop == desks.current) && (!lst[i]->sticky) && (!lst[i]->fixedpos) && (!lst[i]->iconified)) { - if ((lst[i]->floating) && (mode.movemode > 0)) + if ((lst[i]->floating) && (conf.movemode > 0)) { wnum++; wl = Erealloc(wl, sizeof(Window) * wnum); @@ -387,7 +387,7 @@ SetCurrentArea(int ax, int ay) /* well work out the xy stuff later when the move finishes */ if (lst[i]->floating) { - if (mode.movemode > 0) + if (conf.movemode > 0) { GetWinXY(lst[i]->win, &x, &y); EMoveWindow(disp, lst[i]->win, @@ -455,7 +455,7 @@ SetCurrentArea(int ax, int ay) { if (lst[i]->floating) { - if (mode.movemode > 0) + if (conf.movemode > 0) { if (mode.flipp) { @@ -467,12 +467,12 @@ SetCurrentArea(int ax, int ay) x = lst[i]->x; y = lst[i]->y; } - if (mode.movemode == 5) - DrawEwinShape(lst[i], mode.movemode, x, y, + if (conf.movemode == 5) + DrawEwinShape(lst[i], conf.movemode, x, y, lst[i]->client.w, lst[i]->client.h, 4); else - DrawEwinShape(lst[i], mode.movemode, x, y, + DrawEwinShape(lst[i], conf.movemode, x, y, lst[i]->client.w, lst[i]->client.h, 0); if (mode.flipp) @@ -493,7 +493,7 @@ SetCurrentArea(int ax, int ay) x = lst[i]->x; y = lst[i]->y; } - DrawEwinShape(lst[i], mode.movemode, x, y, + DrawEwinShape(lst[i], conf.movemode, x, y, lst[i]->client.w, lst[i]->client.h, 0); if (mode.flipp) diff --git a/src/arrange.c b/src/arrange.c index 9f889889..da00c800 100644 --- a/src/arrange.c +++ b/src/arrange.c @@ -596,7 +596,7 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy) if (!ewin) EDBUG_RETURN_; - if (!mode.snap) + if (!conf.snap.enable) { *new_dx = dx; *new_dy = dy; @@ -606,7 +606,7 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy) ScreenGetGeometry(ewin->x, ewin->y, &left_bound, &top_bound, &w, &h); right_bound = left_bound + w; bottom_bound = top_bound + h; - screen_snap_dist = mode.constrained ? (w + h) : mode.screen_snap_dist; + screen_snap_dist = mode.constrained ? (w + h) : conf.snap.screen_snap_dist; lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN); gwins = ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup @@ -645,7 +645,7 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy) { if (IN_BELOW (ewin->x + dx, lst[i]->x + lst[i]->w - 1, - mode.edge_snap_dist) + conf.snap.edge_snap_dist) && SPANS_COMMON(ewin->y, ewin->h, lst[i]->y, lst[i]->h) && (ewin->x >= (lst[i]->x + lst[i]->w))) @@ -680,7 +680,7 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy) { if (IN_ABOVE (ewin->x + ewin->w + dx - 1, lst[i]->x, - mode.edge_snap_dist) + conf.snap.edge_snap_dist) && SPANS_COMMON(ewin->y, ewin->h, lst[i]->y, lst[i]->h) && ((ewin->x + ewin->w) <= lst[i]->x)) @@ -715,7 +715,7 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy) { if (IN_BELOW (ewin->y + dy, lst[i]->y + lst[i]->h - 1, - mode.edge_snap_dist) + conf.snap.edge_snap_dist) && SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w) && (ewin->y >= (lst[i]->y + lst[i]->h))) @@ -750,7 +750,7 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy) { if (IN_ABOVE (ewin->y + ewin->h + dy - 1, lst[i]->y, - mode.edge_snap_dist) + conf.snap.edge_snap_dist) && SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w) && ((ewin->y + ewin->h) <= lst[i]->y)) diff --git a/src/borders.c b/src/borders.c index 6c82b6d9..6a6e3408 100644 --- a/src/borders.c +++ b/src/borders.c @@ -244,7 +244,7 @@ SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, int speed) mode.doingslide = 1; SoundPlay("SOUND_WINDOW_SLIDE"); - if (mode.slidemode > 0) + if (conf.slidemode > 0) GrabX(); for (k = 0; k <= 1024; k += spd) @@ -256,10 +256,10 @@ SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, int speed) tmpy = y; tmpw = ewin->client.w; tmph = ewin->client.h; - if (mode.slidemode == 0) + if (conf.slidemode == 0) EMoveWindow(disp, ewin->win, tmpx, tmpy); else - DrawEwinShape(ewin, mode.slidemode, tmpx, tmpy, tmpw, tmph, + DrawEwinShape(ewin, conf.slidemode, tmpx, tmpy, tmpw, tmph, firstlast); if (firstlast == 0) firstlast = 1; @@ -277,10 +277,10 @@ SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, int speed) if (spd < min) spd = min; } - DrawEwinShape(ewin, mode.slidemode, x, y, ewin->client.w, ewin->client.h, 2); + DrawEwinShape(ewin, conf.slidemode, x, y, ewin->client.w, ewin->client.h, 2); MoveEwin(ewin, tx, ty); mode.doingslide = 0; - if (mode.slidemode > 0) + if (conf.slidemode > 0) UngrabX(); SoundPlay("SOUND_WINDOW_SLIDE_END"); EDBUG_RETURN_; @@ -309,7 +309,7 @@ SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty, int num_wins, firstlast = 0; mode.doingslide = 1; SoundPlay("SOUND_WINDOW_SLIDE"); - if (mode.slidemode > 0) + if (conf.slidemode > 0) GrabX(); for (k = 0; k <= 1024; k += spd) { @@ -359,7 +359,7 @@ SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty, int num_wins, } mode.doingslide = 0; - if (mode.slidemode > 0) + if (conf.slidemode > 0) UngrabX(); SoundPlay("SOUND_WINDOW_SLIDE_END"); if (x) @@ -403,13 +403,13 @@ AddToFamily(Window win) /* grab that server */ GrabX(); winid = win; - speed = mode.slidespeedmap; - doslide = mode.mapslide; + speed = conf.slidespeedmap; + doslide = conf.mapslide; manplace = 0; /* adopt the new baby */ ewin = Adopt(win); /* if is an afterstep/windowmaker dock app 0- dock it */ - if (mode.dockapp_support && ewin->docked) + if (conf.dockapp_support && ewin->docked) { DockIt(ewin); EDBUG_RETURN_; @@ -436,7 +436,7 @@ AddToFamily(Window win) if (ewin2) ewin2->has_transients++; } - if ((mode.transientsfollowleader) && (ewin->client.transient)) + if ((conf.focus.transientsfollowleader) && (ewin->client.transient)) { ewin2 = FindItem(NULL, ewin->client.transient_for, LIST_FINDBY_ID, @@ -444,7 +444,7 @@ AddToFamily(Window win) if (ewin2) { ewin->desktop = ewin2->desktop; - if ((mode.switchfortransientmap) + if ((conf.focus.switchfortransientmap) && (ewin->desktop != desks.current) && (!ewin->iconified)) { GotoDesktop(ewin->desktop); @@ -459,7 +459,7 @@ AddToFamily(Window win) if (ewin2) { ewin->desktop = ewin2->desktop; - if ((mode.switchfortransientmap) + if ((conf.focus.switchfortransientmap) && (ewin->desktop != desks.current) && (!ewin->iconified)) { GotoDesktop(ewin->desktop); @@ -477,7 +477,7 @@ AddToFamily(Window win) && (ewin->client.group == lst[i]->client.group)) { ewin->desktop = lst[i]->desktop; - if ((mode.switchfortransientmap) + if ((conf.focus.switchfortransientmap) && (ewin->desktop != desks.current) && (!ewin->iconified)) { @@ -504,7 +504,7 @@ AddToFamily(Window win) ewin->desktop = DESKTOPS_WRAP_NUM(ewin->desktop); } - if ((!ewin->client.transient) && (mode.manual_placement) + if ((!ewin->client.transient) && (conf.manual_placement) && (!ewin->client.already_placed) && (!mode.startup) && (!mode.place)) { cangrab = GrabThePointer(root.win); @@ -526,7 +526,7 @@ AddToFamily(Window win) { /* Place the window below the mouse pointer */ - if (mode.manual_placement_mouse_pointer) + if (conf.manual_placement_mouse_pointer) { int rx, ry, wx, wy; unsigned int mask; @@ -569,7 +569,7 @@ AddToFamily(Window win) { ewin->client.already_placed = 1; ArrangeEwinXY(ewin, &x, &y); - } /* (mode.manual_placement_mouse_pointer) */ + } /* (conf.manual_placement_mouse_pointer) */ } /* ((!ewin->client.already_placed) && (!manplace)) */ else { @@ -732,7 +732,7 @@ AddToFamily(Window win) ICCCM_Configure(ewin); DetermineEwinArea(ewin); - if (mode.all_new_windows_get_focus) + if (conf.focus.all_new_windows_get_focus) { FocusToEWin(ewin); if ((ewin->desktop != desks.current) && (!ewin->iconified)) @@ -741,7 +741,7 @@ AddToFamily(Window win) SetCurrentArea(ewin->area_x, ewin->area_y); } } - else if (mode.new_transients_get_focus) + else if (conf.focus.new_transients_get_focus) { if (ewin->client.transient) { @@ -753,7 +753,7 @@ AddToFamily(Window win) } } } - else if (mode.new_transients_get_focus_if_group_focused) + else if (conf.focus.new_transients_get_focus_if_group_focused) { ewin2 = FindItem(NULL, ewin->client.transient_for, LIST_FINDBY_ID, @@ -1476,7 +1476,7 @@ CreateEwin() XChangeWindowAttributes(disp, ewin->win_container, CWEventMask | CWDontPropagate, &att); EMapWindow(disp, ewin->win_container); - if ((mode.clickalways) || (mode.focusmode == FOCUS_CLICK)) + if ((conf.focus.clickraises) || (conf.focus.mode == FOCUS_CLICK)) XGrabButton(disp, AnyButton, 0, ewin->win_container, False, ButtonPressMask, GrabModeSync, GrabModeAsync, None, None); att.event_mask = @@ -1602,7 +1602,7 @@ EwinSetBorderInit(EWin * ewin) b = MatchEwinByFunction(ewin, (void *(*)(EWin *, WindowMatch *))(MatchEwinBorder)); - if (mode.dockapp_support && ewin->docked) + if (conf.dockapp_support && ewin->docked) b = (Border *) FindItem("BORDERLESS", 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER); if (!b) @@ -2611,7 +2611,7 @@ ShadeEwin(EWin * ewin) EDBUG_RETURN_; pq = queue_up; queue_up = 0; - speed = mode.shadespeed; + speed = conf.shadespeed; spd = 32; min = 2; GrabX(); @@ -2622,7 +2622,7 @@ ShadeEwin(EWin * ewin) XChangeWindowAttributes(disp, ewin->client.win, CWWinGravity, &att); MinShadeSize(ewin, &b, &d); a = ewin->w; - if ((mode.animate_shading) || (ewin->menu)) + if ((conf.animate_shading) || (ewin->menu)) for (k = 0; k <= 1024; k += spd) { gettimeofday(&timev1, NULL); @@ -2674,7 +2674,7 @@ ShadeEwin(EWin * ewin) a = ewin->w; c = ewin->x; d = ewin->x + ewin->w - b; - if ((mode.animate_shading) || (ewin->menu)) + if ((conf.animate_shading) || (ewin->menu)) for (k = 0; k <= 1024; k += spd) { gettimeofday(&timev1, NULL); @@ -2729,7 +2729,7 @@ ShadeEwin(EWin * ewin) a = ewin->h; MinShadeSize(ewin, &b, &d); b = d; - if ((mode.animate_shading) || (ewin->menu)) + if ((conf.animate_shading) || (ewin->menu)) for (k = 0; k <= 1024; k += spd) { gettimeofday(&timev1, NULL); @@ -2783,7 +2783,7 @@ ShadeEwin(EWin * ewin) b = d; c = ewin->y; d = ewin->y + ewin->h - b; - if ((mode.animate_shading) || (ewin->menu)) + if ((conf.animate_shading) || (ewin->menu)) for (k = 0; k <= 1024; k += spd) { gettimeofday(&timev1, NULL); @@ -2868,7 +2868,7 @@ UnShadeEwin(EWin * ewin) EDBUG_RETURN_; pq = queue_up; queue_up = 0; - speed = mode.shadespeed; + speed = conf.shadespeed; spd = 32; min = 2; GrabX(); @@ -2888,7 +2888,7 @@ UnShadeEwin(EWin * ewin) ewin->client.w, ewin->client.h); EMapWindow(disp, ewin->client.win); EMapWindow(disp, ewin->win_container); - if ((mode.animate_shading) || (ewin->menu)) + if ((conf.animate_shading) || (ewin->menu)) for (k = 0; k <= 1024; k += spd) { gettimeofday(&timev1, NULL); @@ -2945,7 +2945,7 @@ UnShadeEwin(EWin * ewin) ewin->client.h); EMapWindow(disp, ewin->client.win); EMapWindow(disp, ewin->win_container); - if ((mode.animate_shading) || (ewin->menu)) + if ((conf.animate_shading) || (ewin->menu)) for (k = 0; k <= 1024; k += spd) { gettimeofday(&timev1, NULL); @@ -3000,7 +3000,7 @@ UnShadeEwin(EWin * ewin) ewin->client.w, ewin->client.h); EMapWindow(disp, ewin->client.win); EMapWindow(disp, ewin->win_container); - if ((mode.animate_shading) || (ewin->menu)) + if ((conf.animate_shading) || (ewin->menu)) for (k = 0; k <= 1024; k += spd) { gettimeofday(&timev1, NULL); @@ -3057,7 +3057,7 @@ UnShadeEwin(EWin * ewin) ewin->client.h); EMapWindow(disp, ewin->client.win); EMapWindow(disp, ewin->win_container); - if ((mode.animate_shading) || (ewin->menu)) + if ((conf.animate_shading) || (ewin->menu)) for (k = 0; k <= 1024; k += spd) { gettimeofday(&timev1, NULL); diff --git a/src/comms.c b/src/comms.c index 8be39d67..712406ec 100644 --- a/src/comms.c +++ b/src/comms.c @@ -22,6 +22,8 @@ */ #include "E.h" +static Window comms_win = 0; + static Atom XA_ENLIGHTENMENT_COMMS = 0; static Atom XA_ENL_MSG = 0; @@ -539,7 +541,7 @@ HandleComms(XClientMessageEvent * ev) DesktopAccounting(); desks.desk[i].viewable = view; desks.desk[i].bg = bg; - if (i < mode.numdesktops) + if (i < conf.desks.numdesktops) { if (desks.desk[i].viewable) RefreshDesktop(i); @@ -579,7 +581,7 @@ HandleComms(XClientMessageEvent * ev) DesktopAccounting(); desks.desk[i].viewable = view; desks.desk[i].bg = NULL; - if (i < mode.numdesktops) + if (i < conf.desks.numdesktops) { if (desks.desk[i].viewable) RefreshDesktop(i); @@ -1195,79 +1197,79 @@ HandleComms(XClientMessageEvent * ev) if (!strcmp(w, "FOCUSMODE:")) { word(s, wd, w); - mode.focusmode = atoi(w); + conf.focus.mode = atoi(w); } else if (!strcmp(w, "DOCKAPP_SUPPORT:")) { word(s, wd, w); - mode.dockdirmode = atoi(w); + conf.dock.dirmode = atoi(w); } else if (!strcmp(w, "DOCKDIRMODE:")) { word(s, wd, w); - mode.dockapp_support = atoi(w); + conf.dockapp_support = atoi(w); } else if (!strcmp(w, "ICONDIRMODE:")) { word(s, wd, w); - mode.primaryicondir = atoi(w); + conf.primaryicondir = atoi(w); } else if (!strcmp(w, "MOVEMODE:")) { word(s, wd, w); - mode.movemode = atoi(w); + conf.movemode = atoi(w); #if !USE_IMLIB2 - if ((prImlib_Context) && (mode.movemode == 5)) - mode.movemode = 3; + if ((prImlib_Context) && (conf.movemode == 5)) + conf.movemode = 3; #endif } else if (!strcmp(w, "RESIZEMODE:")) { word(s, wd, w); - mode.resizemode = atoi(w); - if (mode.resizemode == 5) - mode.resizemode = 3; + conf.resizemode = atoi(w); + if (conf.resizemode == 5) + conf.resizemode = 3; } else if (!strcmp(w, "SLIDEMODE:")) { word(s, wd, w); - mode.slidemode = atoi(w); + conf.slidemode = atoi(w); } else if (!strcmp(w, "CLEANUPSLIDE:")) { word(s, wd, w); - mode.cleanupslide = atoi(w); + conf.cleanupslide = atoi(w); } else if (!strcmp(w, "MAPSLIDE:")) { word(s, wd, w); - mode.mapslide = atoi(w); + conf.mapslide = atoi(w); } else if (!strcmp(w, "SLIDESPEEDMAP:")) { word(s, wd, w); - mode.slidespeedmap = atoi(w); + conf.slidespeedmap = atoi(w); } else if (!strcmp(w, "SLIDESPEEDCLEANUP:")) { word(s, wd, w); - mode.slidespeedcleanup = atoi(w); + conf.slidespeedcleanup = atoi(w); } else if (!strcmp(w, "SHADESPEED:")) { word(s, wd, w); - mode.shadespeed = atoi(w); + conf.shadespeed = atoi(w); } else if (!strcmp(w, "DESKTOPBGTIMEOUT:")) { word(s, wd, w); - mode.desktop_bg_timeout = atoi(w); + conf.desktop_bg_timeout = atoi(w); } else if (!strcmp(w, "SOUND:")) { word(s, wd, w); - mode.sound = atoi(w); - if (mode.sound) + conf.sound = atoi(w); + if (conf.sound) SoundInit(); else SoundExit(); @@ -1275,22 +1277,22 @@ HandleComms(XClientMessageEvent * ev) else if (!strcmp(w, "BUTTONMOVERESISTANCE:")) { word(s, wd, w); - mode.button_move_resistance = atoi(w); + conf.button_move_resistance = atoi(w); } else if (!strcmp(w, "AUTOSAVE:")) { word(s, wd, w); - mode.autosave = atoi(w); + conf.autosave = atoi(w); } else if (!strcmp(w, "MEMORYPARANOIA:")) { word(s, wd, w); - mode.memory_paranoia = atoi(w); + conf.memory_paranoia = atoi(w); } else if (!strcmp(w, "MENUSLIDE:")) { word(s, wd, w); - mode.menuslide = atoi(w); + conf.menuslide = atoi(w); } else if (!strcmp(w, "NUMDESKTOPS:")) { @@ -1300,37 +1302,37 @@ HandleComms(XClientMessageEvent * ev) else if (!strcmp(w, "TOOLTIPS:")) { word(s, wd, w); - mode.tooltips = atoi(w); + conf.tooltips.enable = atoi(w); } else if (!strcmp(w, "TIPTIME:")) { word(s, wd, w); - mode.tiptime = atof(w); + conf.tooltips.tiptime = atof(w); } else if (!strcmp(w, "AUTORAISE:")) { word(s, wd, w); - mode.autoraise = atoi(w); + conf.autoraise = atoi(w); } else if (!strcmp(w, "AUTORAISETIME:")) { word(s, wd, w); - mode.autoraisetime = atof(w); + conf.autoraisetime = atof(w); } else if (!strcmp(w, "DOCKSTARTX:")) { word(s, wd, w); - mode.dockstartx = atoi(w); + conf.dock.startx = atoi(w); } else if (!strcmp(w, "DOCKSTARTY:")) { word(s, wd, w); - mode.dockstarty = atoi(w); + conf.dock.starty = atoi(w); } else if (!strcmp(w, "SAVEUNDER:")) { word(s, wd, w); - mode.save_under = atoi(w); + conf.save_under = atoi(w); } else if (!strcmp(w, "DRAGDIR:")) { @@ -1378,12 +1380,12 @@ HandleComms(XClientMessageEvent * ev) else if (!strcmp(w, "TRANSIENTSFOLLOWLEADER:")) { word(s, wd, w); - mode.transientsfollowleader = atoi(w); + conf.focus.transientsfollowleader = atoi(w); } else if (!strcmp(w, "SWITCHFORTRANSIENTMAP:")) { word(s, wd, w); - mode.switchfortransientmap = atoi(w); + conf.focus.switchfortransientmap = atoi(w); } else if (!strcmp(w, "SHOWICONS:")) { @@ -1392,57 +1394,58 @@ HandleComms(XClientMessageEvent * ev) else if (!strcmp(w, "ALL_NEW_WINDOWS_GET_FOCUS:")) { word(s, wd, w); - mode.all_new_windows_get_focus = atoi(w); + conf.focus.all_new_windows_get_focus = atoi(w); } else if (!strcmp(w, "NEW_TRANSIENTS_GET_FOCUS:")) { word(s, wd, w); - mode.new_transients_get_focus = atoi(w); + conf.focus.new_transients_get_focus = atoi(w); } else if (!strcmp(w, "NEW_TRANSIENTS_GET_FOCUS_IF_GROUP_FOCUSED:")) { word(s, wd, w); - mode.new_transients_get_focus_if_group_focused = atoi(w); + conf.focus.new_transients_get_focus_if_group_focused = + atoi(w); } else if (!strcmp(w, "MANUAL_PLACEMENT:")) { word(s, wd, w); - mode.manual_placement = atoi(w); + conf.manual_placement = atoi(w); } else if (!strcmp(w, "MANUAL_PLACEMENT_MOUSE_POINTER:")) { word(s, wd, w); - mode.manual_placement_mouse_pointer = atoi(w); + conf.manual_placement_mouse_pointer = atoi(w); } else if (!strcmp(w, "RAISE_ON_NEXT_FOCUS:")) { word(s, wd, w); - mode.raise_on_next_focus = atoi(w); + conf.focus.raise_on_next_focus = atoi(w); } else if (!strcmp(w, "RAISE_AFTER_NEXT_FOCUS:")) { word(s, wd, w); - mode.raise_after_next_focus = atoi(w); + conf.focus.raise_after_next_focus = atoi(w); } else if (!strcmp(w, "DISPLAY_WARP:")) { word(s, wd, w); - mode.display_warp = atoi(w); + conf.warplist.enable = atoi(w); } else if (!strcmp(w, "WARP_ON_NEXT_FOCUS:")) { word(s, wd, w); - mode.warp_on_next_focus = atoi(w); + conf.focus.warp_on_next_focus = atoi(w); } else if (!strcmp(w, "WARP_AFTER_NEXT_FOCUS:")) { word(s, wd, w); - mode.warp_after_next_focus = atoi(w); + conf.focus.warp_after_next_focus = atoi(w); } else if (!strcmp(w, "EDGE_FLIP_RESISTANCE:")) { word(s, wd, w); - mode.edge_flip_resistance = atoi(w); + conf.edge_flip_resistance = atoi(w); ShowEdgeWindows(); } else if (!strcmp(w, "AREA_SIZE:")) @@ -1516,26 +1519,28 @@ HandleComms(XClientMessageEvent * ev) "RAISE_ON_NEXT_FOCUS: %i\n" "RAISE_AFTER_NEXT_FOCUS: %i\n" "DISPLAY_WARP: %i\n" "WARP_ON_NEXT_FOCUS: %i\n" "WARP_AFTER_NEXT_FOCUS: %i\n" "EDGE_FLIP_RESISTANCE: %i\n", - mode.focusmode, mode.dockapp_support, mode.dockdirmode, - mode.primaryicondir, mode.movemode, mode.resizemode, - mode.slidemode, mode.cleanupslide, mode.mapslide, - mode.slidespeedmap, mode.slidespeedcleanup, mode.shadespeed, - mode.desktop_bg_timeout, mode.sound, - mode.button_move_resistance, mode.autosave, - mode.memory_paranoia, mode.tooltips, mode.tiptime, - mode.autoraise, mode.autoraisetime, mode.dockstartx, - mode.dockstarty, mode.save_under, mode.menuslide, - mode.numdesktops, desks.dragdir, desks.dragbar_width, - desks.dragbar_ordering, desks.dragbar_length, desks.slidein, - desks.slidespeed, desks.hiqualitybg, - mode.transientsfollowleader, mode.switchfortransientmap, - a, b, mode.all_new_windows_get_focus, - mode.new_transients_get_focus, - mode.new_transients_get_focus_if_group_focused, - mode.manual_placement, mode.manual_placement_mouse_pointer, - mode.raise_on_next_focus, mode.raise_after_next_focus, - mode.display_warp, mode.warp_on_next_focus, - mode.warp_after_next_focus, mode.edge_flip_resistance); + conf.focus.mode, conf.dockapp_support, conf.dock.dirmode, + conf.primaryicondir, conf.movemode, conf.resizemode, + conf.slidemode, conf.cleanupslide, conf.mapslide, + conf.slidespeedmap, conf.slidespeedcleanup, conf.shadespeed, + conf.desktop_bg_timeout, conf.sound, + conf.button_move_resistance, conf.autosave, + conf.memory_paranoia, conf.tooltips.enable, + conf.tooltips.tiptime, conf.autoraise, conf.autoraisetime, + 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.focus.switchfortransientmap, a, b, + conf.focus.all_new_windows_get_focus, + conf.focus.new_transients_get_focus, + conf.focus.new_transients_get_focus_if_group_focused, + conf.manual_placement, conf.manual_placement_mouse_pointer, + conf.focus.raise_on_next_focus, + conf.focus.raise_after_next_focus, conf.warplist.enable, + conf.focus.warp_on_next_focus, + conf.focus.warp_after_next_focus, conf.edge_flip_resistance); CommsSend(c, buf); } else if (!strcmp(w, "call_raw")) @@ -1558,7 +1563,7 @@ HandleComms(XClientMessageEvent * ev) buf[0] = 0; Esnprintf(buf, sizeof(buf), "Number of desks is %d\n", - mode.numdesktops); + conf.desks.numdesktops); CommsSend(c, buf); } else @@ -1566,23 +1571,23 @@ HandleComms(XClientMessageEvent * ev) int i, num; EWin **lst; - mode.numdesktops = atoi(w); - if (mode.numdesktops <= 0) - mode.numdesktops = 1; - else if (mode.numdesktops > ENLIGHTENMENT_CONF_NUM_DESKTOPS) - mode.numdesktops = ENLIGHTENMENT_CONF_NUM_DESKTOPS; + 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; lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN); if (lst) { for (i = 0; i < num; i++) { - if (lst[i]->desktop >= mode.numdesktops) - MoveEwinToDesktop(lst[i], mode.numdesktops - 1); + if (lst[i]->desktop >= conf.desks.numdesktops) + MoveEwinToDesktop(lst[i], conf.desks.numdesktops - 1); } Efree(lst); } - if (desks.current >= mode.numdesktops) - GotoDesktop(mode.numdesktops - 1); + if (desks.current >= conf.desks.numdesktops) + GotoDesktop(conf.desks.numdesktops - 1); } } else if (!strcmp(w, "get_client_info")) diff --git a/src/config.c b/src/config.c index d5d1f425..459a099b 100644 --- a/src/config.c +++ b/src/config.c @@ -589,138 +589,138 @@ Config_Control(FILE * ConfigFile) case CONFIG_CLOSE: return; case CONFIG_SOUND: - mode.sound = i2; + conf.sound = i2; break; case CONTROL_SAVE_UNDER: - mode.save_under = i2; + conf.save_under = i2; break; case CONTROL_FOCUSMODE: - mode.focusmode = i2; + conf.focus.mode = i2; break; case CONTROL_MOVEMODE: - mode.movemode = i2; + conf.movemode = i2; break; case CONTROL_RESIZEMODE: - mode.resizemode = i2; + conf.resizemode = i2; break; case CONTROL_GEOMINFOMODE: - mode.geominfomode = i2; + conf.geominfomode = i2; break; case CONTROL_SLIDEMODE: - mode.slidemode = i2; + conf.slidemode = i2; break; case CONTROL_CLEANUPSLIDE: - mode.cleanupslide = i2; + conf.cleanupslide = i2; break; case CONTROL_DOCKDIRMODE: - mode.dockdirmode = i2; + conf.dock.dirmode = i2; break; case CONTROL_MAPSLIDE: - mode.mapslide = i2; + conf.mapslide = i2; break; case CONTROL_TOOLTIPS: - mode.tooltips = i2; + conf.tooltips.enable = i2; break; case CONTROL_MENUSLIDE: - mode.menuslide = i2; + conf.menuslide = i2; break; case CONTROL_NUMDESKTOPS: - mode.numdesktops = i2; - if (mode.numdesktops <= 0) + conf.desks.numdesktops = i2; + if (conf.desks.numdesktops <= 0) { - mode.numdesktops = 1; + conf.desks.numdesktops = 1; } - else if (mode.numdesktops > ENLIGHTENMENT_CONF_NUM_DESKTOPS) + else if (conf.desks.numdesktops > ENLIGHTENMENT_CONF_NUM_DESKTOPS) { - mode.numdesktops = ENLIGHTENMENT_CONF_NUM_DESKTOPS; + conf.desks.numdesktops = ENLIGHTENMENT_CONF_NUM_DESKTOPS; } break; case CONTROL_MEMORYPARANOIA: - mode.memory_paranoia = i2; + conf.memory_paranoia = i2; break; case CONTROL_TRANSIENTS_FOLLOW_LEADER: - mode.transientsfollowleader = i2; + conf.focus.transientsfollowleader = i2; break; case CONTROL_SWITCH_FOR_TRANSIENT_MAP: - mode.switchfortransientmap = i2; + conf.focus.switchfortransientmap = i2; break; case CONTROL_SHOWICONS: /* Obsolete */ break; case CONTROL_ALL_NEW_WINDOWS_GET_FOCUS: - mode.all_new_windows_get_focus = i2; + conf.focus.all_new_windows_get_focus = i2; break; case CONTROL_NEW_TRANSIENTS_GET_FOCUS: - mode.new_transients_get_focus = i2; + conf.focus.new_transients_get_focus = i2; break; case CONTROL_NEW_TRANSIENTS_GET_FOCUS_IF_GROUP: - mode.new_transients_get_focus_if_group_focused = i2; + conf.focus.new_transients_get_focus_if_group_focused = i2; break; case CONTROL_MANUAL_PLACEMENT: - mode.manual_placement = i2; + conf.manual_placement = i2; break; case CONTROL_MANUAL_PLACEMENT_MOUSE_POINTER: - mode.manual_placement_mouse_pointer = i2; + conf.manual_placement_mouse_pointer = i2; break; case CONTROL_RAISE_ON_NEXT_FOCUS: - mode.raise_on_next_focus = i2; + conf.focus.raise_on_next_focus = i2; break; case CONTROL_RAISE_AFTER_NEXT_FOCUS: - mode.raise_after_next_focus = i2; + conf.focus.raise_after_next_focus = i2; break; case CONTROL_DISPLAY_WARP: - if (mode.display_warp >= 0) - mode.display_warp = i2; + if (conf.warplist.enable >= 0) + conf.warplist.enable = i2; break; case CONTROL_WARP_ON_NEXT_FOCUS: - mode.warp_on_next_focus = i2; + conf.focus.warp_on_next_focus = i2; break; case CONTROL_WARP_AFTER_NEXT_FOCUS: - mode.warp_after_next_focus = i2; + conf.focus.warp_after_next_focus = i2; break; case CONTROL_PAGER_SCANSPEED: - mode.pager_scanspeed = i2; + conf.pagers.scanspeed = i2; break; case CONTROL_EDGE_FLIP_RESISTANCE: - mode.edge_flip_resistance = i2; + conf.edge_flip_resistance = i2; break; case CONTROL_TOOLTIPTIME: sscanf(s, "%*i %f", &f1); - mode.tiptime = f1; + conf.tooltips.tiptime = f1; break; case CONTROL_AUTORAISE: - mode.autoraise = i2; + conf.autoraise = i2; break; case CONTROL_AUTORAISETIME: sscanf(s, "%*i %f", &f1); - mode.autoraisetime = f1; + conf.autoraisetime = f1; break; case CONTROL_GROUP_BORDER: - mode.group_config.set_border = i2; + conf.group_config.set_border = i2; break; case CONTROL_GROUP_KILL: - mode.group_config.kill = i2; + conf.group_config.kill = i2; break; case CONTROL_GROUP_MOVE: - mode.group_config.move = i2; + conf.group_config.move = i2; break; case CONTROL_GROUP_RAISE: - mode.group_config.raise = i2; + conf.group_config.raise = i2; break; case CONTROL_GROUP_ICONIFY: - mode.group_config.iconify = i2; + conf.group_config.iconify = i2; break; case CONTROL_GROUP_STICK: - mode.group_config.stick = i2; + conf.group_config.stick = i2; break; case CONTROL_GROUP_SHADE: - mode.group_config.shade = i2; + conf.group_config.shade = i2; break; case CONTROL_GROUP_MIRROR: - mode.group_config.mirror = i2; + conf.group_config.mirror = i2; break; case CONTROL_GROUP_SWAPMOVE: - mode.group_swapmove = i2; + conf.group_swapmove = i2; break; case DESKTOP_DRAGDIR: desks.dragdir = i2; @@ -741,28 +741,28 @@ Config_Control(FILE * ConfigFile) desks.slidespeed = i2; break; case CONTROL_SHADESPEED: - mode.shadespeed = i2; + conf.shadespeed = i2; break; case CONTROL_ANIMATESHADING: - mode.animate_shading = i2; + conf.animate_shading = i2; break; case CONTROL_MENUONSCREEN: - mode.menusonscreen = i2; + conf.menusonscreen = i2; break; case CONTROL_WARPMENUS: - mode.warpmenus = i2; + conf.warpmenus = i2; break; case CONTROL_WARPSTICKY: - mode.warpsticky = i2; + conf.warplist.warpsticky = i2; break; case CONTROL_WARPSHADED: - mode.warpshaded = i2; + conf.warplist.warpshaded = i2; break; case CONTROL_WARPICONIFIED: - mode.warpiconified = i2; + conf.warplist.warpiconified = i2; break; case CONTROL_WARPFOCUSED: - mode.warpfocused = i2; + conf.warplist.warpfocused = i2; break; case DESKTOP_HIQUALITYBG: desks.hiqualitybg = i2; @@ -772,49 +772,49 @@ Config_Control(FILE * ConfigFile) SetAreaSize(i2, i3); break; case CONTROL_AREA_WRAPAROUND: - mode.area_wraparound = i2; + conf.areas.wraparound = i2; break; case CONTROL_DIALOG_HEADERS: - mode.dialog_headers = i2; + conf.dialogs.headers = i2; break; case CONTROL_DESKTOP_WRAPAROUND: - mode.desktop_wraparound = i2; + conf.desks.wraparound = i2; break; case CONTROL_SLIDESPEEDMAP: - mode.slidespeedmap = i2; + conf.slidespeedmap = i2; break; case CONTROL_SLIDESPEEDCLEANUP: - mode.slidespeedcleanup = i2; + conf.slidespeedcleanup = i2; break; case CONTROL_DESKTOP_BG_TIMEOUT: - mode.desktop_bg_timeout = i2; + conf.desktop_bg_timeout = i2; break; case CONTROL_BUTTON_MOVE_RESISTANCE: - mode.button_move_resistance = i2; + conf.button_move_resistance = i2; break; case CONTROL_AUTOSAVE: - mode.autosave = i2; + conf.autosave = i2; break; case CONTROL_SHOW_PAGERS: - mode.show_pagers = i2; + conf.pagers.enable = i2; break; case CONTROL_PAGER_ZOOM: - mode.pager_zoom = i2; + conf.pagers.zoom = i2; break; case CONTROL_PAGER_TITLE: - mode.pager_title = i2; + conf.pagers.title = i2; break; case CONTROL_PAGER_HIQ: - mode.pager_hiq = i2; + conf.pagers.hiq = i2; break; case CONTROL_PAGER_SNAP: - mode.pager_snap = i2; + conf.pagers.snap = i2; break; case CONTROL_USER_BG: - mode.user_bg = i2; + conf.user_bg = i2; break; case CONTROL_DOCKSTARTPOS: - sscanf(s, "%*s %d %d ", &mode.dockstartx, &mode.dockstarty); + sscanf(s, "%*s %d %d ", &conf.dock.startx, &conf.dock.starty); break; case CONTROL_KDESUPPORT: #if 0 @@ -822,35 +822,37 @@ Config_Control(FILE * ConfigFile) #endif break; case CONTROL_SHOWROOTTOOLTIP: - mode.showroottooltip = i2; + conf.tooltips.showroottooltip = i2; break; case CONTROL_PAGER_BUTTONS: - sscanf(s, "%*s %i %i %i ", &mode.pager_sel_button, - &mode.pager_win_button, &mode.pager_menu_button); + sscanf(s, "%*s %i %i %i ", &conf.pagers.sel_button, + &conf.pagers.win_button, &conf.pagers.menu_button); break; case CONTROL_CLICK_ALWAYS: - mode.clickalways = i2; + conf.focus.clickraises = i2; break; case CONFIG_EXTRA_HEAD: #ifdef HAS_XINERAMA - mode.extra_head = i2; + conf.extra_head = i2; #endif break; case CONTROL_ICONTEXT: +#if 0 /* Not used */ { char s2[FILEPATH_LEN_MAX]; s2[0] = 0; word(s, 2, s2); - mode.icon_textclass = + conf.icon_textclass = FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_TCLASS); - if (mode.icon_textclass) - mode.icon_textclass->ref_count++; + if (conf.icon_textclass) + conf.icon_textclass->ref_count++; } +#endif break; case CONTROL_DOCKAPP_SUPPORT: - mode.dockapp_support = i2; + conf.dockapp_support = i2; break; default: RecoverUserConfig(); @@ -1784,7 +1786,7 @@ Config_Desktop(FILE * ConfigFile) if ((atoi(s2) < ENLIGHTENMENT_CONF_NUM_DESKTOPS) && (atoi(s2) >= 0)) { - if ((desks.desk[atoi(s2)].bg == NULL) || (mode.user_bg)) + if ((desks.desk[atoi(s2)].bg == NULL) || (conf.user_bg)) { #if !USE_IMLIB2 if ((prImlib_Context) && (atoi(s2) == 0)) @@ -1817,7 +1819,7 @@ Config_Desktop(FILE * ConfigFile) if ((atoi(s2) < ENLIGHTENMENT_CONF_NUM_DESKTOPS) && (atoi(s2) >= 0)) { - if ((desks.desk[atoi(s2)].bg == NULL) || (mode.user_bg)) + if ((desks.desk[atoi(s2)].bg == NULL) || (conf.user_bg)) { if (bg) { @@ -3406,7 +3408,7 @@ LoadOpenConfigFile(FILE * ConfigFile) } else { - mode.autosave = 0; + conf.autosave = 0; ASSIGN_ALERT(_("User Config Version ERROR"), _("Restart with Defaults"), " ", _("Abort and Exit")); @@ -3831,18 +3833,18 @@ SaveUserControlConfig(FILE * autosavefile) if (autosavefile) { fprintf(autosavefile, "0 999\n"); - fprintf(autosavefile, "307 %i\n", (int)mode.focusmode); - fprintf(autosavefile, "311 %i\n", (int)mode.movemode); - fprintf(autosavefile, "312 %i\n", (int)mode.resizemode); - fprintf(autosavefile, "1371 %i\n", (int)mode.geominfomode); - fprintf(autosavefile, "9 %i\n", (int)mode.sound); - fprintf(autosavefile, "313 %i\n", (int)mode.slidemode); - fprintf(autosavefile, "314 %i\n", (int)mode.cleanupslide); - fprintf(autosavefile, "315 %i\n", (int)mode.mapslide); - fprintf(autosavefile, "316 %i\n", (int)mode.slidespeedmap); - fprintf(autosavefile, "317 %i\n", (int)mode.slidespeedcleanup); - fprintf(autosavefile, "320 %i\n", (int)mode.desktop_bg_timeout); - fprintf(autosavefile, "321 %i\n", (int)mode.button_move_resistance); + fprintf(autosavefile, "307 %i\n", (int)conf.focus.mode); + fprintf(autosavefile, "311 %i\n", (int)conf.movemode); + fprintf(autosavefile, "312 %i\n", (int)conf.resizemode); + fprintf(autosavefile, "1371 %i\n", (int)conf.geominfomode); + fprintf(autosavefile, "9 %i\n", (int)conf.sound); + fprintf(autosavefile, "313 %i\n", (int)conf.slidemode); + fprintf(autosavefile, "314 %i\n", (int)conf.cleanupslide); + fprintf(autosavefile, "315 %i\n", (int)conf.mapslide); + fprintf(autosavefile, "316 %i\n", (int)conf.slidespeedmap); + 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); @@ -3850,68 +3852,74 @@ SaveUserControlConfig(FILE * autosavefile) 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, "1370 %i\n", (int)mode.dockapp_support); - fprintf(autosavefile, "325 %i\n", (int)mode.dockdirmode); - fprintf(autosavefile, "326 %i\n", (int)mode.shadespeed); - fprintf(autosavefile, "327 %i\n", (int)mode.tooltips); - fprintf(autosavefile, "328 %f\n", (float)mode.tiptime); - fprintf(autosavefile, "338 %i\n", (int)mode.autoraise); - fprintf(autosavefile, "339 %f\n", (float)mode.autoraisetime); - fprintf(autosavefile, "331 %i\n", (int)mode.save_under); - fprintf(autosavefile, "330 %i %i\n", (int)mode.dockstartx, - (int)mode.dockstarty); - fprintf(autosavefile, "334 %i\n", (int)mode.memory_paranoia); - fprintf(autosavefile, "332 %i\n", (int)mode.menuslide); - fprintf(autosavefile, "333 %i\n", (int)mode.numdesktops); - fprintf(autosavefile, "335 %i\n", (int)mode.transientsfollowleader); - fprintf(autosavefile, "336 %i\n", (int)mode.switchfortransientmap); + 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); + fprintf(autosavefile, "327 %i\n", (int)conf.tooltips.enable); + fprintf(autosavefile, "328 %f\n", (float)conf.tooltips.tiptime); + fprintf(autosavefile, "338 %i\n", (int)conf.autoraise); + fprintf(autosavefile, "339 %f\n", (float)conf.autoraisetime); + fprintf(autosavefile, "331 %i\n", (int)conf.save_under); + fprintf(autosavefile, "330 %i %i\n", (int)conf.dock.startx, + (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, "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, "340 %i\n", (int)mode.all_new_windows_get_focus); - fprintf(autosavefile, "341 %i\n", (int)mode.new_transients_get_focus); + fprintf(autosavefile, "340 %i\n", + (int)conf.focus.all_new_windows_get_focus); + fprintf(autosavefile, "341 %i\n", + (int)conf.focus.new_transients_get_focus); fprintf(autosavefile, "342 %i\n", - (int)mode.new_transients_get_focus_if_group_focused); - fprintf(autosavefile, "343 %i\n", (int)mode.manual_placement); + (int)conf.focus.new_transients_get_focus_if_group_focused); + fprintf(autosavefile, "343 %i\n", (int)conf.manual_placement); fprintf(autosavefile, "3360 %i\n", - (int)mode.manual_placement_mouse_pointer); - fprintf(autosavefile, "344 %i\n", (int)mode.raise_on_next_focus); - fprintf(autosavefile, "345 %i\n", (int)mode.warp_on_next_focus); - fprintf(autosavefile, "346 %i\n", (int)mode.edge_flip_resistance); - fprintf(autosavefile, "347 %i\n", (int)mode.show_pagers); - fprintf(autosavefile, "348 %i\n", (int)mode.pager_hiq); - fprintf(autosavefile, "349 %i\n", (int)mode.pager_snap); - fprintf(autosavefile, "350 %i\n", (int)mode.animate_shading); - fprintf(autosavefile, "351 %i\n", (int)mode.menusonscreen); - fprintf(autosavefile, "352 %i\n", (int)mode.area_wraparound); - fprintf(autosavefile, "353 %i\n", (int)mode.dialog_headers); - fprintf(autosavefile, "354 %i\n", (int)mode.desktop_wraparound); - fprintf(autosavefile, "666 %i\n", (int)mode.warpmenus); - fprintf(autosavefile, "667 %i\n", (int)mode.warpsticky); - fprintf(autosavefile, "668 %i\n", (int)mode.warpshaded); - fprintf(autosavefile, "669 %i\n", (int)mode.warpiconified); - fprintf(autosavefile, "670 %i\n", (int)mode.warpfocused); - fprintf(autosavefile, "1350 %i\n", (int)mode.user_bg); - fprintf(autosavefile, "1351 %i\n", (int)mode.pager_zoom); - fprintf(autosavefile, "1352 %i\n", (int)mode.pager_title); - fprintf(autosavefile, "1353 %i\n", (int)mode.raise_after_next_focus); - fprintf(autosavefile, "1354 %i\n", (int)mode.display_warp); - fprintf(autosavefile, "1355 %i\n", (int)mode.warp_after_next_focus); - fprintf(autosavefile, "1356 %i\n", (int)mode.pager_scanspeed); - fprintf(autosavefile, "1358 %i\n", (int)mode.group_config.set_border); - fprintf(autosavefile, "1359 %i\n", (int)mode.group_config.kill); - fprintf(autosavefile, "1360 %i\n", (int)mode.group_config.move); - fprintf(autosavefile, "1361 %i\n", (int)mode.group_config.raise); - fprintf(autosavefile, "1362 %i\n", (int)mode.group_config.iconify); - fprintf(autosavefile, "1363 %i\n", (int)mode.group_config.stick); - fprintf(autosavefile, "1364 %i\n", (int)mode.group_config.shade); - fprintf(autosavefile, "1365 %i\n", (int)mode.group_config.mirror); - fprintf(autosavefile, "1372 %i\n", (int)mode.group_swapmove); - fprintf(autosavefile, "1367 %i\n", (int)mode.clickalways); - fprintf(autosavefile, "1368 %i\n", (int)mode.showroottooltip); - fprintf(autosavefile, "1369 %i %i %i\n", (int)mode.pager_sel_button, - (int)mode.pager_win_button, (int)mode.pager_menu_button); + (int)conf.manual_placement_mouse_pointer); + fprintf(autosavefile, "344 %i\n", (int)conf.focus.raise_on_next_focus); + fprintf(autosavefile, "345 %i\n", (int)conf.focus.warp_on_next_focus); + fprintf(autosavefile, "346 %i\n", (int)conf.edge_flip_resistance); + fprintf(autosavefile, "347 %i\n", (int)conf.pagers.enable); + fprintf(autosavefile, "348 %i\n", (int)conf.pagers.hiq); + fprintf(autosavefile, "349 %i\n", (int)conf.pagers.snap); + fprintf(autosavefile, "350 %i\n", (int)conf.animate_shading); + fprintf(autosavefile, "351 %i\n", (int)conf.menusonscreen); + fprintf(autosavefile, "352 %i\n", (int)conf.areas.wraparound); + fprintf(autosavefile, "353 %i\n", (int)conf.dialogs.headers); + fprintf(autosavefile, "354 %i\n", (int)conf.desks.wraparound); + fprintf(autosavefile, "666 %i\n", (int)conf.warpmenus); + fprintf(autosavefile, "667 %i\n", (int)conf.warplist.warpsticky); + fprintf(autosavefile, "668 %i\n", (int)conf.warplist.warpshaded); + fprintf(autosavefile, "669 %i\n", (int)conf.warplist.warpiconified); + fprintf(autosavefile, "670 %i\n", (int)conf.warplist.warpfocused); + fprintf(autosavefile, "1350 %i\n", (int)conf.user_bg); + fprintf(autosavefile, "1351 %i\n", (int)conf.pagers.zoom); + fprintf(autosavefile, "1352 %i\n", (int)conf.pagers.title); + fprintf(autosavefile, "1353 %i\n", + (int)conf.focus.raise_after_next_focus); + fprintf(autosavefile, "1354 %i\n", (int)conf.warplist.enable); + fprintf(autosavefile, "1355 %i\n", + (int)conf.focus.warp_after_next_focus); + fprintf(autosavefile, "1356 %i\n", (int)conf.pagers.scanspeed); + fprintf(autosavefile, "1358 %i\n", (int)conf.group_config.set_border); + fprintf(autosavefile, "1359 %i\n", (int)conf.group_config.kill); + fprintf(autosavefile, "1360 %i\n", (int)conf.group_config.move); + fprintf(autosavefile, "1361 %i\n", (int)conf.group_config.raise); + fprintf(autosavefile, "1362 %i\n", (int)conf.group_config.iconify); + fprintf(autosavefile, "1363 %i\n", (int)conf.group_config.stick); + fprintf(autosavefile, "1364 %i\n", (int)conf.group_config.shade); + fprintf(autosavefile, "1365 %i\n", (int)conf.group_config.mirror); + fprintf(autosavefile, "1372 %i\n", (int)conf.group_swapmove); + fprintf(autosavefile, "1367 %i\n", (int)conf.focus.clickraises); + fprintf(autosavefile, "1368 %i\n", (int)conf.tooltips.showroottooltip); + fprintf(autosavefile, "1369 %i %i %i\n", (int)conf.pagers.sel_button, + (int)conf.pagers.win_button, (int)conf.pagers.menu_button); #ifdef HAS_XINERAMA - fprintf(autosavefile, "2013 %i\n", (int)mode.extra_head); + fprintf(autosavefile, "2013 %i\n", (int)conf.extra_head); #endif fprintf(autosavefile, "1000\n"); fprintf(autosavefile, "1001 0\n"); @@ -4223,7 +4231,7 @@ RecoverUserConfig(void) "Do you wish Enlightenment to recover its original system\n" "configuration and try again?\n")); RESET_ALERT; - mode.autosave = 0; + conf.autosave = 0; MapUnmap(1); if (getpid() == master_pid && init_win_ext) { diff --git a/src/coords.c b/src/coords.c index 14198b6b..2dba462e 100644 --- a/src/coords.c +++ b/src/coords.c @@ -35,7 +35,7 @@ SetCoords(int x, int y, int w, int h) EWin *ewin; int md; - if (!mode.geominfomode) + if (!conf.geominfomode) return; if (!tc) @@ -56,9 +56,9 @@ SetCoords(int x, int y, int w, int h) { md = 0; if (mode.mode == MODE_MOVE) - md = mode.movemode; + md = conf.movemode; else - md = mode.resizemode; + md = conf.resizemode; if ((md > 0) && ((cw >= (ewin->w)) || (ch >= (ewin->h)))) { cx = 0; @@ -68,7 +68,7 @@ SetCoords(int x, int y, int w, int h) { cx = 0; cy = 0; - if (mode.geominfomode == 1) + if (conf.geominfomode == 1) { switch (md) { diff --git a/src/desktops.c b/src/desktops.c index b849cae3..d198b759 100644 --- a/src/desktops.c +++ b/src/desktops.c @@ -125,38 +125,38 @@ ChangeNumberOfDesktops(int quantity) int pnum, i, num; EWin **lst; - pnum = mode.numdesktops; + pnum = conf.desks.numdesktops; for (i = quantity; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++) LowerDesktop(i); - mode.numdesktops = quantity; + conf.desks.numdesktops = quantity; - if (mode.numdesktops <= 0) - mode.numdesktops = 1; - else if (mode.numdesktops > ENLIGHTENMENT_CONF_NUM_DESKTOPS) - mode.numdesktops = ENLIGHTENMENT_CONF_NUM_DESKTOPS; + 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; lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN); if (lst) { for (i = 0; i < num; i++) { - if (lst[i]->desktop >= mode.numdesktops) - MoveEwinToDesktop(lst[i], mode.numdesktops - 1); + if (lst[i]->desktop >= conf.desks.numdesktops) + MoveEwinToDesktop(lst[i], conf.desks.numdesktops - 1); } Efree(lst); } - if (mode.numdesktops > pnum) + if (conf.desks.numdesktops > pnum) { - for (i = pnum; i < mode.numdesktops; i++) + for (i = pnum; i < conf.desks.numdesktops; i++) NewPagerForDesktop(i); } - else if (mode.numdesktops < pnum) + else if (conf.desks.numdesktops < pnum) { - for (i = mode.numdesktops; i < pnum; i++) + for (i = conf.desks.numdesktops; i < pnum; i++) DisablePagersForDesktop(i); } - if (desks.current >= mode.numdesktops) - GotoDesktop(mode.numdesktops - 1); + if (desks.current >= conf.desks.numdesktops) + GotoDesktop(conf.desks.numdesktops - 1); HintsSetDesktopConfig(); } @@ -1224,7 +1224,7 @@ GotoDesktop(int num) if (num < 0) EDBUG_RETURN_; - if (num >= mode.numdesktops) + if (num >= conf.desks.numdesktops) EDBUG_RETURN_; if (num == desks.current) EDBUG_RETURN_; @@ -1254,7 +1254,7 @@ GotoDesktop(int num) } else if ((mode.mode == MODE_MOVE) && (mode.ewin)) { - if ((mode.movemode > 0) && (!mode.moveresize_pending_ewin)) + if ((conf.movemode > 0) && (!mode.moveresize_pending_ewin)) { if (mode.ewin) { @@ -1264,7 +1264,7 @@ GotoDesktop(int num) mode.ewin->y = -99999; mode.ewin->reqx = -99999; mode.ewin->reqy = -99999; - DrawEwinShape(mode.ewin, mode.movemode, x, y, + DrawEwinShape(mode.ewin, conf.movemode, x, y, mode.ewin->client.w, mode.ewin->client.h, 3); } } @@ -1341,7 +1341,7 @@ GotoDesktop(int num) mode.moveresize_pending_ewin = NULL; - if ((mode.mode == MODE_MOVE) && (mode.movemode > 0) && (mode.ewin)) + if ((mode.mode == MODE_MOVE) && (conf.movemode > 0) && (mode.ewin)) { if (mode.ewin) { @@ -1352,14 +1352,14 @@ GotoDesktop(int num) mode.ewin->y = -99999; mode.ewin->reqx = -99999; mode.ewin->reqy = -99999; - if (mode.movemode == 5) + if (conf.movemode == 5) { - DrawEwinShape(mode.ewin, mode.movemode, x, y, + DrawEwinShape(mode.ewin, conf.movemode, x, y, mode.ewin->client.w, mode.ewin->client.h, 4); } else { - DrawEwinShape(mode.ewin, mode.movemode, x, y, + DrawEwinShape(mode.ewin, conf.movemode, x, y, mode.ewin->client.w, mode.ewin->client.h, 0); } } @@ -1387,7 +1387,7 @@ MoveDesktop(int num, int x, int y) EDBUG(3, "MoveDesktop"); if (num < 0) EDBUG_RETURN_; - if (num >= mode.numdesktops) + if (num >= conf.desks.numdesktops) EDBUG_RETURN_; if (num == 0) EDBUG_RETURN_; @@ -1492,7 +1492,7 @@ RaiseDesktop(int num) EDBUG(3, "RaiseDesktop"); - if ((num < 0) || (num >= mode.numdesktops)) + if ((num < 0) || (num >= conf.desks.numdesktops)) EDBUG_RETURN_; BeginNewDeskFocus(); @@ -1531,7 +1531,7 @@ LowerDesktop(int num) { EDBUG(3, "LowerDesktop"); - if ((num <= 0) || (num >= mode.numdesktops)) + if ((num <= 0) || (num >= conf.desks.numdesktops)) EDBUG_RETURN_; BeginNewDeskFocus(); @@ -1561,7 +1561,7 @@ HideDesktop(int num) { EDBUG(3, "HideDesktop"); - if ((num < 0) || (num >= mode.numdesktops)) + if ((num < 0) || (num >= conf.desks.numdesktops)) EDBUG_RETURN_; if (num == 0) EDBUG_RETURN_; @@ -1584,7 +1584,7 @@ ShowDesktop(int num) if (num < 0) EDBUG_RETURN_; - if (num >= mode.numdesktops) + if (num >= conf.desks.numdesktops) EDBUG_RETURN_; desks.desk[num].viewable = 1; @@ -1732,7 +1732,7 @@ UncoverDesktop(int num) EDBUG(3, "UncoverDesktop"); if (num < 0) EDBUG_RETURN_; - if (num >= mode.numdesktops) + if (num >= conf.desks.numdesktops) EDBUG_RETURN_; desks.desk[num].viewable = 1; RefreshDesktop(num); @@ -1982,7 +1982,7 @@ DesktopAccounting() for (i = 0; i < num; i++) { if ((lst[i]->pmap == 0) || - ((now - lst[i]->last_viewed) <= mode.desktop_bg_timeout)) + ((now - lst[i]->last_viewed) <= conf.desktop_bg_timeout)) continue; IMLIB1_SET_CONTEXT(lst[i] == desks.desk[0].bg); diff --git a/src/dock.c b/src/dock.c index cea17bf9..8d2b5765 100644 --- a/src/dock.c +++ b/src/dock.c @@ -34,11 +34,11 @@ DockIt(EWin * ewin) Esnprintf(id, sizeof(id), "%i", (unsigned)ewin->client.win); ac = 0; ic = FindItem("DEFAULT_DOCK_BUTTON", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); - if (mode.dockstartx >= 0) + if (conf.dock.startx >= 0) { bt = ButtonCreate(id, ic, ac, NULL, NULL, 1, 0, 64, 64, 64, 64, 0, 0, - mode.dockstartx, 0, mode.dockstarty, 0, 0, 0, 0, 0, 1, - 0, 1); + conf.dock.startx, 0, conf.dock.starty, 0, 0, 0, 0, 0, + 1, 0, 1); } else { @@ -51,7 +51,7 @@ DockIt(EWin * ewin) EDBUG_RETURN_; ButtonShow(bt); - ButtonFindEmptySpotFor(bt, "DOCK_APP_BUTTON", mode.dockdirmode); + ButtonFindEmptySpotFor(bt, "DOCK_APP_BUTTON", conf.dock.dirmode); AddItem(ewin, "EWIN", ewin->client.win, LIST_TYPE_EWIN); AddItem(bt, "DOCK_APP_BUTTON", ewin->client.win, LIST_TYPE_BUTTON); diff --git a/src/draw.c b/src/draw.c index 13dd3974..bd955518 100644 --- a/src/draw.c +++ b/src/draw.c @@ -23,7 +23,7 @@ #include "E.h" /* Hmmm... */ -#define HIQ mode.pager_hiq +#define HIQ conf.pagers.hiq void HandleDrawQueue() @@ -33,13 +33,13 @@ HandleDrawQueue() char already, p_queue; EDBUG(4, "HandleDrawQueue"); - if ((mode.mode == MODE_MOVE) && (mode.movemode > 0)) + if ((mode.mode == MODE_MOVE) && (conf.movemode > 0)) EDBUG_RETURN_; - if ((mode.mode == MODE_RESIZE) && (mode.resizemode > 0)) + if ((mode.mode == MODE_RESIZE) && (conf.resizemode > 0)) EDBUG_RETURN_; - if ((mode.mode == MODE_RESIZE_H) && (mode.resizemode > 0)) + if ((mode.mode == MODE_RESIZE_H) && (conf.resizemode > 0)) EDBUG_RETURN_; - if ((mode.mode == MODE_RESIZE_V) && (mode.resizemode > 0)) + if ((mode.mode == MODE_RESIZE_V) && (conf.resizemode > 0)) EDBUG_RETURN_; p_queue = queue_up; queue_up = 0; @@ -1650,9 +1650,9 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast) draw_pi = ECreatePixImg(root.win, ewin->w, ewin->h); if ((!root_pi) || (!ewin_pi) || (!draw_pi)) { - mode.movemode = 0; + conf.movemode = 0; UngrabX(); - DrawEwinShape(ewin, mode.movemode, x, y, w, h, + DrawEwinShape(ewin, conf.movemode, x, y, w, h, firstlast); goto exit; } diff --git a/src/events.c b/src/events.c index 6b45d99a..b5583c69 100644 --- a/src/events.c +++ b/src/events.c @@ -228,7 +228,7 @@ HEnterNotify(XEvent * ev) */ if (ev->xany.window == root.win) { - if (!mode.focuswin || FOCUS_POINTER == mode.focusmode) + if (!mode.focuswin || FOCUS_POINTER == conf.focus.mode) HandleFocusWindow(root.focuswin); } else diff --git a/src/evhandlers.c b/src/evhandlers.c index 6dc02c7e..0842b120 100644 --- a/src/evhandlers.c +++ b/src/evhandlers.c @@ -61,7 +61,7 @@ ToolTipTimeout(int val, void *data) if (ac->tooltipstring) { - if (mode.showroottooltip) + if (conf.tooltips.showroottooltip) { ShowToolTip(ttip, ac->tooltipstring, ac, x, y); } @@ -70,7 +70,7 @@ ToolTipTimeout(int val, void *data) int i; int show = 1; - for (i = 0; i < mode.numdesktops; i++) + for (i = 0; i < conf.desks.numdesktops; i++) { if (win == desks.desk[i].win) show = 0; @@ -91,8 +91,8 @@ TooltipsHandleEvent(void) if (ttip) HideToolTip(ttip); RemoveTimerEvent("TOOLTIP_TIMEOUT"); - if (mode.tooltips) - DoIn("TOOLTIP_TIMEOUT", mode.tiptime, ToolTipTimeout, 0, NULL); + if (conf.tooltips.enable) + DoIn("TOOLTIP_TIMEOUT", conf.tooltips.tiptime, ToolTipTimeout, 0, NULL); } void @@ -120,7 +120,7 @@ HandleFocusWindowIn(Window win) { mode.focuswin->active = 0; DrawEwin(mode.focuswin); - if (mode.focusmode == FOCUS_CLICK) + if (conf.focus.mode == FOCUS_CLICK) XGrabButton(disp, AnyButton, AnyModifier, mode.focuswin->win_container, False, ButtonPressMask, GrabModeSync, GrabModeAsync, None, @@ -137,7 +137,7 @@ HandleFocusWindowIn(Window win) { mode.focuswin->active = 1; DrawEwin(mode.focuswin); - if (mode.focusmode == FOCUS_CLICK) + if (conf.focus.mode == FOCUS_CLICK) { XUngrabButton(disp, AnyButton, AnyModifier, mode.focuswin->win_container); @@ -161,9 +161,9 @@ HandleFocusWindow(Window win) found_ewin = FindEwinByChildren(win); if (!found_ewin) found_ewin = FindEwinByBase(win); - if (mode.focusmode == FOCUS_CLICK) + if (conf.focus.mode == FOCUS_CLICK) mode.mouse_over_win = found_ewin; - else if (mode.focusmode == FOCUS_SLOPPY) + else if (conf.focus.mode == FOCUS_SLOPPY) { if (!found_ewin) ICCCM_Cmap(NULL); @@ -171,7 +171,7 @@ HandleFocusWindow(Window win) FocusToEWin(found_ewin); mode.mouse_over_win = found_ewin; } - else if (mode.focusmode == FOCUS_POINTER) + else if (conf.focus.mode == FOCUS_POINTER) { if (!found_ewin) found_ewin = GetEwinPointerInClient(); @@ -257,7 +257,7 @@ HandleMotion(XEvent * ev) int screen_snap_dist; ewin = mode.ewin; - if (mode.swapmovemode /* && mode.group_swapmove */ ) + if (mode.swapmovemode /* && conf.group_swapmove */ ) { gwins = ListWinGroupMembersForEwin(ewin, ACTION_MOVE, 1, &num); @@ -272,7 +272,7 @@ HandleMotion(XEvent * ev) && (mode.ewin == mode.moveresize_pending_ewin)) { for (i = 0; i < num; i++) - DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x, + DrawEwinShape(gwins[i], conf.movemode, gwins[i]->x, gwins[i]->y, gwins[i]->client.w, gwins[i]->client.h, 0); mode.moveresize_pending_ewin = NULL; @@ -343,7 +343,8 @@ HandleMotion(XEvent * ev) else ndy = min_dy; screen_snap_dist = - mode.constrained ? (root.w + root.h) : mode.screen_snap_dist; + mode.constrained ? (root.w + + root.h) : conf.snap.screen_snap_dist; for (i = 0; i < num; i++) { /* jump out of snap horizontally */ @@ -363,7 +364,7 @@ HandleMotion(XEvent * ev) && (!(IN_RANGE (gwins[i]->reqx, gwins[i]->x, - mode.edge_snap_dist))))))) + conf.snap.edge_snap_dist))))))) { jumpx = 1; ndx = gwins[i]->reqx - gwins[i]->x + dx; @@ -385,7 +386,7 @@ HandleMotion(XEvent * ev) && (!(IN_RANGE (gwins[i]->reqy, gwins[i]->y, - mode.edge_snap_dist))))))) + conf.snap.edge_snap_dist))))))) { jumpy = 1; ndy = gwins[i]->reqy - gwins[i]->y + dy; @@ -395,12 +396,12 @@ HandleMotion(XEvent * ev) { /* if its opaque move mode check to see if we have to float */ /* the window aboe all desktops (reparent to root) */ - if (mode.movemode == 0) + if (conf.movemode == 0) DetermineEwinFloat(gwins[i], ndx, ndy); /* draw the new position of the window */ prx = gwins[i]->reqx; pry = gwins[i]->reqy; - DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x + ndx, + DrawEwinShape(gwins[i], conf.movemode, gwins[i]->x + ndx, gwins[i]->y + ndy, gwins[i]->client.w, gwins[i]->client.h, mode.firstlast); /* if we didnt jump the winow after a resist at the edge */ @@ -411,7 +412,7 @@ HandleMotion(XEvent * ev) gwins[i]->reqy = pry + dy; /* swapping of group member locations: */ - if (mode.swapmovemode && mode.group_swapmove) + if (mode.swapmovemode && conf.group_swapmove) { EWin **all_gwins; int all_gwins_num; @@ -492,7 +493,7 @@ HandleMotion(XEvent * ev) y = mode.win_y + mode.win_h - h; ewin->client.w = pw; ewin->client.h = ph; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + DrawEwinShape(ewin, conf.resizemode, x, y, w, h, mode.firstlast); break; case 1: @@ -509,7 +510,7 @@ HandleMotion(XEvent * ev) else y = mode.win_y + mode.win_h - h; ewin->client.h = ph; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + DrawEwinShape(ewin, conf.resizemode, x, y, w, h, mode.firstlast); break; case 2: @@ -526,7 +527,7 @@ HandleMotion(XEvent * ev) else x = mode.win_x + mode.win_w - w; ewin->client.w = pw; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + DrawEwinShape(ewin, conf.resizemode, x, y, w, h, mode.firstlast); break; case 3: @@ -534,7 +535,7 @@ HandleMotion(XEvent * ev) h = mode.win_h + (mode.y - mode.start_y); x = ewin->x; y = ewin->y; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + DrawEwinShape(ewin, conf.resizemode, x, y, w, h, mode.firstlast); break; default: @@ -562,7 +563,7 @@ HandleMotion(XEvent * ev) else x = mode.win_x + mode.win_w - w; ewin->client.w = pw; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + DrawEwinShape(ewin, conf.resizemode, x, y, w, h, mode.firstlast); break; case 1: @@ -570,7 +571,7 @@ HandleMotion(XEvent * ev) h = ewin->client.h; x = ewin->x; y = ewin->y; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + DrawEwinShape(ewin, conf.resizemode, x, y, w, h, mode.firstlast); break; default: @@ -598,7 +599,7 @@ HandleMotion(XEvent * ev) else y = mode.win_y + mode.win_h - h; ewin->client.h = ph; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + DrawEwinShape(ewin, conf.resizemode, x, y, w, h, mode.firstlast); break; case 1: @@ -606,7 +607,7 @@ HandleMotion(XEvent * ev) h = mode.win_h + (mode.y - mode.start_y); x = ewin->x; y = ewin->y; - DrawEwinShape(ewin, mode.resizemode, x, y, w, h, + DrawEwinShape(ewin, conf.resizemode, x, y, w, h, mode.firstlast); break; default: @@ -660,8 +661,8 @@ HandleMotion(XEvent * ev) x = -x; if (y < 0) y = -y; - if ((x > mode.button_move_resistance) - || (y > mode.button_move_resistance)) + if ((x > conf.button_move_resistance) + || (y > conf.button_move_resistance)) mode.button_move_pending = 0; } if (!mode.button_move_pending) @@ -669,7 +670,7 @@ HandleMotion(XEvent * ev) if (mode.button) { ButtonMoveRelative(mode.button, dx, dy); - if (mode.deskmode == MODE_DESKRAY) + if (conf.deskmode == MODE_DESKRAY) { MoveDesktop(mode.deskdrag, desks.desk[mode.deskdrag].x, desks.desk[mode.deskdrag].y + dy); @@ -825,9 +826,9 @@ HandleMotion(XEvent * ev) } } SlideEwinsTo(menus, fx, fy, tx, ty, - mode.cur_menu_depth, mode.shadespeed); + mode.cur_menu_depth, conf.shadespeed); if (((xdist != 0) || (ydist != 0)) - && (mode.warpmenus)) + && (conf.warpmenus)) XWarpPointer(disp, None, None, 0, 0, 0, 0, xdist, ydist); #ifdef HAS_XINERAMA @@ -888,7 +889,7 @@ HandleDestroy(XEvent * ev) } if (mode.doingslide) { - DrawEwinShape(ewin, mode.slidemode, ewin->x, ewin->y, + DrawEwinShape(ewin, conf.slidemode, ewin->x, ewin->y, ewin->client.w, ewin->client.h, 2); mode.doingslide = 0; } @@ -898,7 +899,7 @@ HandleDestroy(XEvent * ev) mode.mouse_over_win = NULL; if (ewin == mode.ewin) mode.ewin = NULL; - if (mode.dockapp_support && ewin->docked) + if (conf.dockapp_support && ewin->docked) DockDestroy(ewin); FreeEwin(ewin); HintsSetClientList(); @@ -1148,7 +1149,7 @@ HandleUnmap(XEvent * ev) if (ewin->pager) PagerEventUnmap(ewin->pager); - if (mode.dockapp_support && ewin->docked) + if (conf.dockapp_support && ewin->docked) DockDestroy(ewin); if (ewin == mode.ewin) @@ -1324,7 +1325,7 @@ HandleMouseDown(XEvent * ev) mode.context_win = win; desk_click = -1; - for (i = 0; i < mode.numdesktops; i++) + for (i = 0; i < conf.desks.numdesktops; i++) { if (win == desks.desk[i].win) { @@ -1350,7 +1351,7 @@ HandleMouseDown(XEvent * ev) if (MenusEventMouseDown(ev)) goto exit; - if ((mode.clickalways) || (mode.focusmode == FOCUS_CLICK)) + if ((conf.focus.clickraises) || (conf.focus.mode == FOCUS_CLICK)) { ewin = FindEwinByChildren(win); if (!ewin) @@ -1475,7 +1476,7 @@ HandleMouseUp(XEvent * ev) gwins = ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup, &num); - if ((mode.movemode == 0) && (mode.mode == MODE_MOVE)) + if ((conf.movemode == 0) && (mode.mode == MODE_MOVE)) for (i = 0; i < num; i++) DetermineEwinFloat(gwins[i], 0, 0); Efree(gwins); diff --git a/src/ewmh.c b/src/ewmh.c index 236ba753..7af3fdb1 100644 --- a/src/ewmh.c +++ b/src/ewmh.c @@ -274,14 +274,14 @@ EWMH_SetDesktopCount(void) EDBUG(6, "EWMH_SetDesktopCount"); - val = mode.numdesktops; + val = conf.desks.numdesktops; _ATOM_SET_CARD32(_NET_NUMBER_OF_DESKTOPS, root.win, &val, 1); - for (i = 0; i < mode.numdesktops; i++) + for (i = 0; i < conf.desks.numdesktops; i++) { wl[i] = desks.desk[i].win; } - _ATOM_SET_WINDOW(_NET_VIRTUAL_ROOTS, root.win, &wl, mode.numdesktops); + _ATOM_SET_WINDOW(_NET_VIRTUAL_ROOTS, root.win, &wl, conf.desks.numdesktops); EDBUG_RETURN_; } @@ -295,7 +295,7 @@ EWMH_SetDesktopNames(void) EDBUG(6, "EWMH_SetDesktopNames"); s = buf; - for (i = 0; i < mode.numdesktops; i++) + for (i = 0; i < conf.desks.numdesktops; 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 * mode.numdesktops; + n_coord = 4 * conf.desks.numdesktops; p_coord = Emalloc(n_coord * sizeof(CARD32)); if (p_coord) { - for (i = 0; i < mode.numdesktops; i++) + for (i = 0; i < conf.desks.numdesktops; 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 * mode.numdesktops; + n_coord = 2 * conf.desks.numdesktops; p_coord = Emalloc(n_coord * sizeof(CARD32)); if (p_coord) { - for (i = 0; i < mode.numdesktops; i++) + for (i = 0; i < conf.desks.numdesktops; 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 fde8f4cd..0586c2cd 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 < mode.numdesktops; i++) + for (i = 0; i < conf.desks.numdesktops; i++) { ActionClass *ac; diff --git a/src/focus.c b/src/focus.c index 85667fea..582d5ae0 100644 --- a/src/focus.c +++ b/src/focus.c @@ -33,7 +33,7 @@ AutoraiseTimeout(int val, void *data) { EWin *found_ewin; - if (mode.focusmode == FOCUS_CLICK) + if (conf.focus.mode == FOCUS_CLICK) return; found_ewin = FindItem("", val, LIST_FINDBY_ID, LIST_TYPE_EWIN); if (found_ewin) @@ -60,7 +60,7 @@ GetNextFocusEwin(void) int i, num0, num, ax, ay; EDBUG(5, "GetNextFocusEwin"); - if (mode.display_warp) + if (conf.warplist.enable) { WarpFocus(1); EDBUG_RETURN_; @@ -97,9 +97,9 @@ GetNextFocusEwin(void) else ewin = lst[0]; Efree(lst); - if (mode.raise_on_next_focus) + if (conf.focus.raise_on_next_focus) RaiseEwin(ewin); - if (mode.warp_on_next_focus) + if (conf.focus.warp_on_next_focus) XWarpPointer(disp, None, ewin->win, 0, 0, 0, 0, ewin->w / 2, ewin->h / 2); FocusToEWin(ewin); @@ -108,9 +108,9 @@ GetNextFocusEwin(void) } ewin = lst[0]; Efree(lst); - if (mode.raise_on_next_focus) + if (conf.focus.raise_on_next_focus) RaiseEwin(ewin); - if (mode.warp_on_next_focus) + if (conf.focus.warp_on_next_focus) XWarpPointer(disp, None, ewin->win, 0, 0, 0, 0, ewin->w / 2, ewin->h / 2); FocusToEWin(ewin); @@ -125,7 +125,7 @@ GetPrevFocusEwin(void) int i, num0, num, ax, ay; EDBUG(5, "GetPrevFocusEwin"); - if (mode.display_warp) + if (conf.warplist.enable) { WarpFocus(-1); EDBUG_RETURN_; @@ -170,9 +170,9 @@ GetPrevFocusEwin(void) else ewin = lst[i - 1]; Efree(lst); - if (mode.raise_on_next_focus) + if (conf.focus.raise_on_next_focus) RaiseEwin(ewin); - if (mode.warp_on_next_focus) + if (conf.focus.warp_on_next_focus) XWarpPointer(disp, None, ewin->win, 0, 0, 0, 0, ewin->w / 2, ewin->h / 2); FocusToEWin(ewin); @@ -181,9 +181,9 @@ GetPrevFocusEwin(void) } ewin = lst[0]; Efree(lst); - if (mode.raise_on_next_focus) + if (conf.focus.raise_on_next_focus) RaiseEwin(ewin); - if (mode.warp_on_next_focus) + if (conf.focus.warp_on_next_focus) XWarpPointer(disp, None, ewin->win, 0, 0, 0, 0, ewin->w / 2, ewin->h / 2); FocusToEWin(ewin); @@ -205,7 +205,7 @@ FixFocus(void) for (i = 0; i < num; i++) { ewin = lst[i]; - if (mode.focusmode == FOCUS_CLICK) + if (conf.focus.mode == FOCUS_CLICK) { if (!(ewin->active)) XGrabButton(disp, AnyButton, AnyModifier, @@ -237,10 +237,10 @@ FocusToEWin(EWin * ewin) EDBUG_RETURN_; ICCCM_Cmap(ewin); - if ((!ewin) && (mode.focusmode != FOCUS_POINTER)) + if ((!ewin) && (conf.focus.mode != FOCUS_POINTER)) { ewin = FindItem("", 0, LIST_FINDBY_NONE, LIST_TYPE_EWIN); - if (mode.focusmode == FOCUS_CLICK) + if (conf.focus.mode == FOCUS_CLICK) { if ((mode.focuswin) && (ewin)) { @@ -283,13 +283,13 @@ FocusToEWin(EWin * ewin) mode.windowdestroy = 0; if (mode.focuswin) { - if (mode.autoraise) + if (conf.autoraise) RemoveTimerEvent("AUTORAISE_TIMEOUT"); mode.focuswin->active = 0; /* losing the focus may cause the titlebar to be resized */ CalcEwinSizes(mode.focuswin); DrawEwin(mode.focuswin); - if ((mode.clickalways) || (mode.focusmode == FOCUS_CLICK)) + if ((conf.focus.clickraises) || (conf.focus.mode == FOCUS_CLICK)) XGrabButton(disp, AnyButton, AnyModifier, mode.focuswin->win_container, False, ButtonPressMask, GrabModeSync, GrabModeAsync, None, None); @@ -312,7 +312,7 @@ FocusToEWin(EWin * ewin) mode.focuswin->active = 1; } /* gaining the focus may cause the titlebar to be resized */ - if ((mode.focusmode == FOCUS_CLICK) && (mode.focuswin)) + if ((conf.focus.mode == FOCUS_CLICK) && (mode.focuswin)) { XUngrabButton(disp, AnyButton, AnyModifier, mode.focuswin->win_container); @@ -326,11 +326,11 @@ FocusToEWin(EWin * ewin) ICCCM_Focus(mode.focuswin); } /* ReZoom(mode.focuswin); */ - if ((mode.autoraise) && (mode.focuswin) && (!mode.focuswin->menu) - && (mode.focusmode != FOCUS_CLICK)) - DoIn("AUTORAISE_TIMEOUT", mode.autoraisetime, AutoraiseTimeout, + if ((conf.autoraise) && (mode.focuswin) && (!mode.focuswin->menu) + && (conf.focus.mode != FOCUS_CLICK)) + DoIn("AUTORAISE_TIMEOUT", conf.autoraisetime, AutoraiseTimeout, mode.focuswin->client.win, NULL); - if (mode.focusmode == FOCUS_CLICK) + if (conf.focus.mode == FOCUS_CLICK) { if (ewin) { @@ -491,7 +491,7 @@ NewDeskFocus(void) SubstructureRedirectMask | KeyPressMask | KeyReleaseMask | PointerMotionMask); - if ((mode.focusmode == FOCUS_POINTER) || (mode.focusmode == FOCUS_SLOPPY)) + if ((conf.focus.mode == FOCUS_POINTER) || (conf.focus.mode == FOCUS_SLOPPY)) { ewin = GetEwinPointerInClient(); if (ewin) @@ -539,13 +539,13 @@ FocusToNone(void) ICCCM_Cmap(NULL); if (mode.focuswin) { - if (mode.autoraise) + if (conf.autoraise) RemoveTimerEvent("AUTORAISE_TIMEOUT"); mode.focuswin->active = 0; /* losing the focus may cause the titlebar to be resized */ CalcEwinSizes(mode.focuswin); DrawEwin(mode.focuswin); - if (mode.focusmode == FOCUS_CLICK) + if (conf.focus.mode == FOCUS_CLICK) XGrabButton(disp, AnyButton, AnyModifier, mode.focuswin->win_container, False, ButtonPressMask, GrabModeSync, GrabModeAsync, None, None); diff --git a/src/globals.c b/src/globals.c index b670773e..1c5f37ed 100644 --- a/src/globals.c +++ b/src/globals.c @@ -46,13 +46,12 @@ Drawable vIcDrw; FnlibData *pFnlibData; #endif List *lists; -int event_base_shape; -Window comms_win; Root root; +int event_base_shape; int (*(ActionFunctions[ACTION_NUMBEROF])) (void *); +EConf conf; EMode mode; Desktops desks; -Window grab_window; Window init_win1 = 0; Window init_win2 = 0; Window init_win_ext = 0; diff --git a/src/gnome.c b/src/gnome.c index 5de0f1e1..46db82df 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 = mode.numdesktops; + val = conf.desks.numdesktops; 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 < mode.numdesktops; i++) + for (i = 0; i < conf.desks.numdesktops; i++) { Esnprintf(s, sizeof(s), "%i", i); names[i] = duplicate(s); } - if (XStringListToTextProperty(names, mode.numdesktops, &text)) + if (XStringListToTextProperty(names, conf.desks.numdesktops, &text)) { XSetTextProperty(disp, root.win, &text, atom_set); XFree(text.value); } - for (i = 0; i < mode.numdesktops; i++) + for (i = 0; i < conf.desks.numdesktops; i++) if (names[i]) Efree(names[i]); EDBUG_RETURN_; diff --git a/src/grabs.c b/src/grabs.c index 12afac3c..667e8934 100644 --- a/src/grabs.c +++ b/src/grabs.c @@ -1,4 +1,3 @@ - /* * Copyright (C) 2000-2003 Carsten Haitzler, Geoff Harrison and various contributors * @@ -23,6 +22,8 @@ */ #include "E.h" +static Window grab_window; + void GrabActionKey(Action * a) { diff --git a/src/groups.c b/src/groups.c index 9bf6afed..bfffc073 100644 --- a/src/groups.c +++ b/src/groups.c @@ -36,14 +36,14 @@ CreateGroup() g->index = (int)((GetTime() - (floor(t / 1000) * 1000)) * 10000); /* g->index = (int)(GetTime() * 100); */ - g->cfg.iconify = mode.group_config.iconify; - g->cfg.kill = mode.group_config.kill; - g->cfg.move = mode.group_config.move; - g->cfg.raise = mode.group_config.raise; - g->cfg.set_border = mode.group_config.set_border; - g->cfg.stick = mode.group_config.stick; - g->cfg.shade = mode.group_config.shade; - g->cfg.mirror = mode.group_config.mirror; + g->cfg.iconify = conf.group_config.iconify; + g->cfg.kill = conf.group_config.kill; + g->cfg.move = conf.group_config.move; + g->cfg.raise = conf.group_config.raise; + g->cfg.set_border = conf.group_config.set_border; + g->cfg.stick = conf.group_config.stick; + g->cfg.shade = conf.group_config.shade; + g->cfg.mirror = conf.group_config.mirror; g->num_members = 0; g->members = NULL; @@ -631,7 +631,7 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action) table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); diff --git a/src/hints.c b/src/hints.c index 61295c6a..4e71c597 100644 --- a/src/hints.c +++ b/src/hints.c @@ -48,7 +48,7 @@ HintsInit(void) XChangeProperty(disp, root.win, atom, XA_STRING, 8, PropModeReplace, (unsigned char *)e_wm_version, strlen(e_wm_version)); - mode.hints_set_xroot_info_on_root_window = 0; + conf.hints.set_xroot_info_on_root_window = 0; EDBUG_RETURN_; } @@ -303,7 +303,7 @@ HintsSetRootInfo(Window win, Pixmap pmap, int color) (unsigned char *)&alive_win, 1); } - if (mode.hints_set_xroot_info_on_root_window) + if (conf.hints.set_xroot_info_on_root_window) win = root.win; XChangeProperty(disp, win, a, XA_PIXMAP, 32, PropModeReplace, (unsigned char *)&pmap, 1); diff --git a/src/icccm.c b/src/icccm.c index ade364f6..b83fbdee 100644 --- a/src/icccm.c +++ b/src/icccm.c @@ -605,7 +605,7 @@ ICCCM_GetGeoms(EWin * ewin, Atom atom_change) int dsk; dsk = ewin->desktop; - if ((dsk < 0) || (dsk >= mode.numdesktops)) + if ((dsk < 0) || (dsk >= conf.desks.numdesktops)) dsk = desks.current; ewin->client.x -= desks.desk[dsk].x; ewin->client.y -= desks.desk[dsk].y; diff --git a/src/iclass.c b/src/iclass.c index 06d7a796..8a719c98 100644 --- a/src/iclass.c +++ b/src/iclass.c @@ -879,7 +879,7 @@ IclassApply(ImageClass * iclass, Window win, int w, int h, int active, { ImageStateMakePmapMask(is, win, NULL, 1, w, h); - if ((is->unloadable) || (mode.memory_paranoia)) + if ((is->unloadable) || (conf.memory_paranoia)) { imlib_context_set_image(is->im); imlib_free_image(); @@ -935,7 +935,7 @@ IclassApplyCopy(ImageClass * iclass, Window win, int w, int h, int active, { ImageStateMakePmapMask(is, win, pmm, make_mask, w, h); - if ((is->unloadable) || (mode.memory_paranoia)) + if ((is->unloadable) || (conf.memory_paranoia)) { imlib_context_set_image(is->im); imlib_free_image(); diff --git a/src/iconify.c b/src/iconify.c index 610c6ea9..4f020576 100644 --- a/src/iconify.c +++ b/src/iconify.c @@ -233,10 +233,10 @@ IconboxIconifyEwin(Iconbox * ib, EWin * ewin) { char prev_warp; - prev_warp = mode.display_warp; - mode.display_warp = 0; + prev_warp = conf.warplist.enable; + conf.warplist.enable = 0; GetPrevFocusEwin(); - mode.display_warp = prev_warp; + conf.warplist.enable = prev_warp; } if (ewin->has_transients) { diff --git a/src/ipc.c b/src/ipc.c index f1b1b8b1..8f9b0bbd 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -886,15 +886,15 @@ IPC_DockConfig(char *params, Client * c) if (!strcmp(param2, "?")) { Esnprintf(buf, sizeof(buf), "dock_startposition: %d %d", - mode.dockstartx, mode.dockstarty); + conf.dock.startx, conf.dock.starty); } else { word(params, 3, param3); if (param3[0]) { - mode.dockstartx = atoi(param2); - mode.dockstarty = atoi(param3); + conf.dock.startx = atoi(param2); + conf.dock.starty = atoi(param3); } else { @@ -915,19 +915,19 @@ IPC_DockConfig(char *params, Client * c) { if (!strcmp(param2, "?")) { - if (mode.dockdirmode == DOCK_LEFT) + if (conf.dock.dirmode == DOCK_LEFT) { Esnprintf(buf, sizeof(buf), "dock_dir: left"); } - else if (mode.dockdirmode == DOCK_RIGHT) + else if (conf.dock.dirmode == DOCK_RIGHT) { Esnprintf(buf, sizeof(buf), "dock_dir: right"); } - else if (mode.dockdirmode == DOCK_UP) + else if (conf.dock.dirmode == DOCK_UP) { Esnprintf(buf, sizeof(buf), "dock_dir: up"); } - else if (mode.dockdirmode == DOCK_DOWN) + else if (conf.dock.dirmode == DOCK_DOWN) { Esnprintf(buf, sizeof(buf), "dock_dir: down"); } @@ -940,19 +940,19 @@ IPC_DockConfig(char *params, Client * c) } else if (!strcmp(param2, "left")) { - mode.dockdirmode = DOCK_LEFT; + conf.dock.dirmode = DOCK_LEFT; } else if (!strcmp(param2, "right")) { - mode.dockdirmode = DOCK_RIGHT; + conf.dock.dirmode = DOCK_RIGHT; } else if (!strcmp(param2, "up")) { - mode.dockdirmode = DOCK_UP; + conf.dock.dirmode = DOCK_UP; } else if (!strcmp(param2, "down")) { - mode.dockdirmode = DOCK_DOWN; + conf.dock.dirmode = DOCK_DOWN; } else { @@ -972,19 +972,19 @@ IPC_DockConfig(char *params, Client * c) if (!strcmp(param2, "?")) { Esnprintf(buf, sizeof(buf), "dockapp support: %s", - (mode.dockapp_support) ? "enabled" : + (conf.dockapp_support) ? "enabled" : "disabled"); } else if ((!strcmp(param2, "on")) || (!strcmp(param2, "enable"))) { - mode.dockapp_support = 1; + conf.dockapp_support = 1; Esnprintf(buf, sizeof(buf), "dockapp support: enabled"); } else if ((!strcmp(param2, "off")) || (!strcmp(param2, "disable"))) { - mode.dockapp_support = 0; + conf.dockapp_support = 0; Esnprintf(buf, sizeof(buf), "dockapp support: disabled"); } } @@ -2293,15 +2293,15 @@ IPC_AdvancedFocus(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.all_new_windows_get_focus = 1; + conf.focus.all_new_windows_get_focus = 1; } else if (!strcmp(param2, "off")) { - mode.all_new_windows_get_focus = 0; + conf.focus.all_new_windows_get_focus = 0; } else if (!strcmp(param2, "?")) { - if (mode.all_new_windows_get_focus) + if (conf.focus.all_new_windows_get_focus) { Esnprintf(buf, sizeof(buf), "new_window_focus: on"); } @@ -2319,15 +2319,15 @@ IPC_AdvancedFocus(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.display_warp = 1; + conf.warplist.enable = 1; } else if (!strcmp(param2, "off")) { - mode.display_warp = 0; + conf.warplist.enable = 0; } else if (!strcmp(param2, "?")) { - if (mode.display_warp) + if (conf.warplist.enable) { Esnprintf(buf, sizeof(buf), "focus_list: on"); } @@ -2345,15 +2345,15 @@ IPC_AdvancedFocus(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.new_transients_get_focus = 1; + conf.focus.new_transients_get_focus = 1; } else if (!strcmp(param2, "off")) { - mode.new_transients_get_focus = 0; + conf.focus.new_transients_get_focus = 0; } else if (!strcmp(param2, "?")) { - if (mode.new_transients_get_focus) + if (conf.focus.new_transients_get_focus) { Esnprintf(buf, sizeof(buf), "new_popup_window_focus: on"); @@ -2373,15 +2373,15 @@ IPC_AdvancedFocus(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.new_transients_get_focus_if_group_focused = 1; + conf.focus.new_transients_get_focus_if_group_focused = 1; } else if (!strcmp(param2, "off")) { - mode.new_transients_get_focus_if_group_focused = 0; + conf.focus.new_transients_get_focus_if_group_focused = 0; } else if (!strcmp(param2, "?")) { - if (mode.new_transients_get_focus_if_group_focused) + if (conf.focus.new_transients_get_focus_if_group_focused) { Esnprintf(buf, sizeof(buf), "new_popup_of_owner_focus: on"); @@ -2401,15 +2401,15 @@ IPC_AdvancedFocus(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.raise_on_next_focus = 1; + conf.focus.raise_on_next_focus = 1; } else if (!strcmp(param2, "off")) { - mode.raise_on_next_focus = 0; + conf.focus.raise_on_next_focus = 0; } else if (!strcmp(param2, "?")) { - if (mode.raise_on_next_focus) + if (conf.focus.raise_on_next_focus) { Esnprintf(buf, sizeof(buf), "raise_on_keyboard_focus_switch: on"); @@ -2429,15 +2429,15 @@ IPC_AdvancedFocus(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.raise_after_next_focus = 1; + conf.focus.raise_after_next_focus = 1; } else if (!strcmp(param2, "off")) { - mode.raise_after_next_focus = 0; + conf.focus.raise_after_next_focus = 0; } else if (!strcmp(param2, "?")) { - if (mode.raise_after_next_focus) + if (conf.focus.raise_after_next_focus) { Esnprintf(buf, sizeof(buf), "raise_after_keyboard_focus_switch: on"); @@ -2457,15 +2457,15 @@ IPC_AdvancedFocus(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.display_warp = 1; + conf.warplist.enable = 1; } else if (!strcmp(param2, "off")) { - mode.display_warp = 0; + conf.warplist.enable = 0; } else if (!strcmp(param2, "?")) { - if (mode.display_warp) + if (conf.warplist.enable) { Esnprintf(buf, sizeof(buf), "display_warp: on"); } @@ -2483,15 +2483,15 @@ IPC_AdvancedFocus(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.warp_on_next_focus = 1; + conf.focus.warp_on_next_focus = 1; } else if (!strcmp(param2, "off")) { - mode.warp_on_next_focus = 0; + conf.focus.warp_on_next_focus = 0; } else if (!strcmp(param2, "?")) { - if (mode.warp_on_next_focus) + if (conf.focus.warp_on_next_focus) { Esnprintf(buf, sizeof(buf), "pointer_to_keyboard_focus_window: on"); @@ -2511,15 +2511,15 @@ IPC_AdvancedFocus(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.warp_after_next_focus = 1; + conf.focus.warp_after_next_focus = 1; } else if (!strcmp(param2, "off")) { - mode.warp_after_next_focus = 0; + conf.focus.warp_after_next_focus = 0; } else if (!strcmp(param2, "?")) { - if (mode.warp_after_next_focus) + if (conf.focus.warp_after_next_focus) { Esnprintf(buf, sizeof(buf), "pointer_after_keyboard_focus_window: on"); @@ -2539,15 +2539,15 @@ IPC_AdvancedFocus(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.transientsfollowleader = 1; + conf.focus.transientsfollowleader = 1; } else if (!strcmp(param2, "off")) { - mode.transientsfollowleader = 0; + conf.focus.transientsfollowleader = 0; } else if (!strcmp(param2, "?")) { - if (mode.transientsfollowleader) + if (conf.focus.transientsfollowleader) { Esnprintf(buf, sizeof(buf), "transients_follow_leader: on"); @@ -2567,15 +2567,15 @@ IPC_AdvancedFocus(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.switchfortransientmap = 1; + conf.focus.switchfortransientmap = 1; } else if (!strcmp(param2, "off")) { - mode.switchfortransientmap = 0; + conf.focus.switchfortransientmap = 0; } else if (!strcmp(param2, "?")) { - if (mode.switchfortransientmap) + if (conf.focus.switchfortransientmap) { Esnprintf(buf, sizeof(buf), "switch_to_popup_location: on"); @@ -2595,15 +2595,15 @@ IPC_AdvancedFocus(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.manual_placement = 1; + conf.manual_placement = 1; } else if (!strcmp(param2, "off")) { - mode.manual_placement = 0; + conf.manual_placement = 0; } else if (!strcmp(param2, "?")) { - if (mode.manual_placement) + if (conf.manual_placement) { Esnprintf(buf, sizeof(buf), "manual_placement: on"); } @@ -2621,15 +2621,15 @@ IPC_AdvancedFocus(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.manual_placement_mouse_pointer = 1; + conf.manual_placement_mouse_pointer = 1; } else if (!strcmp(param2, "off")) { - mode.manual_placement_mouse_pointer = 0; + conf.manual_placement_mouse_pointer = 0; } else if (!strcmp(param2, "?")) { - if (mode.manual_placement_mouse_pointer) + if (conf.manual_placement_mouse_pointer) { Esnprintf(buf, sizeof(buf), "manual_placement_mouse_pointer: on"); @@ -2761,7 +2761,7 @@ IPC_Pager(char *params, Client * c) } else if (!strcmp(param1, "?")) { - if (mode.show_pagers) + if (conf.pagers.enable) { Esnprintf(buf, sizeof(buf), "pager: on"); } @@ -2775,7 +2775,7 @@ IPC_Pager(char *params, Client * c) word(params, 2, param2); if (!strcmp(param2, "?")) { - if (mode.pager_hiq) + if (conf.pagers.hiq) { Esnprintf(buf, sizeof(buf), "pager_hiq: on"); } @@ -2805,15 +2805,15 @@ IPC_Pager(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.pager_zoom = 1; + conf.pagers.zoom = 1; } else if (!strcmp(param2, "off")) { - mode.pager_zoom = 0; + conf.pagers.zoom = 0; } else if (!strcmp(param2, "?")) { - if (mode.pager_zoom) + if (conf.pagers.zoom) { CommsSend(c, "pager_zoom: on"); } @@ -2840,15 +2840,15 @@ IPC_Pager(char *params, Client * c) { if (!strcmp(param2, "on")) { - mode.pager_title = 1; + conf.pagers.title = 1; } else if (!strcmp(param2, "off")) { - mode.pager_title = 0; + conf.pagers.title = 0; } else if (!strcmp(param2, "?")) { - if (mode.pager_title) + if (conf.pagers.title) { CommsSend(c, "pager_title: on"); } @@ -2871,11 +2871,11 @@ IPC_Pager(char *params, Client * c) if (!strcmp(param2, "?")) { Esnprintf(buf, sizeof(buf), "pager_scanrate: %d", - mode.pager_scanspeed); + conf.pagers.scanspeed); } else { - mode.pager_scanspeed = atoi(param2); + conf.pagers.scanspeed = atoi(param2); } } else @@ -2888,7 +2888,7 @@ IPC_Pager(char *params, Client * c) word(params, 2, param2); if (!strcmp(param2, "?")) { - if (mode.pager_hiq) + if (conf.pagers.hiq) { Esnprintf(buf, sizeof(buf), "pager_snap: on"); } @@ -2976,41 +2976,41 @@ IPC_MoveMode(char *params, Client * c) { if (!strcmp(params, "opaque")) { - mode.movemode = 0; + conf.movemode = 0; } else if (!strcmp(params, "lined")) { - mode.movemode = 1; + conf.movemode = 1; } else if (!strcmp(params, "box")) { - mode.movemode = 2; + conf.movemode = 2; } else if (!strcmp(params, "shaded")) { - mode.movemode = 3; + conf.movemode = 3; } else if (!strcmp(params, "semi-solid")) { - mode.movemode = 4; + conf.movemode = 4; } else if (!strcmp(params, "translucent")) { - mode.movemode = 5; + conf.movemode = 5; } else if (!strcmp(params, "?")) { - if (mode.movemode) + if (conf.movemode) { - if (mode.movemode == 1) + if (conf.movemode == 1) Esnprintf(buf, sizeof(buf), "movemode: lined"); - else if (mode.movemode == 2) + else if (conf.movemode == 2) Esnprintf(buf, sizeof(buf), "movemode: box"); - else if (mode.movemode == 3) + else if (conf.movemode == 3) Esnprintf(buf, sizeof(buf), "movemode: shaded"); - else if (mode.movemode == 4) + else if (conf.movemode == 4) Esnprintf(buf, sizeof(buf), "movemode: semi-solid"); - else if (mode.movemode == 5) + else if (conf.movemode == 5) Esnprintf(buf, sizeof(buf), "movemode: translucent"); } else @@ -3043,35 +3043,35 @@ IPC_ResizeMode(char *params, Client * c) { if (!strcmp(params, "opaque")) { - mode.resizemode = 0; + conf.resizemode = 0; } else if (!strcmp(params, "lined")) { - mode.resizemode = 1; + conf.resizemode = 1; } else if (!strcmp(params, "box")) { - mode.resizemode = 2; + conf.resizemode = 2; } else if (!strcmp(params, "shaded")) { - mode.resizemode = 3; + conf.resizemode = 3; } else if (!strcmp(params, "semi-solid")) { - mode.resizemode = 4; + conf.resizemode = 4; } else if (!strcmp(params, "?")) { - if (mode.resizemode) + if (conf.resizemode) { - if (mode.resizemode == 1) + if (conf.resizemode == 1) Esnprintf(buf, sizeof(buf), "resizemode: lined"); - else if (mode.resizemode == 2) + else if (conf.resizemode == 2) Esnprintf(buf, sizeof(buf), "resizemode: box"); - else if (mode.resizemode == 3) + else if (conf.resizemode == 3) Esnprintf(buf, sizeof(buf), "resizemode: shaded"); - else if (mode.resizemode == 4) + else if (conf.resizemode == 4) Esnprintf(buf, sizeof(buf), "resizemode: semi-solid"); } else @@ -3104,23 +3104,23 @@ IPC_GeomInfoMode(char *params, Client * c) { if (!strcmp(params, "never")) { - mode.geominfomode = 0; + conf.geominfomode = 0; } else if (!strcmp(params, "center")) { - mode.geominfomode = 1; + conf.geominfomode = 1; } else if (!strcmp(params, "corner")) { - mode.geominfomode = 2; + conf.geominfomode = 2; } else if (!strcmp(params, "?")) { - if (mode.geominfomode) + if (conf.geominfomode) { - if (mode.geominfomode == 1) + if (conf.geominfomode == 1) Esnprintf(buf, sizeof(buf), "geominfomode: center"); - else if (mode.geominfomode == 2) + else if (conf.geominfomode == 2) Esnprintf(buf, sizeof(buf), "geominfomode: corner"); } else @@ -3204,15 +3204,15 @@ IPC_FX(char *params, Client * c) word(params, 2, word2); if (!strcmp(word2, "on")) { - mode.mapslide = 1; + conf.mapslide = 1; } else if (!strcmp(word2, "off")) { - mode.mapslide = 0; + conf.mapslide = 0; } else if (!strcmp(word2, "?")) { - if (mode.mapslide) + if (conf.mapslide) Esnprintf(buf, sizeof(buf), "mapslide: on"); else Esnprintf(buf, sizeof(buf), "mapslide: off"); @@ -3227,15 +3227,15 @@ IPC_FX(char *params, Client * c) word(params, 2, word2); if (!strcmp(word2, "on")) { - mode.menuslide = 1; + conf.menuslide = 1; } else if (!strcmp(word2, "off")) { - mode.menuslide = 0; + conf.menuslide = 0; } else if (!strcmp(word2, "?")) { - if (mode.menuslide) + if (conf.menuslide) Esnprintf(buf, sizeof(buf), "menu_animate: on"); else Esnprintf(buf, sizeof(buf), "menu_animate: off"); @@ -3250,15 +3250,15 @@ IPC_FX(char *params, Client * c) word(params, 2, word2); if (!strcmp(word2, "on")) { - mode.animate_shading = 1; + conf.animate_shading = 1; } else if (!strcmp(word2, "off")) { - mode.animate_shading = 0; + conf.animate_shading = 0; } else if (!strcmp(word2, "?")) { - if (mode.animate_shading) + if (conf.animate_shading) Esnprintf(buf, sizeof(buf), "animate_win_shading: on"); else Esnprintf(buf, sizeof(buf), "animate_win_shading: off"); @@ -3273,10 +3273,10 @@ IPC_FX(char *params, Client * c) word(params, 2, word2); if (!strcmp(word2, "?")) { - if (mode.animate_shading) + if (conf.animate_shading) { Esnprintf(buf, sizeof(buf), "shadespeed: %d seconds", - mode.shadespeed); + conf.shadespeed); } else { @@ -3285,7 +3285,7 @@ IPC_FX(char *params, Client * c) } else { - mode.shadespeed = atoi(word2); + conf.shadespeed = atoi(word2); } } else if (!strcmp(word1, "dragbar")) @@ -3386,18 +3386,18 @@ IPC_FX(char *params, Client * c) word(params, 2, word2); if (!strcmp(word2, "off")) { - mode.tooltips = 0; + conf.tooltips.enable = 0; } else if (!strcmp(word2, "on")) { - mode.tooltips = 1; + conf.tooltips.enable = 1; } else if (!strcmp(word2, "?")) { - if (mode.tooltips) + if (conf.tooltips.enable) { Esnprintf(buf, sizeof(buf), "tooltips: %f seconds", - mode.tiptime); + conf.tooltips.tiptime); } else { @@ -3406,11 +3406,11 @@ IPC_FX(char *params, Client * c) } else { - mode.tiptime = atof(word2); - if (!mode.tiptime) - mode.tooltips = 0; + conf.tooltips.tiptime = atof(word2); + if (!conf.tooltips.tiptime) + conf.tooltips.enable = 0; else - mode.tooltips = 1; + conf.tooltips.enable = 1; } } else if (!strcmp(word1, "edge_resistance")) @@ -3420,15 +3420,15 @@ IPC_FX(char *params, Client * c) { if (!strcmp(word2, "off")) { - mode.edge_flip_resistance = -1; + conf.edge_flip_resistance = -1; } else if (!strcmp(word2, "?")) { - if (mode.edge_flip_resistance >= 0) + if (conf.edge_flip_resistance >= 0) { Esnprintf(buf, sizeof(buf), "edge_resistance: %d / 100 seconds", - mode.edge_flip_resistance); + conf.edge_flip_resistance); } else { @@ -3437,7 +3437,7 @@ IPC_FX(char *params, Client * c) } else { - mode.edge_flip_resistance = atoi(word2); + conf.edge_flip_resistance = atoi(word2); } } else @@ -3453,11 +3453,11 @@ IPC_FX(char *params, Client * c) if (!strcmp(word2, "?")) { Esnprintf(buf, sizeof(buf), "edge_snap_distance: %d", - mode.edge_snap_dist); + conf.snap.edge_snap_dist); } else { - mode.edge_snap_dist = atoi(word2); + conf.snap.edge_snap_dist = atoi(word2); } } else @@ -3470,18 +3470,18 @@ IPC_FX(char *params, Client * c) word(params, 2, word2); if (!strcmp(word2, "off")) { - mode.autoraise = 0; + conf.autoraise = 0; } else if (!strcmp(word2, "on")) { - mode.autoraise = 1; + conf.autoraise = 1; } else if (!strcmp(word2, "?")) { - if (mode.autoraise) + if (conf.autoraise) { Esnprintf(buf, sizeof(buf), "autoraise: %f seconds", - mode.autoraisetime); + conf.autoraisetime); } else { @@ -3490,11 +3490,11 @@ IPC_FX(char *params, Client * c) } else { - mode.autoraisetime = atof(word2); - if (!mode.autoraisetime) - mode.autoraise = 0; + conf.autoraisetime = atof(word2); + if (!conf.autoraisetime) + conf.autoraise = 0; else - mode.autoraise = 1; + conf.autoraise = 1; } } else if (!strcmp(word1, "audio")) @@ -3502,23 +3502,23 @@ IPC_FX(char *params, Client * c) word(params, 2, word2); if (!strcmp(word2, "on")) { - if (!mode.sound) + if (!conf.sound) { - mode.sound = 1; + conf.sound = 1; SoundInit(); } } else if (!strcmp(word2, "off")) { - if (mode.sound) + if (conf.sound) { - mode.sound = 0; + conf.sound = 0; SoundExit(); } } else if (!strcmp(word2, "?")) { - if (mode.sound) + if (conf.sound) Esnprintf(buf, sizeof(buf), "audio: on"); else Esnprintf(buf, sizeof(buf), "audio: off"); @@ -4115,7 +4115,7 @@ IPC_NumDesks(char *params, Client * c) if (!strcmp(params, "?")) { Esnprintf(buf, sizeof(buf), "Number of Desks: %d", - mode.numdesktops); + conf.desks.numdesktops); } else { @@ -4141,26 +4141,26 @@ IPC_FocusMode(char *params, Client * c) { if (!strcmp(params, "click")) { - mode.focusmode = 2; + conf.focus.mode = 2; mode.click_focus_grabbed = 1; } else if (!strcmp(params, "pointer")) { - mode.focusmode = 0; + conf.focus.mode = 0; } else if (!strcmp(params, "sloppy")) { - mode.focusmode = 1; + conf.focus.mode = 1; } else if (!strcmp(params, "clicknograb")) { - mode.focusmode = 2; + conf.focus.mode = 2; mode.click_focus_grabbed = 0; } else if (!strcmp(params, "?")) { Esnprintf(buf, sizeof(buf), "Focus Mode: "); - if (mode.focusmode == 2) + if (conf.focus.mode == 2) { if (mode.click_focus_grabbed) { @@ -4171,11 +4171,11 @@ IPC_FocusMode(char *params, Client * c) strcat(buf, "clicknograb"); } } - else if (mode.focusmode == 1) + else if (conf.focus.mode == 1) { strcat(buf, "sloppy"); } - else if (mode.focusmode == 0) + else if (conf.focus.mode == 0) { strcat(buf, "pointer"); } @@ -4310,7 +4310,7 @@ IPC_ForceSave(char *params, Client * c) if (!(master_pid == getpid())) return; - if (mode.autosave) + if (conf.autosave) SaveUserControlConfig(fopen(GetGenericSMFile(), "w")); else rm(GetGenericSMFile()); @@ -4436,18 +4436,18 @@ IPC_AutoSave(char *params, Client * c) if (!strcmp(params, "?")) { - if (mode.autosave) + if (conf.autosave) Esnprintf(buf, sizeof(buf), "Autosave : on"); else Esnprintf(buf, sizeof(buf), "Autosave : off"); } else if (!strcmp(params, "on")) { - mode.autosave = 1; + conf.autosave = 1; } else if (!strcmp(params, "off")) { - mode.autosave = 0; + conf.autosave = 0; } else { @@ -5170,13 +5170,13 @@ IPC_Hints(char *params, Client * c) if (!strcmp(param1, "xroot")) { if (!strncmp(param2, "norm", 4)) - mode.hints_set_xroot_info_on_root_window = 0; + conf.hints.set_xroot_info_on_root_window = 0; else if (!strncmp(param2, "root", 4)) - mode.hints_set_xroot_info_on_root_window = 1; + conf.hints.set_xroot_info_on_root_window = 1; } Esnprintf(buf, sizeof(buf), "Set _XROOT* hints: %s", - (mode.hints_set_xroot_info_on_root_window) ? "root" : "normal"); + (conf.hints.set_xroot_info_on_root_window) ? "root" : "normal"); CommsSend(c, buf); } diff --git a/src/main.c b/src/main.c index 94571b37..247fb572 100644 --- a/src/main.c +++ b/src/main.c @@ -252,7 +252,7 @@ main(int argc, char **argv) desks.desk[0].viewable = 1; RefreshDesktop(0); - if (mode.sound) + if (conf.sound) { SoundPlay("SOUND_STARTUP"); SoundFree("SOUND_STARTUP"); @@ -269,7 +269,7 @@ main(int argc, char **argv) /* retreive stuff from last time we were loaded if we're restarting */ ICCCM_GetMainEInfo(); SetupEnv(); - if (mode.mapslide) + if (conf.mapslide) CreateStartupDisplay(0); MapUnmap(1); /* set some more hints */ @@ -277,9 +277,9 @@ main(int argc, char **argv) desks.current = 0; /* Set up the internal pagers */ IB_Setup(); - if (mode.show_pagers) + if (conf.pagers.enable) { - mode.show_pagers = 0; + conf.pagers.enable = 0; queue_up = 0; EnableAllPagers(); queue_up = DRAW_QUEUE_ENABLE; @@ -296,8 +296,8 @@ main(int argc, char **argv) queue_up = DRAW_QUEUE_ENABLE; /* hello! we don't have a resizemode of 5! */ - if (mode.resizemode == 5) - mode.resizemode = 0; + if (conf.resizemode == 5) + conf.resizemode = 0; /* of course, we have to set the cursors */ ec = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_ECURSOR); if (ec) @@ -314,38 +314,38 @@ 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 < (mode.numdesktops - 1)) + if (desks.current < (conf.desks.numdesktops - 1)) { char ps = 0; - if (!mode.mapslide) + if (!conf.mapslide) { ps = desks.slidein; desks.slidein = 0; } GotoDesktop(desks.current + 1); GotoDesktop(desks.current - 1); - if (!mode.mapslide) + if (!conf.mapslide) desks.slidein = ps; } else if (desks.current > 0) { char ps = 0; - if (!mode.mapslide) + if (!conf.mapslide) { ps = desks.slidein; desks.slidein = 0; } GotoDesktop(desks.current - 1); GotoDesktop(desks.current + 1); - if (!mode.mapslide) + if (!conf.mapslide) desks.slidein = ps; } XSync(disp, False); /* if we didn't have an external window piped to us, we'll do some stuff */ - if (!mode.mapslide) + if (!conf.mapslide) CreateStartupDisplay(0); if ((bg = RemoveItem("STARTUP_BACKGROUND_SIDEWAYS", 0, diff --git a/src/menus.c b/src/menus.c index e6d9871d..0f03b22b 100644 --- a/src/menus.c +++ b/src/menus.c @@ -212,7 +212,7 @@ MenuShow(Menu * m, char noshow) wx = 0; wy = 0; - if (mode.menusonscreen) + if (conf.menusonscreen) { Border *b; @@ -250,7 +250,7 @@ MenuShow(Menu * m, char noshow) if ((mode.x >= 0) && (mode.y >= 0)) { - if (mode.menusonscreen) + if (conf.menusonscreen) EMoveWindow(disp, m->win, wx, wy); else EMoveWindow(disp, m->win, mode.x - x - (w / 2), @@ -260,7 +260,7 @@ MenuShow(Menu * m, char noshow) { if (((-mode.y) + (int)mh) > (int)root.h) mode.y = -((-mode.y) - mode.context_h - mh); - if (mode.menusonscreen) + if (conf.menusonscreen) EMoveWindow(disp, m->win, wx, -mode.y); else EMoveWindow(disp, m->win, mode.x - x - (w / 2), -mode.y); @@ -269,7 +269,7 @@ MenuShow(Menu * m, char noshow) { if (((-mode.x) + (int)mw) > (int)root.w) mode.x = -((-mode.x) - mode.context_w - mw); - if (mode.menusonscreen) + if (conf.menusonscreen) EMoveWindow(disp, m->win, -mode.x, wy); else EMoveWindow(disp, m->win, -mode.x, mode.y - y - (h / 2)); @@ -294,13 +294,13 @@ MenuShow(Menu * m, char noshow) MoveEwin(ewin, ewin->x - desks.desk[ewin->desktop].x, ewin->y - desks.desk[ewin->desktop].y); RestackEwin(ewin); - if (mode.menuslide) + if (conf.menuslide) InstantShadeEwin(ewin, 0); ICCCM_Cmap(NULL); if (!noshow) { ShowEwin(ewin); - if (mode.menuslide) + if (conf.menuslide) UnShadeEwin(ewin); } ewin->menu = m; @@ -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 < mode.numdesktops; j++) + for (j = 0; j < conf.desks.numdesktops; j++) { mm = MenuCreate("__SUBMENUDESK_E"); mm->style = ms; @@ -2292,7 +2292,7 @@ MenusEventMouseDown(XEvent * ev) ewin2->border->border.top); RaiseEwin(ewin2); ShowEwin(ewin2); - if (mode.menuslide) + if (conf.menuslide) UnShadeEwin(ewin2); mode.cur_menu[mode.cur_menu_depth++] = mi->child; } @@ -2405,11 +2405,11 @@ SubmenuShowTimeout(int val, void *dat) ewin2->border->border.top); RaiseEwin(ewin2); ShowEwin(ewin2); - if (mode.menuslide) + if (conf.menuslide) UnShadeEwin(ewin2); if (mode.cur_menu[mode.cur_menu_depth - 1] != data->mi->child) mode.cur_menu[mode.cur_menu_depth++] = data->mi->child; - if (mode.menusonscreen) + if (conf.menusonscreen) { EWin *menus[256]; int fx[256]; @@ -2442,8 +2442,8 @@ SubmenuShowTimeout(int val, void *dat) } } SlideEwinsTo(menus, fx, fy, tx, ty, mode.cur_menu_depth, - mode.shadespeed); - if (mode.warpmenus) + conf.shadespeed); + if (conf.warpmenus) XWarpPointer(disp, None, None, 0, 0, 0, 0, xdist, ydist); } } diff --git a/src/misc.c b/src/misc.c index e03d5f29..14341550 100644 --- a/src/misc.c +++ b/src/misc.c @@ -229,7 +229,7 @@ ShowEdgeWindows(void) { int ax, ay, cx, cy; - if (mode.edge_flip_resistance <= 0) + if (conf.edge_flip_resistance <= 0) { HideEdgeWindows(); return; @@ -256,19 +256,19 @@ ShowEdgeWindows(void) GetCurrentArea(&cx, &cy); GetAreaSize(&ax, &ay); - if (cx == 0 && !mode.area_wraparound) + if (cx == 0 && !conf.areas.wraparound) EUnmapWindow(disp, w1); else EMapRaised(disp, w1); - if (cx == (ax - 1) && !mode.area_wraparound) + if (cx == (ax - 1) && !conf.areas.wraparound) EUnmapWindow(disp, w2); else EMapRaised(disp, w2); - if (cy == 0 && !mode.area_wraparound) + if (cy == 0 && !conf.areas.wraparound) EUnmapWindow(disp, w3); else EMapRaised(disp, w3); - if (cy == (ay - 1) && !mode.area_wraparound) + if (cy == (ay - 1) && !conf.areas.wraparound) EUnmapWindow(disp, w4); else EMapRaised(disp, w4); @@ -310,7 +310,7 @@ EdgeHandleEnter(XEvent * ev) dir = IsEdgeWin(ev->xcrossing.window); if (dir < 0) return; - DoIn("EDGE_TIMEOUT", ((double)mode.edge_flip_resistance) / 100.0, + DoIn("EDGE_TIMEOUT", ((double)conf.edge_flip_resistance) / 100.0, EdgeTimeout, dir, NULL); } @@ -344,12 +344,12 @@ EdgeHandleMotion(XEvent * ev) else if (ev->xmotion.y_root == (root.h - 1)) dir = 3; - if ((lastdir != dir) && (mode.edge_flip_resistance)) + if ((lastdir != dir) && (conf.edge_flip_resistance)) { if (dir < 0) RemoveTimerEvent("EDGE_TIMEOUT"); else - DoIn("EDGE_TIMEOUT", ((double)mode.edge_flip_resistance) / 100.0, + DoIn("EDGE_TIMEOUT", ((double)conf.edge_flip_resistance) / 100.0, EdgeTimeout, dir, NULL); lastdir = dir; } @@ -364,7 +364,7 @@ EdgeTimeout(int val, void *data) if (mode.cur_menu_mode > 0) return; - if (!mode.edge_flip_resistance) + if (!conf.edge_flip_resistance) return; throw_move_events_away = 1; GetCurrentArea(&ax, &ay); @@ -376,25 +376,25 @@ EdgeTimeout(int val, void *data) switch (val) { case 0: - if (ax == 0 && !mode.area_wraparound) + if (ax == 0 && !conf.areas.wraparound) return; dx = root.w - 2; dax = -1; break; case 1: - if (ax == (aw - 1) && !mode.area_wraparound) + if (ax == (aw - 1) && !conf.areas.wraparound) return; dx = -(root.w - 2); dax = 1; break; case 2: - if (ay == 0 && !mode.area_wraparound) + if (ay == 0 && !conf.areas.wraparound) return; dy = root.h - 2; day = -1; break; case 3: - if (ay == (ah - 1) && !mode.area_wraparound) + if (ay == (ah - 1) && !conf.areas.wraparound) return; dy = -(root.h - 2); day = 1; diff --git a/src/pager.c b/src/pager.c index 3a9021d5..8c840f52 100644 --- a/src/pager.c +++ b/src/pager.c @@ -31,7 +31,7 @@ static void PagerUpdateTimeout(int val, void *data); static void PagerEwinUpdateMini(Pager * p, EWin * ewin); static void PagerEwinUpdateFromPager(Pager * p, EWin * ewin); -#define HIQ mode.pager_hiq +#define HIQ conf.pagers.hiq static void PagerUpdateTimeout(int val, void *data) @@ -52,15 +52,15 @@ PagerUpdateTimeout(int val, void *data) if ((cur_time - last_time) < 0.05) calls++; last_time = cur_time; - in = 1 / ((double)mode.pager_scanspeed); + in = 1 / ((double)conf.pagers.scanspeed); if (calls > 50) { calls = 0; in = 0.25; } - if (mode.pager_scanspeed > 0) + if (conf.pagers.scanspeed > 0) DoIn(s, in, PagerUpdateTimeout, 0, p); - if (!mode.pager_snap) + if (!conf.pagers.snap) return; if (!p->visible) return; @@ -104,10 +104,10 @@ PagerCreate(void) XSetWindowAttributes attr; static char did_dialog = 0; - if (!mode.show_pagers) + if (!conf.pagers.enable) return NULL; - if ((!did_dialog) && (mode.pager_snap)) + if ((!did_dialog) && (conf.pagers.snap)) { #if !USE_IMLIB2 if (pImlib_Context->x.shm) @@ -205,7 +205,7 @@ PagerResize(Pager * p, int w, int h) char pq; ImageClass *ic; - if (!mode.show_pagers) + if (!conf.pagers.enable) return; if ((w == p->w) && (h == p->h)) return; @@ -259,7 +259,7 @@ PagerShow(Pager * p) char s[64]; char pq; - if (!mode.show_pagers) + if (!conf.pagers.enable) return; if (p->ewin) @@ -310,8 +310,9 @@ PagerShow(Pager * p) { /* no snapshots ? first time ? make a row on the bottom left up */ MoveResizeEwin(ewin, 0, - root.h - (mode.numdesktops - p->desktop) * ewin->h, - ewin->client.w, ewin->client.h); + root.h - (conf.desks.numdesktops - + p->desktop) * ewin->h, ewin->client.w, + ewin->client.h); } PagerRedraw(p, 1); /* show the pager ewin */ @@ -319,11 +320,11 @@ PagerShow(Pager * p) if (((sn) && (sn->use_sticky) && (sn->sticky)) || (!sn)) MakeWindowSticky(ewin); RememberImportantInfoForEwin(ewin); - if (mode.pager_snap) + if (conf.pagers.snap) { Esnprintf(s, sizeof(s), "__.%x", (unsigned)p->win); - if (mode.pager_scanspeed > 0) - DoIn(s, 1 / ((double)mode.pager_scanspeed), PagerUpdateTimeout, + if (conf.pagers.scanspeed > 0) + DoIn(s, 1 / ((double)conf.pagers.scanspeed), PagerUpdateTimeout, 0, p); } AddItem(p, "PAGER", p->win, LIST_TYPE_PAGER); @@ -361,7 +362,7 @@ PagersForDesktop(int d, int *num) Pager **pl = NULL; int i, pnum; - if (!mode.show_pagers) + if (!conf.pagers.enable) return NULL; *num = 0; @@ -388,7 +389,7 @@ RedrawPagersForDesktop(int d, char newbg) Pager **pl; int i, num; - if (!mode.show_pagers) + if (!conf.pagers.enable) return; pl = PagersForDesktop(d, &num); @@ -406,7 +407,7 @@ ForceUpdatePagersForDesktop(int d) Pager **pl; int i, num; - if (!mode.show_pagers) + if (!conf.pagers.enable) return; pl = PagersForDesktop(d, &num); @@ -440,7 +441,7 @@ PagerEwinUpdateMini(Pager * p, EWin * ewin) { int w, h, ax, ay, cx, cy; - if (!mode.show_pagers) + if (!conf.pagers.enable) return; GetAreaSize(&ax, &ay); @@ -462,7 +463,7 @@ PagerEwinUpdateMini(Pager * p, EWin * ewin) ewin->mini_h = h; if ((ewin->desktop != desks.current) || (ewin->area_x != cx) - || (ewin->area_y != cy) || (!mode.pager_snap)) + || (ewin->area_y != cy) || (!conf.pagers.snap)) { ImageClass *ic = NULL; @@ -492,12 +493,12 @@ PagerEwinUpdateFromPager(Pager * p, EWin * ewin) static GC gc = 0; XGCValues gcv; - if (!mode.pager_snap) + if (!conf.pagers.snap) { PagerEwinUpdateMini(p, ewin); return; } - if (!mode.show_pagers) + if (!conf.pagers.enable) return; GetAreaSize(&ax, &ay); @@ -533,7 +534,7 @@ PagerRedraw(Pager * p, char newbg) GC gc; XGCValues gcv; - if (!mode.show_pagers || mode.mode == MODE_DESKSWITCH) + if (!conf.pagers.enable || mode.mode == MODE_DESKSWITCH) return; if (queue_up) @@ -572,7 +573,7 @@ PagerRedraw(Pager * p, char newbg) { if ((newbg > 0) && (newbg < 3)) { - if (!mode.pager_snap) + if (!conf.pagers.snap) { ImageClass *ic = NULL; PmapMask pmm; @@ -699,7 +700,7 @@ PagerForceUpdate(Pager * p) { int ww, hh, xx, yy, ax, ay, cx, cy, i; - if (!mode.show_pagers || mode.mode == MODE_DESKSWITCH) + if (!conf.pagers.enable || mode.mode == MODE_DESKSWITCH) return; if (queue_up) @@ -728,7 +729,7 @@ PagerForceUpdate(Pager * p) return; } - if ((p->desktop != desks.current) || (!mode.pager_snap)) + if ((p->desktop != desks.current) || (!conf.pagers.snap)) { PagerRedraw(p, 0); return; @@ -756,7 +757,7 @@ PagerReArea(void) Pager **pl = NULL; int i, pnum, w, h, ax, ay; - if (!mode.show_pagers) + if (!conf.pagers.enable) return; pl = (Pager **) ListItemType(&pnum, LIST_TYPE_PAGER); @@ -789,14 +790,14 @@ PagerReArea(void) void PagerEwinOutsideAreaUpdate(EWin * ewin) { - if (!mode.show_pagers) + if (!conf.pagers.enable) return; if (ewin->sticky) { int i; - for (i = 0; i < mode.numdesktops; i++) + for (i = 0; i < conf.desks.numdesktops; i++) RedrawPagersForDesktop(i, 0); ForceUpdatePagersForDesktop(ewin->desktop); return; @@ -819,7 +820,7 @@ EwinInPagerAt(Pager * p, int x, int y) { int i, wx, wy, ww, wh, ax, ay, cx, cy; - if (!mode.show_pagers) + if (!conf.pagers.enable) return NULL; GetAreaSize(&ax, &ay); @@ -848,7 +849,7 @@ PagerAreaAt(Pager * p, int x, int y, int *ax, int *ay) { int asx, asy; - if (!mode.show_pagers) + if (!conf.pagers.enable) return; GetAreaSize(&asx, &asy); @@ -865,7 +866,7 @@ PagerMenuShow(Pager * p, int x, int y) char s[1024]; int ax, ay; - if (!mode.show_pagers) + if (!conf.pagers.enable) return; ewin = EwinInPagerAt(p, x, y); @@ -913,7 +914,7 @@ PagerMenuShow(Pager * p, int x, int y) NULL); MenuAddItem(p_menu, mi); - if (mode.pager_snap) + if (conf.pagers.snap) { mi = MenuItemCreate(_("High Quality On"), NULL, ACTION_SET_PAGER_HIQ, "1", NULL); @@ -939,7 +940,7 @@ PagerTitle(Pager * p, char *title) { XTextProperty xtp; - if (!mode.show_pagers) + if (!conf.pagers.enable) return; xtp.encoding = XA_STRING; @@ -957,7 +958,7 @@ UpdatePagerSel(void) int i, pnum, cx, cy; ImageClass *ic; - if (!mode.show_pagers) + if (!conf.pagers.enable) return; pl = (Pager **) ListItemType(&pnum, LIST_TYPE_PAGER); @@ -991,7 +992,7 @@ PagerShowTt(EWin * ewin) static EWin *tt_ewin = NULL; ToolTip *tt; - if (!mode.pager_title || (ewin == tt_ewin)) + if (!conf.pagers.title || (ewin == tt_ewin)) return; if (mode.cur_menu_depth) /* Don't show Tooltip when menu is up */ @@ -1015,7 +1016,7 @@ PagerHideAllHi(void) Pager **pl = NULL; int i, pnum; - if (!mode.show_pagers) + if (!conf.pagers.enable) return; pl = (Pager **) ListItemType(&pnum, LIST_TYPE_PAGER); @@ -1271,7 +1272,7 @@ PagerHandleMotion(Pager * p, Window win, int x, int y, int in) Window rw, cw; EWin *ewin = NULL; - if (!mode.show_pagers) + if (!conf.pagers.enable) return; XQueryPointer(disp, p->win, &rw, &cw, &hx, &hy, &x, &y, &hx); @@ -1281,7 +1282,7 @@ PagerHandleMotion(Pager * p, Window win, int x, int y, int in) else ewin = NULL; - if (!mode.pager_zoom) + if (!conf.pagers.zoom) { if (in == PAGER_EVENT_MOUSE_OUT) PagerShowTt(NULL); @@ -1358,10 +1359,10 @@ EnableAllPagers(void) { int i; - if (!mode.show_pagers) + if (!conf.pagers.enable) { - mode.show_pagers = 1; - for (i = 0; i < mode.numdesktops; i++) + conf.pagers.enable = 1; + for (i = 0; i < conf.desks.numdesktops; i++) EnableSinglePagerForDesktop(i); UpdatePagerSel(); } @@ -1404,11 +1405,11 @@ DisableAllPagers(void) { int i; - if (mode.show_pagers) + if (conf.pagers.enable) { - for (i = 0; i < mode.numdesktops; i++) + for (i = 0; i < conf.desks.numdesktops; i++) DisablePagersForDesktop(i); - mode.show_pagers = 0; + conf.pagers.enable = 0; } return; } @@ -1454,7 +1455,7 @@ PagerSetSnap(char onoff) int i, num; char s[256]; - mode.pager_snap = onoff; + conf.pagers.snap = onoff; lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN); if (lst) @@ -1474,11 +1475,11 @@ PagerSetSnap(char onoff) PagerHideHi(pl[i]); PagerRedraw(pl[i], 2); PagerForceUpdate(pl[i]); - if (mode.pager_snap) + if (conf.pagers.snap) { Esnprintf(s, sizeof(s), "__.%x", (unsigned)pl[i]->win); - if (mode.pager_scanspeed > 0) - DoIn(s, 1 / ((double)mode.pager_scanspeed), + if (conf.pagers.scanspeed > 0) + DoIn(s, 1 / ((double)conf.pagers.scanspeed), PagerUpdateTimeout, 0, pl[i]); } } @@ -1651,7 +1652,7 @@ PagersEventMouseDown(XEvent * ev) ev->xbutton.y += hy; } - if ((int)ev->xbutton.button == mode.pager_menu_button) + if ((int)ev->xbutton.button == conf.pagers.menu_button) { if ((ev->xbutton.x >= 0) && (ev->xbutton.y >= 0) && (ev->xbutton.x < p->w) && (ev->xbutton.y < p->h)) @@ -1660,7 +1661,7 @@ PagersEventMouseDown(XEvent * ev) PagerMenuShow(p, ev->xbutton.x, ev->xbutton.y); } } - else if ((int)ev->xbutton.button == mode.pager_win_button) + else if ((int)ev->xbutton.button == conf.pagers.win_button) { ewin = EwinInPagerAt(p, ev->xbutton.x, ev->xbutton.y); if ((ewin) && (!ewin->pager)) @@ -1706,7 +1707,7 @@ PagersEventMouseUp(XEvent * ev) if (p == NULL) goto exit; - if (((int)ev->xbutton.button == mode.pager_sel_button)) + if (((int)ev->xbutton.button == conf.pagers.sel_button)) { PagerAreaAt(p, ev->xbutton.x, ev->xbutton.y, &pax, &pay); GotoDesktop(p->desktop); @@ -1716,7 +1717,7 @@ PagersEventMouseUp(XEvent * ev) } SetCurrentArea(pax, pay); } - else if (((int)ev->xbutton.button == mode.pager_win_button)) + else if (((int)ev->xbutton.button == conf.pagers.win_button)) { if (ev->xbutton.window == p->hi_win) { diff --git a/src/screen.c b/src/screen.c index deef1565..7ed377bb 100644 --- a/src/screen.c +++ b/src/screen.c @@ -34,7 +34,7 @@ ScreenInit(void) { #ifdef HAS_XINERAMA xinerama_active = XineramaIsActive(disp); - mode.extra_head = 0; + conf.extra_head = 0; if (xinerama_active) screens = XineramaQueryScreens(disp, &num_screens); #endif diff --git a/src/session.c b/src/session.c index 3b997156..d7151015 100644 --- a/src/session.c +++ b/src/session.c @@ -419,7 +419,7 @@ autosave(void) { if (mode.startup) return; - if (mode.autosave) + if (conf.autosave) { char s[4096]; diff --git a/src/settings.c b/src/settings.c index e746a58e..a3fefd17 100644 --- a/src/settings.c +++ b/src/settings.c @@ -51,28 +51,28 @@ CB_ConfigurePager(int val, void *data) { if (val < 2) { - if ((!mode.show_pagers) && (tmp_show_pagers)) + if ((!conf.pagers.enable) && (tmp_show_pagers)) EnableAllPagers(); - else if ((mode.show_pagers) && (!tmp_show_pagers)) + else if ((conf.pagers.enable) && (!tmp_show_pagers)) DisableAllPagers(); - if (mode.pager_hiq != tmp_pager_hiq) + if (conf.pagers.hiq != tmp_pager_hiq) PagerSetHiQ(tmp_pager_hiq); - mode.pager_zoom = tmp_pager_zoom; - mode.pager_title = tmp_pager_title; - mode.pager_sel_button = tmp_pager_sel_button; - mode.pager_win_button = tmp_pager_win_button; - mode.pager_menu_button = tmp_pager_menu_button; - if ((mode.pager_scanspeed != tmp_pager_scan_speed) - || ((!tmp_pager_do_scan) && (mode.pager_scanspeed > 0)) - || ((tmp_pager_do_scan) && (mode.pager_scanspeed == 0))) + conf.pagers.zoom = tmp_pager_zoom; + conf.pagers.title = tmp_pager_title; + conf.pagers.sel_button = tmp_pager_sel_button; + conf.pagers.win_button = tmp_pager_win_button; + conf.pagers.menu_button = tmp_pager_menu_button; + if ((conf.pagers.scanspeed != tmp_pager_scan_speed) + || ((!tmp_pager_do_scan) && (conf.pagers.scanspeed > 0)) + || ((tmp_pager_do_scan) && (conf.pagers.scanspeed == 0))) { if (tmp_pager_do_scan) - mode.pager_scanspeed = tmp_pager_scan_speed; + conf.pagers.scanspeed = tmp_pager_scan_speed; else - mode.pager_scanspeed = 0; + conf.pagers.scanspeed = 0; PagerSetSnap(tmp_pager_snap); } - if (mode.pager_snap != tmp_pager_snap) + if (conf.pagers.snap != tmp_pager_snap) PagerSetSnap(tmp_pager_snap); } autosave(); @@ -109,19 +109,19 @@ SettingsPager(void) } SoundPlay("SOUND_SETTINGS_PAGER"); - tmp_show_pagers = mode.show_pagers; - tmp_pager_hiq = mode.pager_hiq; - tmp_pager_snap = mode.pager_snap; - tmp_pager_zoom = mode.pager_zoom; - tmp_pager_title = mode.pager_title; - tmp_pager_sel_button = mode.pager_sel_button; - tmp_pager_win_button = mode.pager_win_button; - tmp_pager_menu_button = mode.pager_menu_button; - if (mode.pager_scanspeed == 0) + tmp_show_pagers = conf.pagers.enable; + tmp_pager_hiq = conf.pagers.hiq; + tmp_pager_snap = conf.pagers.snap; + tmp_pager_zoom = conf.pagers.zoom; + tmp_pager_title = conf.pagers.title; + tmp_pager_sel_button = conf.pagers.sel_button; + tmp_pager_win_button = conf.pagers.win_button; + tmp_pager_menu_button = conf.pagers.menu_button; + if (conf.pagers.scanspeed == 0) tmp_pager_do_scan = 0; else tmp_pager_do_scan = 1; - tmp_pager_scan_speed = mode.pager_scanspeed; + tmp_pager_scan_speed = conf.pagers.scanspeed; d = pager_settings_dialog = DialogCreate("CONFIGURE_PAGER"); DialogSetTitle(d, _("Pager Settings")); @@ -129,7 +129,7 @@ SettingsPager(void) table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); @@ -360,22 +360,23 @@ CB_ConfigureFocus(int val, void *data) { if (val < 2) { - mode.focusmode = tmp_focus; - mode.all_new_windows_get_focus = tmp_new_focus; - mode.new_transients_get_focus = tmp_popup_focus; - mode.new_transients_get_focus_if_group_focused = tmp_owner_popup_focus; - mode.raise_on_next_focus = tmp_raise_focus; - mode.warp_on_next_focus = tmp_warp_focus; + conf.focus.mode = tmp_focus; + conf.focus.all_new_windows_get_focus = tmp_new_focus; + conf.focus.new_transients_get_focus = tmp_popup_focus; + conf.focus.new_transients_get_focus_if_group_focused = + tmp_owner_popup_focus; + conf.focus.raise_on_next_focus = tmp_raise_focus; + conf.focus.warp_on_next_focus = tmp_warp_focus; #ifdef WITH_TARTY_WARP - mode.warp_after_next_focus = tmp_warp_after_focus; - mode.raise_after_next_focus = tmp_raise_after_focus; - mode.display_warp = tmp_display_warp; - mode.warpsticky = tmp_warpsticky; - mode.warpshaded = tmp_warpshaded; - mode.warpiconified = tmp_warpiconified; - mode.warpfocused = tmp_warpfocused; + conf.focus.warp_after_next_focus = tmp_warp_after_focus; + conf.focus.raise_after_next_focus = tmp_raise_after_focus; + conf.warplist.enable = tmp_display_warp; + conf.warplist.warpsticky = tmp_warpsticky; + conf.warplist.warpshaded = tmp_warpshaded; + conf.warplist.warpiconified = tmp_warpiconified; + conf.warplist.warpfocused = tmp_warpfocused; #endif /* WITH_TARTY_WARP */ - mode.clickalways = tmp_clickalways; + conf.focus.clickraises = tmp_clickalways; FixFocus(); } autosave(); @@ -396,22 +397,22 @@ SettingsFocus(void) } SoundPlay("SOUND_SETTINGS_FOCUS"); - tmp_focus = mode.focusmode; - tmp_new_focus = mode.all_new_windows_get_focus; - tmp_popup_focus = mode.new_transients_get_focus; - tmp_owner_popup_focus = mode.new_transients_get_focus_if_group_focused; - tmp_raise_focus = mode.raise_on_next_focus; - tmp_warp_focus = mode.warp_on_next_focus; + tmp_focus = conf.focus.mode; + tmp_new_focus = conf.focus.all_new_windows_get_focus; + tmp_popup_focus = conf.focus.new_transients_get_focus; + tmp_owner_popup_focus = conf.focus.new_transients_get_focus_if_group_focused; + tmp_raise_focus = conf.focus.raise_on_next_focus; + tmp_warp_focus = conf.focus.warp_on_next_focus; #ifdef WITH_TARTY_WARP - tmp_raise_after_focus = mode.raise_after_next_focus; - tmp_warp_after_focus = mode.warp_after_next_focus; - tmp_display_warp = mode.display_warp; - tmp_warpsticky = mode.warpsticky; - tmp_warpshaded = mode.warpshaded; - tmp_warpiconified = mode.warpiconified; - tmp_warpfocused = mode.warpfocused; + tmp_raise_after_focus = conf.focus.raise_after_next_focus; + tmp_warp_after_focus = conf.focus.warp_after_next_focus; + tmp_display_warp = conf.warplist.enable; + tmp_warpsticky = conf.warplist.warpsticky; + tmp_warpshaded = conf.warplist.warpshaded; + tmp_warpiconified = conf.warplist.warpiconified; + tmp_warpfocused = conf.warplist.warpfocused; #endif /* WITH_TARTY_WARP */ - tmp_clickalways = mode.clickalways; + tmp_clickalways = conf.focus.clickraises; d = DialogCreate("CONFIGURE_FOCUS"); DialogSetTitle(d, _("Focus Settings")); @@ -419,7 +420,7 @@ SettingsFocus(void) table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); @@ -632,9 +633,9 @@ CB_ConfigureMoveResize(int val, void *data) if (val < 2) { - mode.movemode = tmp_move; - mode.resizemode = tmp_resize; - mode.geominfomode = tmp_geominfo; + conf.movemode = tmp_move; + conf.resizemode = tmp_resize; + conf.geominfomode = tmp_geominfo; } if (val) if ((d = @@ -794,9 +795,9 @@ SettingsMoveResize(void) } SoundPlay("SOUND_SETTINGS_MOVERESIZE"); - tmp_move = mode.movemode; - tmp_resize = mode.resizemode; - tmp_geominfo = mode.geominfomode; + tmp_move = conf.movemode; + tmp_resize = conf.resizemode; + tmp_geominfo = conf.geominfomode; d = DialogCreate("CONFIGURE_MOVERESIZE"); DialogSetTitle(d, _("Move & Resize Settings")); @@ -804,7 +805,7 @@ SettingsMoveResize(void) table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); @@ -1021,7 +1022,7 @@ CB_ConfigureDesktops(int val, void *data) if (val < 2) { ChangeNumberOfDesktops(tmp_desktops); - mode.desktop_wraparound = tmp_desktop_wraparound; + conf.desks.wraparound = tmp_desktop_wraparound; } autosave(); data = NULL; @@ -1115,8 +1116,8 @@ SettingsDesktops(void) } SoundPlay("SOUND_SETTINGS_DESKTOPS"); - tmp_desktops = mode.numdesktops; - tmp_desktop_wraparound = mode.desktop_wraparound; + tmp_desktops = conf.desks.numdesktops; + tmp_desktop_wraparound = conf.desks.wraparound; d = tmp_desk_dialog = DialogCreate("CONFIGURE_DESKTOPS"); DialogSetTitle(d, _("Multiple Desktop Settings")); @@ -1124,7 +1125,7 @@ SettingsDesktops(void) table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); @@ -1223,15 +1224,15 @@ CB_ConfigureAreas(int val, void *data) if (val < 2) { SetNewAreaSize(tmp_area_x, 9 - tmp_area_y); - mode.area_wraparound = tmp_area_wraparound; + conf.areas.wraparound = tmp_area_wraparound; if (tmp_edge_flip) { if (tmp_edge_resist < 1) tmp_edge_resist = 1; - mode.edge_flip_resistance = tmp_edge_resist; + conf.edge_flip_resistance = tmp_edge_resist; } else - mode.edge_flip_resistance = 0; + conf.edge_flip_resistance = 0; ShowEdgeWindows(); } autosave(); @@ -1309,8 +1310,8 @@ SettingsArea(void) } SoundPlay("SOUND_SETTINGS_AREA"); - tmp_area_wraparound = mode.area_wraparound; - tmp_edge_resist = mode.edge_flip_resistance; + tmp_area_wraparound = conf.areas.wraparound; + tmp_edge_resist = conf.edge_flip_resistance; if (tmp_edge_resist == 0) tmp_edge_flip = 0; else @@ -1324,7 +1325,7 @@ SettingsArea(void) table = DialogInitItem(d); DialogItemTableSetOptions(table, 1, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { table2 = DialogAddItem(table, DITEM_TABLE); DialogItemTableSetOptions(table2, 2, 0, 0, 0); @@ -1459,14 +1460,14 @@ CB_ConfigurePlacement(int val, void *data) { if (val < 2) { - mode.transientsfollowleader = tmp_with_leader; - mode.switchfortransientmap = tmp_switch_popup; - mode.manual_placement = tmp_manual_placement; - mode.manual_placement_mouse_pointer = + conf.focus.transientsfollowleader = tmp_with_leader; + conf.focus.switchfortransientmap = tmp_switch_popup; + conf.manual_placement = tmp_manual_placement; + conf.manual_placement_mouse_pointer = tmp_manual_placement_mouse_pointer; #ifdef HAS_XINERAMA if (xinerama_active) - mode.extra_head = tmp_extra_head; + conf.extra_head = tmp_extra_head; #endif } autosave(); @@ -1488,12 +1489,12 @@ SettingsPlacement(void) } SoundPlay("SOUND_SETTINGS_PLACEMENT"); - tmp_with_leader = mode.transientsfollowleader; - tmp_switch_popup = mode.switchfortransientmap; - tmp_manual_placement = mode.manual_placement; - tmp_manual_placement_mouse_pointer = mode.manual_placement_mouse_pointer; + tmp_with_leader = conf.focus.transientsfollowleader; + tmp_switch_popup = conf.focus.switchfortransientmap; + tmp_manual_placement = conf.manual_placement; + tmp_manual_placement_mouse_pointer = conf.manual_placement_mouse_pointer; #ifdef HAS_XINERAMA - tmp_extra_head = mode.extra_head; + tmp_extra_head = conf.extra_head; #endif d = DialogCreate("CONFIGURE_PLACEMENT"); @@ -1502,7 +1503,7 @@ SettingsPlacement(void) table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); @@ -1601,8 +1602,8 @@ CB_ConfigureAutoraise(int val, void *data) { if (val < 2) { - mode.autoraise = tmp_autoraise; - mode.autoraisetime = ((double)tmp_autoraisetime) / 100; + conf.autoraise = tmp_autoraise; + conf.autoraisetime = ((double)tmp_autoraisetime) / 100; } autosave(); data = NULL; @@ -1623,8 +1624,8 @@ SettingsAutoRaise(void) } SoundPlay("SOUND_SETTINGS_AUTORAISE"); - tmp_autoraise = mode.autoraise; - tmp_autoraisetime = (int)(mode.autoraisetime * 100); + tmp_autoraise = conf.autoraise; + tmp_autoraisetime = (int)(conf.autoraisetime * 100); d = DialogCreate("CONFIGURE_AUTORAISE"); DialogSetTitle(d, _("Autoraise Settings")); @@ -1632,7 +1633,7 @@ SettingsAutoRaise(void) table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); @@ -1700,9 +1701,9 @@ CB_ConfigureTooltips(int val, void *data) { if (val < 2) { - mode.tooltips = tmp_tooltips; - mode.tiptime = ((double)tmp_tooltiptime) / 100; - mode.showroottooltip = tmp_roottip; + conf.tooltips.enable = tmp_tooltips; + conf.tooltips.tiptime = ((double)tmp_tooltiptime) / 100; + conf.tooltips.showroottooltip = tmp_roottip; } autosave(); data = NULL; @@ -1723,9 +1724,9 @@ SettingsTooltips(void) } SoundPlay("SOUND_SETTINGS_TOOLTIPS"); - tmp_tooltips = mode.tooltips; - tmp_tooltiptime = (int)(mode.tiptime * 100); - tmp_roottip = mode.showroottooltip; + tmp_tooltips = conf.tooltips.enable; + tmp_tooltiptime = (int)(conf.tooltips.tiptime * 100); + tmp_roottip = conf.tooltips.showroottooltip; d = DialogCreate("CONFIGURE_TOOLTIPS"); DialogSetTitle(d, _("Tooltip Settings")); @@ -1733,7 +1734,7 @@ SettingsTooltips(void) table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); @@ -1805,7 +1806,7 @@ CB_ConfigureMiscellaneous(int val, void *data) { if (val < 2) { - mode.dialog_headers = tmp_dialog_headers; + conf.dialogs.headers = tmp_dialog_headers; } autosave(); data = NULL; @@ -1827,7 +1828,7 @@ SettingsMiscellaneous(void) } SoundPlay("SOUND_SETTINGS_MISCELLANEOUS"); - tmp_dialog_headers = mode.dialog_headers; + tmp_dialog_headers = conf.dialogs.headers; d = DialogCreate("CONFIGURE_MISCELLANEOUS"); DialogSetTitle(d, _("Miscellaneous Settings")); @@ -1835,7 +1836,7 @@ SettingsMiscellaneous(void) table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); @@ -1886,8 +1887,8 @@ CB_ConfigureAudio(int val, void *data) { if (val < 2) { - mode.sound = tmp_audio; - if (mode.sound) + conf.sound = tmp_audio; + if (conf.sound) SoundInit(); else SoundExit(); @@ -1910,7 +1911,7 @@ SettingsAudio(void) } SoundPlay("SOUND_SETTINGS_AUDIO"); - tmp_audio = mode.sound; + tmp_audio = conf.sound; d = DialogCreate("CONFIGURE_AUDIO"); DialogSetTitle(d, _("Audio Settings")); @@ -1918,7 +1919,7 @@ SettingsAudio(void) table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); @@ -1994,18 +1995,18 @@ CB_ConfigureFX(int val, void *data) { if (val < 2) { - mode.save_under = tmp_saveunders; - mode.warpmenus = tmp_warpmenus; - mode.menuslide = tmp_animated_menus; - mode.menusonscreen = tmp_menusonscreen; - mode.mapslide = tmp_map_slide; - mode.cleanupslide = tmp_cleanup_slide; + conf.save_under = tmp_saveunders; + conf.warpmenus = tmp_warpmenus; + conf.menuslide = tmp_animated_menus; + conf.menusonscreen = tmp_menusonscreen; + conf.mapslide = tmp_map_slide; + conf.cleanupslide = tmp_cleanup_slide; desks.slidein = tmp_desktop_slide; - mode.animate_shading = tmp_animate_shading; - mode.shadespeed = tmp_shade_speed; - mode.slidemode = tmp_slide_mode; - mode.slidespeedmap = tmp_map_slide_speed; - mode.slidespeedcleanup = tmp_cleanup_slide_speed; + 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; FX_Op("raindrops", tmp_effect_raindrops ? FX_OP_START : FX_OP_STOP); @@ -2049,23 +2050,23 @@ SettingsSpecialFX(void) } SoundPlay("SOUND_SETTINGS_FX"); - tmp_saveunders = mode.save_under; - tmp_warpmenus = mode.warpmenus; - tmp_animated_menus = mode.menuslide; - tmp_menusonscreen = mode.menusonscreen; - tmp_map_slide = mode.mapslide; - tmp_cleanup_slide = mode.cleanupslide; + tmp_saveunders = conf.save_under; + tmp_warpmenus = conf.warpmenus; + tmp_animated_menus = conf.menuslide; + tmp_menusonscreen = conf.menusonscreen; + tmp_map_slide = conf.mapslide; + tmp_cleanup_slide = conf.cleanupslide; tmp_desktop_slide = desks.slidein; - tmp_animate_shading = mode.animate_shading; + tmp_animate_shading = conf.animate_shading; if (desks.dragbar_width < 1) tmp_dragbar = 0; else tmp_dragbar = 1; tmp_dragdir = desks.dragdir; - tmp_slide_mode = mode.slidemode; - tmp_map_slide_speed = mode.slidespeedmap; - tmp_shade_speed = mode.shadespeed; - tmp_cleanup_slide_speed = mode.slidespeedcleanup; + 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_effect_raindrops = FX_IsOn("raindrops"); @@ -2078,7 +2079,7 @@ SettingsSpecialFX(void) table = DialogInitItem(d); DialogItemTableSetOptions(table, 4, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); @@ -2458,9 +2459,9 @@ CB_ConfigureBG(int val, void *data) if (val < 2) { - mode.desktop_bg_timeout = tmp_bg_timeout; + conf.desktop_bg_timeout = tmp_bg_timeout; desks.hiqualitybg = tmp_hiq; - mode.user_bg = tmp_userbg; + 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; tmp_bg->bg.keep_aspect = tmp_bg_keep_aspect; @@ -3298,8 +3299,8 @@ SettingsBackground(Background * bg) tmp_bg_xperc = bg->bg.xperc; tmp_bg_yperc = 1024 - bg->bg.yperc; tmp_hiq = desks.hiqualitybg; - tmp_userbg = mode.user_bg; - tmp_bg_timeout = mode.desktop_bg_timeout; + tmp_userbg = conf.user_bg; + tmp_bg_timeout = conf.desktop_bg_timeout; d = bg_sel_dialog = DialogCreate("CONFIGURE_BG"); DialogSetTitle(d, _("Desktop Background Settings")); @@ -3307,7 +3308,7 @@ SettingsBackground(Background * bg) table = DialogInitItem(d); DialogItemTableSetOptions(table, 3, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetColSpan(di, 2); @@ -3776,7 +3777,7 @@ SettingsIconbox(char *name) table = DialogInitItem(d); DialogItemTableSetOptions(table, 1, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { table2 = DialogAddItem(table, DITEM_TABLE); DialogItemTableSetOptions(table2, 2, 0, 0, 0); @@ -4173,7 +4174,7 @@ SettingsGroups(EWin * ewin) table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); @@ -4345,8 +4346,8 @@ CB_ConfigureDefaultGroupSettings(int val, void *data) { if (val < 2) { - CopyGroupConfig(&tmp_group_cfg, &(mode.group_config)); - mode.group_swapmove = tmp_group_swap; + CopyGroupConfig(&tmp_group_cfg, &(conf.group_config)); + conf.group_swapmove = tmp_group_swap; } autosave(); data = NULL; @@ -4368,8 +4369,8 @@ SettingsDefaultGroupControl(void) } SoundPlay("SOUND_SETTINGS_GROUP"); - CopyGroupConfig(&(mode.group_config), &tmp_group_cfg); - tmp_group_swap = mode.group_swapmove; + CopyGroupConfig(&(conf.group_config), &tmp_group_cfg); + tmp_group_swap = conf.group_swapmove; d = DialogCreate("CONFIGURE_DEFAULT_GROUP_CONTROL"); DialogSetTitle(d, _("Default Group Control Settings")); @@ -4377,7 +4378,7 @@ SettingsDefaultGroupControl(void) table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); @@ -4625,7 +4626,7 @@ SettingsRemember() table = DialogInitItem(d); DialogItemTableSetOptions(table, 3, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); diff --git a/src/setup.c b/src/setup.c index 046eb572..a34479b2 100644 --- a/src/setup.c +++ b/src/setup.c @@ -115,7 +115,7 @@ SetupX() /* This function sets up all of our connections to X */ - int shape_event_base, shape_error_base, i; + int shape_event_base, shape_error_base; EDBUG(6, "SetupX"); @@ -383,132 +383,92 @@ SetupX() XFreeModifiermap(mod); } - /* 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. - * Also, we'll take this opportunity to initialize all of our - * important state variables. - */ - memset(&mode, 0, sizeof(mode)); - - mode.next_move_x_plus = 0; - mode.next_move_y_plus = 0; + /* Init state variable struct */ + memset(&mode, 0, sizeof(EMode)); mode.mode = MODE_NONE; - mode.deskmode = MODE_NONE; - mode.place = 0; - mode.flipp = 0; mode.startup = 1; - mode.xselect = 0; - mode.ewin = NULL; - mode.button = NULL; - mode.have_place_grab = 0; - mode.noewin = 0; - mode.px = 0; - mode.py = 0; - mode.x = 0; - mode.y = 0; - mode.showroottooltip = 1; - mode.pager_sel_button = 2; - mode.pager_win_button = 1; - mode.pager_menu_button = 3; - mode.focusmode = FOCUS_SLOPPY; - mode.focuswin = NULL; - mode.realfocuswin = NULL; - mode.mouse_over_win = NULL; - mode.click_focus_grabbed = 0; - mode.movemode = 0; - mode.swapmovemode = 0; - mode.swapcoord_x = mode.swapcoord_y = 0; - mode.dockapp_support = 1; - mode.dockdirmode = DOCK_DOWN; - mode.dockstartx = 0; - mode.dockstarty = 0; - mode.primaryicondir = ICON_RIGHT; - mode.resizemode = 1; - mode.geominfomode = 1; - mode.slidemode = 0; - mode.cleanupslide = 1; - mode.mapslide = 1; - mode.slidespeedmap = 6000; - mode.slidespeedcleanup = 8000; - mode.shadespeed = 8000; - mode.animate_shading = 1; - mode.doingslide = 0; - mode.server_grabbed = 0; - mode.desktop_bg_timeout = 240; - mode.sound = 1; - mode.button_move_resistance = 5; - mode.button_move_pending = 0; - mode.current_cmap = 0; - mode.autosave = 1; - mode.slideout = NULL; - mode.tooltips = 1; - mode.tiptime = 0.5; - mode.autoraise = 0; - mode.autoraisetime = 0.5; - mode.memory_paranoia = 1; - mode.save_under = 0; - mode.cur_menu_mode = 0; - mode.cur_menu_depth = 0; - for (i = 0; i < 256; i++) - mode.cur_menu[i] = NULL; - mode.menuslide = 0; - mode.menusonscreen = 1; - mode.warpmenus = 1; - mode.numdesktops = 2; - mode.transientsfollowleader = 1; - mode.switchfortransientmap = 1; - mode.snap = 1; - mode.edge_snap_dist = 8; - mode.screen_snap_dist = 32; - mode.menu_cover_win = 0; - mode.all_new_windows_get_focus = 0; - mode.new_transients_get_focus = 0; - mode.new_transients_get_focus_if_group_focused = 1; - mode.manual_placement = 0; - mode.raise_on_next_focus = 1; - mode.raise_after_next_focus = 1; + + /* 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.wraparound = 0; + conf.desks.numdesktops = 2; + conf.desks.wraparound = 0; + conf.dialogs.headers = 0; + conf.dock.dirmode = DOCK_DOWN; + conf.dock.startx = 0; + conf.dock.starty = 0; + conf.focus.mode = FOCUS_SLOPPY; + conf.focus.clickraises = 0; + conf.focus.transientsfollowleader = 1; + conf.focus.switchfortransientmap = 1; + conf.focus.all_new_windows_get_focus = 0; + conf.focus.new_transients_get_focus = 0; + conf.focus.new_transients_get_focus_if_group_focused = 1; + conf.focus.raise_on_next_focus = 1; + conf.focus.raise_after_next_focus = 1; + conf.focus.warp_on_next_focus = 0; + conf.group_config.iconify = 1; + conf.group_config.kill = 0; + conf.group_config.move = 1; + conf.group_config.raise = 0; + conf.group_config.set_border = 1; + conf.group_config.stick = 1; + conf.group_config.shade = 1; + conf.group_config.mirror = 1; + conf.pagers.enable = 1; + conf.pagers.zoom = 1; + conf.pagers.title = 1; + conf.pagers.hiq = 1; + conf.pagers.snap = 1; + conf.pagers.scanspeed = 10; + conf.group_swapmove = 1; + conf.pagers.sel_button = 2; + conf.pagers.win_button = 1; + conf.pagers.menu_button = 3; + conf.snap.enable = 1; + conf.snap.edge_snap_dist = 8; + conf.snap.screen_snap_dist = 32; + conf.tooltips.enable = 1; + conf.tooltips.tiptime = 0.5; + conf.tooltips.showroottooltip = 1; #ifdef WITH_TARTY_WARP - mode.display_warp = 1; + conf.warplist.enable = 1; #else - mode.display_warp = 0; + conf.warplist.enable = 0; #endif /* WITH_TARTY_WARP */ - mode.warp_on_next_focus = 0; - mode.warpsticky = 1; - mode.warpshaded = 1; - mode.warpiconified = 0; - mode.warpfocused = 1; - mode.edge_flip_resistance = 15; - mode.context_ewin = NULL; - mode.moveresize_pending_ewin = NULL; - mode.borderpartpress = 0; - mode.windowdestroy = 0; - mode.context_w = 0; - mode.context_h = 0; - mode.show_pagers = 1; - mode.context_pager = NULL; - mode.pager_hiq = 1; - mode.pager_snap = 1; - mode.user_bg = 1; - mode.pager_zoom = 1; - mode.pager_title = 1; - mode.pager_scanspeed = 10; - mode.icon_textclass = NULL; - mode.icon_mode = 2; - mode.nogroup = 0; - mode.group_config.iconify = 1; - mode.group_config.kill = 0; - mode.group_config.move = 1; - mode.group_config.raise = 0; - mode.group_config.set_border = 1; - mode.group_config.stick = 1; - mode.group_config.shade = 1; - mode.group_config.mirror = 1; - mode.group_swapmove = 1; - mode.area_wraparound = 0; - mode.dialog_headers = 0; - mode.desktop_wraparound = 0; - mode.clickalways = 0; - mode.keybinds_changed = 0; + conf.warplist.warpsticky = 1; + conf.warplist.warpshaded = 1; + conf.warplist.warpiconified = 0; + conf.warplist.warpfocused = 1; + + conf.deskmode = MODE_NONE; + conf.movemode = 0; + conf.dockapp_support = 1; + conf.primaryicondir = ICON_RIGHT; + conf.resizemode = 1; + conf.geominfomode = 1; + conf.slidemode = 0; + conf.cleanupslide = 1; + conf.mapslide = 1; + conf.slidespeedmap = 6000; + conf.slidespeedcleanup = 8000; + conf.shadespeed = 8000; + conf.animate_shading = 1; + conf.desktop_bg_timeout = 240; + conf.sound = 1; + conf.button_move_resistance = 5; + conf.autosave = 1; + conf.autoraise = 0; + conf.autoraisetime = 0.5; + conf.memory_paranoia = 1; + conf.save_under = 0; + conf.menuslide = 0; + conf.menusonscreen = 1; + conf.warpmenus = 1; + conf.user_bg = 1; + conf.manual_placement = 0; + conf.edge_flip_resistance = 15; desks.dragdir = 2; desks.dragbar_width = 16; diff --git a/src/slideout.c b/src/slideout.c index 783326e8..566f0195 100644 --- a/src/slideout.c +++ b/src/slideout.c @@ -198,7 +198,7 @@ SlideoutShow(Slideout * s, Window win) XSync(disp, False); EMapRaised(disp, s->win); SlideWindowSizeTo(s->win, xx + s->w, yy, xx, yy, 0, s->h, s->w, s->h, - mode.slidespeedmap); + conf.slidespeedmap); break; case 1: att.win_gravity = NorthWestGravity; @@ -210,7 +210,7 @@ SlideoutShow(Slideout * s, Window win) XSync(disp, False); EMapRaised(disp, s->win); SlideWindowSizeTo(s->win, xx, yy, xx, yy, 0, s->h, s->w, s->h, - mode.slidespeedmap); + conf.slidespeedmap); break; case 2: att.win_gravity = SouthEastGravity; @@ -222,7 +222,7 @@ SlideoutShow(Slideout * s, Window win) XSync(disp, False); EMapRaised(disp, s->win); SlideWindowSizeTo(s->win, xx, yy + s->h, xx, yy, s->w, 0, s->w, s->h, - mode.slidespeedmap); + conf.slidespeedmap); break; case 3: att.win_gravity = NorthWestGravity; @@ -234,7 +234,7 @@ SlideoutShow(Slideout * s, Window win) XSync(disp, False); EMapRaised(disp, s->win); SlideWindowSizeTo(s->win, xx, yy, xx, yy, s->w, 0, s->w, s->h, - mode.slidespeedmap); + conf.slidespeedmap); break; default: break; diff --git a/src/snaps.c b/src/snaps.c index 20d4bac7..22d4df57 100644 --- a/src/snaps.c +++ b/src/snaps.c @@ -286,7 +286,7 @@ SnapshotEwinDialog(EWin * ewin) table = DialogInitItem(d); DialogItemTableSetOptions(table, 4, 0, 0, 0); - if (mode.dialog_headers) + if (conf.dialogs.headers) { di = DialogAddItem(table, DITEM_IMAGE); DialogItemSetPadding(di, 2, 2, 2, 2); diff --git a/src/sound.c b/src/sound.c index de326f7e..79e793c0 100644 --- a/src/sound.c +++ b/src/sound.c @@ -139,7 +139,7 @@ SamplePlay(Sample * s) EDBUG(5, "SamplePlay"); #ifdef HAVE_LIBESD - if ((sound_fd < 0) || (!mode.sound) || (!s)) + if ((sound_fd < 0) || (!conf.sound) || (!s)) EDBUG_RETURN_; if (!s->id) { @@ -222,7 +222,7 @@ SclassApply(SoundClass * sclass) if (!sclass) EDBUG_RETURN_; #ifdef HAVE_LIBESD - if ((!sclass->sample) && (mode.sound)) + if ((!sclass->sample) && (conf.sound)) { f = FindFile(sclass->file); if (f) @@ -231,7 +231,7 @@ SclassApply(SoundClass * sclass) Efree(f); } } - if ((mode.sound) && (sclass->sample)) + if ((conf.sound) && (sclass->sample)) SamplePlay(sclass->sample); #endif EDBUG_RETURN_; @@ -289,7 +289,7 @@ SoundInit(void) EDBUG(5, "SoundInit"); #ifdef HAVE_LIBESD - if (!mode.sound) + if (!conf.sound) EDBUG_RETURN_; if (sound_fd != -1) EDBUG_RETURN_; @@ -304,10 +304,10 @@ SoundInit(void) "communicating with the audio server (Esound). Audio will\n" "now be disabled.\n")); RESET_ALERT; - mode.sound = 0; + conf.sound = 0; } #else - mode.sound = 0; + conf.sound = 0; #endif EDBUG_RETURN_; } diff --git a/src/startup.c b/src/startup.c index d9da8c6d..5e38bcb9 100644 --- a/src/startup.c +++ b/src/startup.c @@ -243,7 +243,7 @@ CreateStartupDisplay(char start) if ((!ic) || (!bg)) EDBUG_RETURN_; - speed = mode.slidespeedcleanup / 2; + speed = conf.slidespeedcleanup / 2; spd = 16; min = 2; fy = 0; diff --git a/src/warp.c b/src/warp.c index d11cb9ec..6125339a 100644 --- a/src/warp.c +++ b/src/warp.c @@ -54,7 +54,7 @@ WarpFocusHandleEvent(XEvent * ev) { EDBUG(5, "WarpFocusHandleEvent"); - if (!mode.display_warp) + if (!conf.warplist.enable) EDBUG_RETURN(0); if (ev->type != KeyPress && ev->type != KeyRelease) @@ -86,7 +86,7 @@ WarpFocus(int delta) EDBUG(5, "WarpFocus"); - if (!mode.display_warp) + if (!conf.warplist.enable) EDBUG_RETURN_; lst = (EWin **) ListItemType(&num, LIST_TYPE_WARP_RING); @@ -104,12 +104,12 @@ WarpFocus(int delta) && (ewin->x + ewin->w > 0) && (ewin->x < root.w) && (ewin->y + ewin->h > 0) && (ewin->y < root.h) && (!ewin->skipfocus) && !(ewin->shaded - && !mode.warpshaded) + && !conf.warplist.warpshaded) && (!ewin->menu) && (!ewin->pager) && !(ewin->sticky - && !mode. + && !conf.warplist. warpsticky) && (!ewin->ibox) && !(ewin->iconified - && !mode.warpiconified) + && !conf.warplist.warpiconified) /*&& (ewin->client.mwm_decor_title) && * (ewin->client.mwm_decor_border) */ ) @@ -131,14 +131,14 @@ WarpFocus(int delta) ewin = NULL; if (ewin) { - if (mode.raise_on_next_focus) + if (conf.focus.raise_on_next_focus) RaiseEwin(ewin); - if (mode.warp_on_next_focus && !ewin->iconified) + if (conf.focus.warp_on_next_focus && !ewin->iconified) XWarpPointer(disp, None, ewin->win, 0, 0, 0, 0, ewin->w / 2, ewin->h / 2); - /* if (mode.focusmode == FOCUS_CLICK) */ + /* if (conf.focus.mode == FOCUS_CLICK) */ /* FocusToEWin(ewin); */ - if (mode.warpfocused && !ewin->iconified) + if (conf.warplist.warpfocused && !ewin->iconified) FocusToEWin(ewin); } WarpFocusShowTitle(ewin); @@ -166,15 +166,16 @@ WarpFocusFinish(void) ewin = NULL; if (ewin) { - if (mode.warpiconified && ewin->iconified) + if (conf.warplist.warpiconified && ewin->iconified) DeIconifyEwin(ewin); FocusToEWin(ewin); - if (mode.warp_after_next_focus || mode.warp_on_next_focus) + if (conf.focus.warp_after_next_focus + || conf.focus.warp_on_next_focus) { XWarpPointer(disp, None, ewin->win, 0, 0, 0, 0, ewin->w / 2, ewin->h / 2); } - if (mode.raise_after_next_focus) + if (conf.focus.raise_after_next_focus) RaiseEwin(ewin); } /*printf ("Raise: %s\n", ewin->client.title); */ diff --git a/src/x.c b/src/x.c index 5052c497..cc1807be 100644 --- a/src/x.c +++ b/src/x.c @@ -150,7 +150,7 @@ ECreateWindow(Window parent, int x, int y, int w, int h, int saveunder) attr.border_pixel = 0; /* attr.background_pixel = 0; */ attr.background_pixmap = None; - if ((saveunder == 1) && (mode.save_under)) + if ((saveunder == 1) && (conf.save_under)) attr.save_under = True; else if (saveunder == 2) attr.save_under = True;