Skip to content

Commit

Permalink
Merge pull request yshui#768 from yshui/deprecation-chore
Browse files Browse the repository at this point in the history
  • Loading branch information
yshui authored Jan 27, 2022
2 parents 6aa9fcc + b65c8c7 commit 0ad6685
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 292 deletions.
6 changes: 0 additions & 6 deletions man/picom.1.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ OPTIONS
*-D*, *--fade-delta*='MILLISECONDS'::
The time between steps in fade step, in milliseconds. (> 0, defaults to 10)

*-m*, *--menu-opacity*='OPACITY'::
Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0)

*-c*, *--shadow*::
Enabled client-side shadows on windows. Note desktop windows (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, unless explicitly requested using the wintypes option.

Expand Down Expand Up @@ -130,9 +127,6 @@ OPTIONS
*--detect-client-opacity*::
Detect '_NET_WM_WINDOW_OPACITY' on client windows, useful for window managers not passing '_NET_WM_WINDOW_OPACITY' of client windows to frame windows.

*--refresh-rate* 'REFRESH_RATE'::
Specify refresh rate of the screen. If not specified or 0, picom will try detecting this with X RandR extension.

*--vsync*, *--no-vsync*::
Enable/disable VSync.

Expand Down
6 changes: 0 additions & 6 deletions picom.sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,6 @@ detect-rounded-corners = true;
# detect-client-opacity = false
detect-client-opacity = true;

# Specify refresh rate of the screen. If not specified or 0, picom will
# try detecting this with X RandR extension.
#
# refresh-rate = 60
refresh-rate = 0;

# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window,
# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy,
# provided that the WM supports it.
Expand Down
9 changes: 1 addition & 8 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ typedef struct session {
ev_timer unredir_timer;
/// Timer for fading
ev_timer fade_timer;
/// Timer for delayed drawing, right now only used by
/// swopti
ev_timer delayed_draw_timer;
/// Use an ev_idle callback for drawing
/// So we only start drawing when events are processed
ev_idle draw_idle;
Expand Down Expand Up @@ -187,7 +184,7 @@ typedef struct session {
int root_width;
// Damage of root window.
// Damage root_damage;
/// X Composite overlay window. Used if <code>--paint-on-overlay</code>.
/// X Composite overlay window.
xcb_window_t overlay;
/// The target window for debug mode
xcb_window_t debug_window;
Expand Down Expand Up @@ -298,10 +295,6 @@ typedef struct session {
region_t shadow_exclude_reg;

// === Software-optimization-related ===
/// Currently used refresh rate.
int refresh_rate;
/// Interval between refresh in nanoseconds.
long refresh_intv;
/// Nanosecond offset of the first painting.
long paint_tm_offset;

Expand Down
2 changes: 0 additions & 2 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,6 @@ char *parse_config(options_t *opt, const char *config_file, bool *shadow_enable,
.benchmark_wid = XCB_NONE,
.logpath = NULL,

.refresh_rate = 0,
.sw_opti = false,
.use_damage = true,

.shadow_red = 0.0,
Expand Down
4 changes: 0 additions & 4 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ typedef struct options {
win_option_t wintype_option[NUM_WINTYPES];

// === VSync & software optimization ===
/// User-specified refresh rate.
int refresh_rate;
/// Whether to enable refresh-rate-based software optimization.
bool sw_opti;
/// VSync method to use;
bool vsync;
/// Whether to use glFinish() instead of glFlush() for (possibly) better
Expand Down
83 changes: 28 additions & 55 deletions src/config_libconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ static inline void parse_wintype_config(const config_t *cfg, const char *member_
char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shadow_enable,
bool *fading_enable, bool *conv_kern_hasneg,
win_option_mask_t *winopt_mask) {

const char *deprecation_message =
"option has been deprecated. Please remove it from your configuration file. "
"If you encounter any problems without this feature, please feel free to "
"open a bug report";
char *path = NULL;
FILE *f;
config_t cfg;
Expand Down Expand Up @@ -387,24 +392,11 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
// -c (shadow_enable)
if (config_lookup_bool(&cfg, "shadow", &ival))
*shadow_enable = ival;
// -C (no_dock_shadow)
if (config_lookup_bool(&cfg, "no-dock-shadow", &ival)) {
log_error("Option `no-dock-shadow` has been removed. Please use the "
"wintype option `shadow` of `dock` instead.");
goto err;
}
// -G (no_dnd_shadow)
if (config_lookup_bool(&cfg, "no-dnd-shadow", &ival)) {
log_error("Option `no-dnd-shadow` has been removed. Please use the "
"wintype option `shadow` of `dnd` instead.");
goto err;
};
// -m (menu_opacity)
if (config_lookup_float(&cfg, "menu-opacity", &dval)) {
log_warn("Option `menu-opacity` is deprecated, and will be "
"removed.Please use the "
"wintype option `opacity` of `popup_menu` and `dropdown_menu` "
"instead.");
log_warn("Option `menu-opacity` is deprecated, and will be removed."
"Please use the wintype option `opacity` of `popup_menu`"
"and `dropdown_menu` instead.");
opt->wintype_option[WINTYPE_DROPDOWN_MENU].opacity = dval;
opt->wintype_option[WINTYPE_POPUP_MENU].opacity = dval;
winopt_mask[WINTYPE_DROPDOWN_MENU].opacity = true;
Expand Down Expand Up @@ -451,19 +443,16 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
// --detect-client-opacity
lcfg_lookup_bool(&cfg, "detect-client-opacity", &opt->detect_client_opacity);
// --refresh-rate
if (config_lookup_int(&cfg, "refresh-rate", &opt->refresh_rate)) {
if (opt->refresh_rate < 0) {
log_warn("Invalid refresh rate %d, fallback to 0", opt->refresh_rate);
opt->refresh_rate = 0;
}
if (config_lookup_int(&cfg, "refresh-rate", &ival)) {
log_warn("The refresh-rate %s", deprecation_message);
}
// --vsync
if (config_lookup_string(&cfg, "vsync", &sval)) {
opt->vsync = parse_vsync(sval);
log_warn("vsync option will take a boolean from now on. \"%s\" is "
"interpreted as \"%s\" for compatibility, but this will stop "
"working soon",
sval, opt->vsync ? "true" : "false");
bool parsed_vsync = parse_vsync(sval);
log_error("vsync option will take a boolean from now on. \"%s\" in "
"your configuration should be changed to \"%s\"",
sval, parsed_vsync ? "true" : "false");
goto err;
}
lcfg_lookup_bool(&cfg, "vsync", &opt->vsync);
// --backend
Expand Down Expand Up @@ -492,7 +481,9 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
opt->logpath = strdup(sval);
}
// --sw-opti
lcfg_lookup_bool(&cfg, "sw-opti", &opt->sw_opti);
if (lcfg_lookup_bool(&cfg, "sw-opti", &bval)) {
log_warn("The sw-opti %s", deprecation_message);
}
// --use-ewmh-active-win
lcfg_lookup_bool(&cfg, "use-ewmh-active-win", &opt->use_ewmh_active_win);
// --unredir-if-possible
Expand Down Expand Up @@ -577,19 +568,21 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
if (config_lookup_string(&cfg, "glx-swap-method", &sval)) {
char *endptr;
long val = strtol(sval, &endptr, 10);
bool should_remove = true;
if (*endptr || !(*sval)) {
// sval is not a number, or an empty string
val = -1;
}
if (strcmp(sval, "undefined") != 0 && val != 0) {
// If not undefined, we will use damage and buffer-age to limit
// the rendering area.
opt->use_damage = true;
should_remove = false;
}
log_warn("glx-swap-method has been deprecated since v6, your setting "
"\"%s\" should be %s.",
sval,
opt->use_damage ? "replaced by `use-damage = true`" : "removed");
log_error("glx-swap-method has been removed, your setting "
"\"%s\" should be %s.",
sval,
!should_remove ? "replaced by `use-damage = true`" : "removed");
goto err;
}
// --use-damage
lcfg_lookup_bool(&cfg, "use-damage", &opt->use_damage);
Expand All @@ -603,14 +596,9 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
}

// --glx-use-gpushader4
if (config_lookup_bool(&cfg, "glx-use-gpushader4", &ival) && ival) {
log_warn("glx-use-gpushader4 is deprecated since v6, please remove it "
"from"
"your config file");
}
// --xrender-sync
if (config_lookup_bool(&cfg, "xrender-sync", &ival) && ival) {
log_error("Please use xrender-sync-fence instead of xrender-sync.");
if (config_lookup_bool(&cfg, "glx-use-gpushader4", &ival)) {
log_error("glx-use-gpushader4 has been removed, please remove it "
"from your config file");
goto err;
}
// --xrender-sync-fence
Expand All @@ -619,21 +607,6 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
if (lcfg_lookup_bool(&cfg, "clear-shadow", &bval))
log_warn("\"clear-shadow\" is removed as an option, and is always"
" enabled now. Consider removing it from your config file");
if (lcfg_lookup_bool(&cfg, "paint-on-overlay", &bval)) {
log_error("\"paint-on-overlay\" has been removed as an option, and "
"the feature is enabled whenever possible");
goto err;
}

if (config_lookup_float(&cfg, "alpha-step", &dval)) {
log_error("\"alpha-step\" has been removed, compton now tries to make use"
" of all alpha values");
goto err;
}

const char *deprecation_message attr_unused =
"has been removed. If you encounter problems "
"without this feature, please feel free to open a bug report";

config_setting_t *blur_cfg = config_lookup(&cfg, "blur");
if (blur_cfg) {
Expand Down
4 changes: 2 additions & 2 deletions src/dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,8 +1010,8 @@ static bool cdbus_process_opts_get(session_t *ps, DBusMessage *msg) {
cdbus_m_opts_get_do(stoppaint_force, cdbus_reply_enum);
cdbus_m_opts_get_do(logpath, cdbus_reply_string);

cdbus_m_opts_get_do(refresh_rate, cdbus_reply_int32);
cdbus_m_opts_get_do(sw_opti, cdbus_reply_bool);
cdbus_m_opts_get_stub(refresh_rate, cdbus_reply_int32, 0);
cdbus_m_opts_get_stub(sw_opti, cdbus_reply_bool, false);
cdbus_m_opts_get_do(vsync, cdbus_reply_bool);
if (!strcmp("backend", target)) {
assert(ps->o.backend < sizeof(BACKEND_STRS) / sizeof(BACKEND_STRS[0]));
Expand Down
Loading

0 comments on commit 0ad6685

Please sign in to comment.