Move default values of options to config.c

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-05-27 22:59:56 +01:00
parent b7bb13dc59
commit 4a74b4f199
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
3 changed files with 65 additions and 66 deletions

View File

@ -1417,71 +1417,6 @@ static session_t *session_init(int argc, char **argv, Display *dpy,
#ifdef CONFIG_OPENGL
.glx_prog_win = GLX_PROG_MAIN_INIT,
#endif
.o =
{
.backend = BKEND_XRENDER,
.glx_no_stencil = false,
.mark_wmwin_focused = false,
.mark_ovredir_focused = false,
.detect_rounded_corners = false,
.resize_damage = 0,
.unredir_if_possible = false,
.unredir_if_possible_blacklist = NULL,
.unredir_if_possible_delay = 0,
.redirected_force = UNSET,
.stoppaint_force = UNSET,
.dbus = false,
.benchmark = 0,
.benchmark_wid = XCB_NONE,
.logpath = NULL,
.refresh_rate = 0,
.sw_opti = false,
.shadow_red = 0.0,
.shadow_green = 0.0,
.shadow_blue = 0.0,
.shadow_radius = 18,
.shadow_offset_x = -15,
.shadow_offset_y = -15,
.shadow_opacity = .75,
.shadow_blacklist = NULL,
.shadow_ignore_shaped = false,
.respect_prop_shadow = false,
.xinerama_shadow_crop = false,
.fade_in_step = 0.028,
.fade_out_step = 0.03,
.fade_delta = 10,
.no_fading_openclose = false,
.no_fading_destroyed_argb = false,
.fade_blacklist = NULL,
.inactive_opacity = 1.0,
.inactive_opacity_override = false,
.active_opacity = 1.0,
.frame_opacity = 1.0,
.detect_client_opacity = false,
.blur_background = false,
.blur_background_frame = false,
.blur_background_fixed = false,
.blur_background_blacklist = NULL,
.blur_kerns = {NULL},
.inactive_dim = 0.0,
.inactive_dim_fixed = false,
.invert_color_list = NULL,
.opacity_rules = NULL,
.use_ewmh_active_win = false,
.focus_blacklist = NULL,
.detect_transient = false,
.detect_client_leader = false,
.track_wdata = false,
.track_leader = false,
},
.time_start = {0, 0},
.redirected = false,
.alpha_picts = NULL,

View File

@ -479,6 +479,70 @@ void set_default_winopts(options_t *opt, win_option_mask_t *mask, bool shadow_en
char *parse_config(options_t *opt, const char *config_file, bool *shadow_enable,
bool *fading_enable, bool *hasneg, win_option_mask_t *winopt_mask) {
*opt = (struct options){
.backend = BKEND_XRENDER,
.glx_no_stencil = false,
.mark_wmwin_focused = false,
.mark_ovredir_focused = false,
.detect_rounded_corners = false,
.resize_damage = 0,
.unredir_if_possible = false,
.unredir_if_possible_blacklist = NULL,
.unredir_if_possible_delay = 0,
.redirected_force = UNSET,
.stoppaint_force = UNSET,
.dbus = false,
.benchmark = 0,
.benchmark_wid = XCB_NONE,
.logpath = NULL,
.refresh_rate = 0,
.sw_opti = false,
.shadow_red = 0.0,
.shadow_green = 0.0,
.shadow_blue = 0.0,
.shadow_radius = 18,
.shadow_offset_x = -15,
.shadow_offset_y = -15,
.shadow_opacity = .75,
.shadow_blacklist = NULL,
.shadow_ignore_shaped = false,
.respect_prop_shadow = false,
.xinerama_shadow_crop = false,
.fade_in_step = 0.028,
.fade_out_step = 0.03,
.fade_delta = 10,
.no_fading_openclose = false,
.no_fading_destroyed_argb = false,
.fade_blacklist = NULL,
.inactive_opacity = 1.0,
.inactive_opacity_override = false,
.active_opacity = 1.0,
.frame_opacity = 1.0,
.detect_client_opacity = false,
.blur_background = false,
.blur_background_frame = false,
.blur_background_fixed = false,
.blur_background_blacklist = NULL,
.blur_kerns = {NULL},
.inactive_dim = 0.0,
.inactive_dim_fixed = false,
.invert_color_list = NULL,
.opacity_rules = NULL,
.use_ewmh_active_win = false,
.focus_blacklist = NULL,
.detect_transient = false,
.detect_client_leader = false,
.track_wdata = false,
.track_leader = false,
};
char *ret = NULL;
#ifdef CONFIG_LIBCONFIG
ret = parse_config_libconfig(opt, config_file, shadow_enable, fading_enable,

View File

@ -63,7 +63,7 @@ typedef struct _c2_lptr c2_lptr_t;
#define MAX_BLUR_PASS 5
/// Structure representing all options.
typedef struct options_t {
typedef struct options {
// === Debugging ===
bool monitor_repaint;
bool print_diagnostics;