From 4a74b4f19908be21508c151de065ae50900996bd Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Mon, 27 May 2019 22:59:56 +0100 Subject: [PATCH] Move default values of options to config.c Signed-off-by: Yuxuan Shui --- src/compton.c | 65 --------------------------------------------------- src/config.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/config.h | 2 +- 3 files changed, 65 insertions(+), 66 deletions(-) diff --git a/src/compton.c b/src/compton.c index 5e096d9..d6cd080 100644 --- a/src/compton.c +++ b/src/compton.c @@ -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, diff --git a/src/config.c b/src/config.c index 577feb8..128c726 100644 --- a/src/config.c +++ b/src/config.c @@ -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, diff --git a/src/config.h b/src/config.h index 075c98c..2e8ff45 100644 --- a/src/config.h +++ b/src/config.h @@ -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;