aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-09-07 17:44:54 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-09-07 17:44:54 +0000
commite81d23befc7377df0c977806fade093d151ff0da (patch)
tree4b142a63ff803b392e240e17e36640ceb43d4024
parentMerge branch 'reflow-multi-column-composed-characters' into master (diff)
parentconfig: add tweak.damage-whole-window (diff)
Merge branch 'tweak-damage-everything' into master
-rw-r--r--config.c4
-rw-r--r--config.h1
-rw-r--r--doc/foot.ini.5.scd19
-rw-r--r--render.c5
4 files changed, 27 insertions, 2 deletions
diff --git a/config.c b/config.c
index 000538f8..f15be1c2 100644
--- a/config.c
+++ b/config.c
@@ -1361,6 +1361,9 @@ parse_section_tweak(
if (strcmp(key, "allow-overflowing-double-width-glyphs") == 0)
conf->tweak.allow_overflowing_double_width_glyphs = str_to_bool(value);
+ else if (strcmp(key, "damage-whole-window") == 0)
+ conf->tweak.damage_whole_window = str_to_bool(value);
+
else if (strcmp(key, "render-timer") == 0) {
if (strcmp(value, "none") == 0) {
conf->tweak.render_timer_osd = false;
@@ -1801,6 +1804,7 @@ config_load(struct config *conf, const char *conf_path, bool errors_are_fatal)
.max_shm_pool_size = 512 * 1024 * 1024,
.render_timer_osd = false,
.render_timer_log = false,
+ .damage_whole_window = false,
},
.notifications = tll_init(),
diff --git a/config.h b/config.h
index 2368e53c..bffb4776 100644
--- a/config.h
+++ b/config.h
@@ -147,6 +147,7 @@ struct config {
bool allow_overflowing_double_width_glyphs;
bool render_timer_osd;
bool render_timer_log;
+ bool damage_whole_window;
uint64_t delayed_render_lower_ns;
uint64_t delayed_render_upper_ns;
off_t max_shm_pool_size;
diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd
index 06f6f46c..81e3f945 100644
--- a/doc/foot.ini.5.scd
+++ b/doc/foot.ini.5.scd
@@ -441,8 +441,8 @@ When reporting bugs, please mention if, and to what, you have changed
any of these options.
*allow-overflowing-double-width-glyphs*
- When enabled, double width glyphs with a character width of 1 are
- allowed to overflow into the neighbouring cell.
+ Boolean. when enabled, double width glyphs with a character width
+ of 1 are allowed to overflow into the neighbouring cell.
One use case for this is fonts "icon" characters in the Unicode
private usage area, e.g. Nerd Fonts, or Powerline Fonts. Without
@@ -528,6 +528,21 @@ any of these options.
Default: lower=_500000_ (0.5ms), upper=_8333333_ (8.3ms - half a
frame interval).
+*damage-whole-window*
+ Boolean. When enabled, foot will 'damage' the entire window each
+ time a frame has been rendered. This forces the compositor to
+ redraw the entire window. If disabled, foot will only 'damage'
+ updated rows.
+
+ There is normally *no* reason to enable this. However, it has been
+ seen to workaround an issue with _fractional scaling_ in _Gnome_.
+
+ Note that enabling this option is likely to increase CPU and/or
+ GPU usage (by the compositor, not by foot), and may have a
+ negative impact on battery life.
+
+ Default: _false_.
+
*max-shm-pool-size-mb*
This option controls the amount of *virtual* memory used by the
pixmap memory to which the terminal screen content is rendered.
diff --git a/render.c b/render.c
index f2d976f8..288ea8da 100644
--- a/render.c
+++ b/render.c
@@ -1819,6 +1819,11 @@ grid_render(struct terminal *term, bool redraw_margins)
}
}
+ if (term->conf->tweak.damage_whole_window) {
+ wl_surface_damage_buffer(
+ term->window->surface, 0, 0, INT32_MAX, INT32_MAX);
+ }
+
wl_surface_attach(term->window->surface, buf->wl_buf, 0, 0);
quirk_kde_damage_before_attach(term->window->surface);
wl_surface_commit(term->window->surface);