Enable paint-on-overlay whenever possible
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
f65d7b2e64
commit
e142993bb5
|
@ -465,9 +465,6 @@ typedef struct options_t {
|
|||
bool fork_after_register;
|
||||
/// Whether to detect rounded corners.
|
||||
bool detect_rounded_corners;
|
||||
/// Whether to paint on X Composite overlay window instead of root
|
||||
/// window.
|
||||
bool paint_on_overlay;
|
||||
/// Force painting of window content with blending.
|
||||
bool force_win_blend;
|
||||
/// Resize damage for a specific number of pixels.
|
||||
|
@ -1371,7 +1368,7 @@ get_atom(session_t *ps, const char *atom_name) {
|
|||
*/
|
||||
static inline Window
|
||||
get_tgt_window(session_t *ps) {
|
||||
return ps->o.paint_on_overlay ? ps->overlay: ps->root;
|
||||
return ps->overlay != XCB_NONE ? ps->overlay: ps->root;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -3869,7 +3869,9 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) {
|
|||
case 272:
|
||||
printf_errf("(): use of --dbe is deprecated");
|
||||
break;
|
||||
P_CASEBOOL(273, paint_on_overlay);
|
||||
case 273:
|
||||
printf_errf("(): --paint-on-overlay is removed, and is enabled when possible");
|
||||
break;
|
||||
P_CASEBOOL(274, sw_opti);
|
||||
P_CASEBOOL(275, vsync_aggressive);
|
||||
P_CASEBOOL(276, use_ewmh_active_win);
|
||||
|
@ -4494,11 +4496,9 @@ init_overlay(session_t *ps) {
|
|||
// xcb_unmap_window(c, ps->overlay);
|
||||
// XFlush(ps->dpy);
|
||||
}
|
||||
else {
|
||||
else
|
||||
fprintf(stderr, "Cannot get X Composite overlay window. Falling "
|
||||
"back to painting on root window.\n");
|
||||
ps->o.paint_on_overlay = false;
|
||||
}
|
||||
#ifdef DEBUG_REDIR
|
||||
printf_dbgf("(): overlay = %#010lx\n", ps->overlay);
|
||||
#endif
|
||||
|
@ -4842,7 +4842,6 @@ session_init(session_t *ps_old, int argc, char **argv) {
|
|||
.fork_after_register = false,
|
||||
.synchronize = false,
|
||||
.detect_rounded_corners = false,
|
||||
.paint_on_overlay = false,
|
||||
.resize_damage = 0,
|
||||
.unredir_if_possible = false,
|
||||
.unredir_if_possible_blacklist = NULL,
|
||||
|
@ -5160,7 +5159,6 @@ session_init(session_t *ps_old, int argc, char **argv) {
|
|||
|
||||
// Overlay must be initialized before double buffer, and before creation
|
||||
// of OpenGL context.
|
||||
if (ps->o.paint_on_overlay)
|
||||
init_overlay(ps);
|
||||
|
||||
// Initialize OpenGL as early as possible
|
||||
|
@ -5217,7 +5215,7 @@ session_init(session_t *ps_old, int argc, char **argv) {
|
|||
|
||||
ps->root_picture = x_create_picture_with_visual_and_pixmap(ps,
|
||||
ps->vis, ps->root, XCB_RENDER_CP_SUBWINDOW_MODE, &pa);
|
||||
if (ps->o.paint_on_overlay) {
|
||||
if (ps->overlay != XCB_NONE) {
|
||||
ps->tgt_picture = x_create_picture_with_visual_and_pixmap(ps,
|
||||
ps->vis, ps->overlay, XCB_RENDER_CP_SUBWINDOW_MODE, &pa);
|
||||
} else
|
||||
|
|
|
@ -297,8 +297,6 @@ parse_config(session_t *ps, struct options_tmp *pcfgtmp) {
|
|||
exit(1);
|
||||
// --alpha-step
|
||||
config_lookup_float(&cfg, "alpha-step", &ps->o.alpha_step);
|
||||
// --paint-on-overlay
|
||||
lcfg_lookup_bool(&cfg, "paint-on-overlay", &ps->o.paint_on_overlay);
|
||||
// --sw-opti
|
||||
lcfg_lookup_bool(&cfg, "sw-opti", &ps->o.sw_opti);
|
||||
// --use-ewmh-active-win
|
||||
|
@ -359,6 +357,9 @@ parse_config(session_t *ps, struct options_tmp *pcfgtmp) {
|
|||
if (lcfg_lookup_bool(&cfg, "clear-shadow", &bval))
|
||||
printf_errf("(): \"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))
|
||||
printf_errf("(): \"paint-on-overlay\" has been removed as an option, and "
|
||||
"is enabled whenever possible");
|
||||
|
||||
const char *deprecation_message = "has been removed. If you encounter problems "
|
||||
"without this feature, please feel free to open a bug report.";
|
||||
|
|
|
@ -885,7 +885,7 @@ cdbus_process_opts_get(session_t *ps, DBusMessage *msg) {
|
|||
cdbus_m_opts_get_do(mark_ovredir_focused, cdbus_reply_bool);
|
||||
cdbus_m_opts_get_do(fork_after_register, cdbus_reply_bool);
|
||||
cdbus_m_opts_get_do(detect_rounded_corners, cdbus_reply_bool);
|
||||
cdbus_m_opts_get_do(paint_on_overlay, cdbus_reply_bool);
|
||||
cdbus_m_opts_get_stub(paint_on_overlay, cdbus_reply_bool, ps->overlay != XCB_NONE);
|
||||
// paint_on_overlay_id: Get ID of the X composite overlay window
|
||||
if (!strcmp("paint_on_overlay_id", target)) {
|
||||
cdbus_reply_uint32(ps, msg, ps->overlay);
|
||||
|
|
Loading…
Reference in New Issue