1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

Deprecate the refresh-rate options

It's meaningless without the sw-opti option, which has been deprecated
since v6.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2022-01-24 18:35:45 +00:00
parent 183e83cf11
commit bcbc410c92
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4
10 changed files with 12 additions and 55 deletions

View file

@ -130,9 +130,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.

View file

@ -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.

View file

@ -295,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;

View file

@ -527,7 +527,6 @@ char *parse_config(options_t *opt, const char *config_file, bool *shadow_enable,
.benchmark_wid = XCB_NONE,
.logpath = NULL,
.refresh_rate = 0,
.use_damage = true,
.shadow_red = 0.0,

View file

@ -130,8 +130,6 @@ typedef struct options {
win_option_t wintype_option[NUM_WINTYPES];
// === VSync & software optimization ===
/// User-specified refresh rate.
int refresh_rate;
/// VSync method to use;
bool vsync;
/// Whether to use glFinish() instead of glFlush() for (possibly) better

View file

@ -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;
@ -451,11 +456,8 @@ 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)) {
@ -620,10 +622,6 @@ char *parse_config_libconfig(options_t *opt, const char *config_file, bool *shad
log_warn("\"clear-shadow\" is removed as an option, and is always"
" enabled now. Consider removing it from your config file");
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) {
if (config_setting_lookup_string(blur_cfg, "method", &sval)) {

View file

@ -1005,7 +1005,7 @@ 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_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)) {

View file

@ -160,10 +160,6 @@ static void usage(const char *argv0, int ret) {
" managers not passing _NET_WM_WINDOW_OPACITY of client windows to frame\n"
" windows.\n"
"\n"
"--refresh-rate val\n"
" Specify refresh rate of the screen. If not specified or 0, we\n"
" will try detecting this with X RandR extension.\n"
"\n"
"--vsync\n"
" Enable VSync\n"
"\n"
@ -641,7 +637,10 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
P_CASEBOOL(266, shadow_ignore_shaped);
P_CASEBOOL(267, detect_rounded_corners);
P_CASEBOOL(268, detect_client_opacity);
P_CASEINT(269, refresh_rate);
case 269:
log_warn("--refresh-rate has been deprecated, please remove it from"
"your command line options");
break;
case 270:
if (optarg) {
opt->vsync = parse_vsync(optarg);
@ -912,7 +911,6 @@ bool get_cfg(options_t *opt, int argc, char *const *argv, bool shadow_enable,
opt->inactive_dim = normalize_d(opt->inactive_dim);
opt->frame_opacity = normalize_d(opt->frame_opacity);
opt->shadow_opacity = normalize_d(opt->shadow_opacity);
opt->refresh_rate = normalize_i_range(opt->refresh_rate, 0, 300);
opt->max_brightness = normalize_d(opt->max_brightness);
if (opt->max_brightness < 1.0) {

View file

@ -1084,24 +1084,6 @@ static inline bool write_pid(session_t *ps) {
return true;
}
/**
* Update refresh rate info with X Randr extension.
*/
void update_refresh_rate(session_t *ps) {
xcb_randr_get_screen_info_reply_t *randr_info = xcb_randr_get_screen_info_reply(
ps->c, xcb_randr_get_screen_info(ps->c, ps->root), NULL);
if (!randr_info)
return;
ps->refresh_rate = randr_info->rate;
free(randr_info);
if (ps->refresh_rate)
ps->refresh_intv = US_PER_SEC / ps->refresh_rate;
else
ps->refresh_intv = 0;
}
/**
* Initialize X composite overlay window.
*/
@ -1592,9 +1574,6 @@ static session_t *session_init(int argc, char **argv, Display *dpy,
.white_picture = XCB_NONE,
.gaussian_map = NULL,
.refresh_rate = 0,
.refresh_intv = 0UL,
#ifdef CONFIG_VSYNC_DRM
.drm_fd = -1,
#endif

View file

@ -40,8 +40,6 @@ uint32_t determine_evmask(session_t *ps, xcb_window_t wid, win_evmode_t mode);
void circulate_win(session_t *ps, xcb_circulate_notify_event_t *ce);
void update_refresh_rate(session_t *ps);
void root_damaged(session_t *ps);
void cxinerama_upd_scrs(session_t *ps);