diff options
author | Richard Grenville <pyxlcy@gmail.com> | 2013-07-30 22:24:11 +0800 |
---|---|---|
committer | Richard Grenville <pyxlcy@gmail.com> | 2013-07-30 22:24:11 +0800 |
commit | 8f6c2d89ea6883d5cee95cfeb83618c5c11cbf12 (patch) | |
tree | 07824143cff1f36fe618a6d949e956ea67cdb487 | |
parent | 4f92672534b2ebb83616de98b40fb79761c0c2ac (diff) | |
download | tdebase-8f6c2d89ea6883d5cee95cfeb83618c5c11cbf12.tar.gz tdebase-8f6c2d89ea6883d5cee95cfeb83618c5c11cbf12.zip |
Misc: stoppaint_force & Documentation update
- Add stoppaint_force option, controlled via D-Bus, to stop painting
completely, which may look better than unredirecting the screen,
sometimes. (#41)
- Add x2, y2 matching targets.
- Update documentation.
-rw-r--r-- | c2.c | 2 | ||||
-rw-r--r-- | c2.h | 4 | ||||
-rw-r--r-- | common.h | 2 | ||||
-rw-r--r-- | compton.c | 37 | ||||
-rw-r--r-- | dbus.c | 4 |
5 files changed, 40 insertions, 9 deletions
@@ -1045,6 +1045,8 @@ c2_match_once_leaf(session_t *ps, win *w, const c2_l_t *pleaf, case C2_L_PID: tgt = wid; break; case C2_L_PX: tgt = w->a.x; break; case C2_L_PY: tgt = w->a.y; break; + case C2_L_PX2: tgt = w->a.x + w->widthb; break; + case C2_L_PY2: tgt = w->a.y + w->heightb; break; case C2_L_PWIDTH: tgt = w->a.width; break; case C2_L_PHEIGHT: tgt = w->a.height; break; case C2_L_PWIDTHB: tgt = w->widthb; break; @@ -101,6 +101,8 @@ struct _c2_l { C2_L_PID, C2_L_PX, C2_L_PY, + C2_L_PX2, + C2_L_PY2, C2_L_PWIDTH, C2_L_PHEIGHT, C2_L_PWIDTHB, @@ -187,6 +189,8 @@ const static c2_predef_t C2_PREDEFS[] = { [C2_L_PID ] = { "id" , C2_L_TCARDINAL , 0 }, [C2_L_PX ] = { "x" , C2_L_TCARDINAL , 0 }, [C2_L_PY ] = { "y" , C2_L_TCARDINAL , 0 }, + [C2_L_PX2 ] = { "x2" , C2_L_TCARDINAL , 0 }, + [C2_L_PY2 ] = { "y2" , C2_L_TCARDINAL , 0 }, [C2_L_PWIDTH ] = { "width" , C2_L_TCARDINAL , 0 }, [C2_L_PHEIGHT ] = { "height" , C2_L_TCARDINAL , 0 }, [C2_L_PWIDTHB ] = { "widthb" , C2_L_TCARDINAL , 0 }, @@ -462,6 +462,8 @@ typedef struct { bool unredir_if_possible; /// Forced redirection setting through D-Bus. switch_t redirected_force; + /// Whether to stop painting. Controlled through D-Bus. + switch_t stoppaint_force; /// Whether to enable D-Bus support. bool dbus; /// Path to log file. @@ -4333,13 +4333,16 @@ usage(int ret) { " Only work on some drivers. Works only with GLX backend.\n" " Does not actually control paint timing, only buffer swap is\n" " affected, so it doesn't have the effect of --sw-opti unlike\n" - " other methods. Experimental." WARNING "\n" + " other methods." WARNING "\n" " opengl-mswc = Try to VSync with MESA_swap_control OpenGL\n" " extension. Basically the same as opengl-swc above, except the\n" " extension we use." WARNING "\n" + "--vsync-aggressive\n" + " Attempt to send painting request before VBlank and do XFlush()\n" + " during VBlank. This switch may be lifted out at any moment.\n" "--alpha-step val\n" - " Step for pregenerating alpha pictures. 0.01 - 1.0. Defaults to\n" - " 0.03.\n" + " X Render backend: Step for pregenerating alpha pictures. \n" + " 0.01 - 1.0. Defaults to 0.03.\n" "--dbe\n" " Enable DBE painting mode, intended to use with VSync to\n" " (hopefully) eliminate tearing.\n" @@ -4347,10 +4350,7 @@ usage(int ret) { " Painting on X Composite overlay window.\n" "--sw-opti\n" " Limit compton to repaint at most once every 1 / refresh_rate\n" - " second to boost performance. Experimental.\n" - "--vsync-aggressive\n" - " Attempt to send painting request before VBlank and do XFlush()\n" - " during VBlank. This switch may be lifted out at any moment.\n" + " second to boost performance.\n" "--use-ewmh-active-win\n" " Use _NET_WM_ACTIVE_WINDOW on the root window to determine which\n" " window is focused instead of using FocusIn/Out events.\n" @@ -4360,7 +4360,6 @@ usage(int ret) { "--unredir-if-possible\n" " Unredirect all windows if a full-screen opaque window is\n" " detected, to maximize performance for full-screen windows.\n" - " Experimental.\n" "--focus-exclude condition\n" " Specify a list of conditions of windows that should always be\n" " considered focused.\n" @@ -4976,6 +4975,8 @@ parse_config(session_t *ps, struct options_tmp *pcfgtmp) { config_t cfg; int ival = 0; double dval = 0.0; + // libconfig manages string memory itself, so no need to manually free + // anything const char *sval = NULL; f = open_config_file(ps->o.config_file, &path); @@ -5068,6 +5069,10 @@ parse_config(session_t *ps, struct options_tmp *pcfgtmp) { config_lookup_float(&cfg, "shadow-green", &ps->o.shadow_green); // --shadow-blue config_lookup_float(&cfg, "shadow-blue", &ps->o.shadow_blue); + // --shadow-exclude-reg + if (config_lookup_string(&cfg, "shadow-exclude-reg", &sval) + && !parse_geometry(ps, sval, &ps->o.shadow_exclude_reg_geom)) + exit(1); // --inactive-opacity-override lcfg_lookup_bool(&cfg, "inactive-opacity-override", &ps->o.inactive_opacity_override); @@ -5126,6 +5131,8 @@ parse_config(session_t *ps, struct options_tmp *pcfgtmp) { parse_cfg_condlst(ps, &cfg, &ps->o.invert_color_list, "invert-color-include"); // --blur-background-exclude parse_cfg_condlst(ps, &cfg, &ps->o.blur_background_blacklist, "blur-background-exclude"); + // --opacity-rule + parse_cfg_condlst(ps, &cfg, &ps->o.opacity_rules, "opacity-rule"); // --blur-background lcfg_lookup_bool(&cfg, "blur-background", &ps->o.blur_background); // --blur-background-frame @@ -5134,6 +5141,12 @@ parse_config(session_t *ps, struct options_tmp *pcfgtmp) { // --blur-background-fixed lcfg_lookup_bool(&cfg, "blur-background-fixed", &ps->o.blur_background_fixed); + // --blur-kern + if (config_lookup_string(&cfg, "blur-kern", &sval) + && !parse_conv_kern_lst(ps, sval, ps->o.blur_kerns, MAX_BLUR_PASS)) + exit(1); + // --resize-damage + config_lookup_int(&cfg, "resize-damage", &ps->o.resize_damage); // --glx-no-stencil lcfg_lookup_bool(&cfg, "glx-no-stencil", &ps->o.glx_no_stencil); // --glx-copy-from-front @@ -5146,6 +5159,8 @@ parse_config(session_t *ps, struct options_tmp *pcfgtmp) { if (config_lookup_string(&cfg, "glx-swap-method", &sval) && !parse_glx_swap_method(ps, sval)) exit(1); + // --glx-use-gpushader4 + lcfg_lookup_bool(&cfg, "glx-use-gpushader4", &ps->o.glx_use_gpushader4); // Wintype settings { wintype_t i; @@ -5563,6 +5578,9 @@ get_cfg(session_t *ps, int argc, char *const *argv, bool first_pass) { } rebuild_shadow_exclude_reg(ps); + + if (ps->o.resize_damage < 0) + printf_errf("(): Negative --resize-damage does not work correctly."); } /** @@ -6367,6 +6385,7 @@ session_init(session_t *ps_old, int argc, char **argv) { .resize_damage = 0, .unredir_if_possible = false, .redirected_force = UNSET, + .stoppaint_force = UNSET, .dbus = false, .benchmark = 0, .benchmark_wid = None, @@ -6995,7 +7014,7 @@ session_run(session_t *ps) { t = paint_preprocess(ps, ps->list); // If the screen is unredirected, free all_damage to stop painting - if (!ps->redirected) + if (!ps->redirected || ON == ps->o.stoppaint_force) free_region(ps, &ps->all_damage); XserverRegion all_damage_orig = None; @@ -899,6 +899,7 @@ cdbus_process_opts_get(session_t *ps, DBusMessage *msg) { cdbus_m_opts_get_do(paint_on_overlay, cdbus_reply_bool); cdbus_m_opts_get_do(unredir_if_possible, cdbus_reply_bool); cdbus_m_opts_get_do(redirected_force, cdbus_reply_enum); + cdbus_m_opts_get_do(stoppaint_force, cdbus_reply_enum); cdbus_m_opts_get_do(logpath, cdbus_reply_string); cdbus_m_opts_get_do(synchronize, cdbus_reply_bool); @@ -1081,6 +1082,9 @@ cdbus_process_opts_set(session_t *ps, DBusMessage *msg) { goto cdbus_process_opts_set_success; } + // stoppaint_force + cdbus_m_opts_set_do(stoppaint_force, CDBUS_TYPE_ENUM, cdbus_enum_t); + #undef cdbus_m_opts_set_do printf_errf("(): " CDBUS_ERROR_BADTGT_S, target); |