From: Daniel Hahler <[email protected]>
With OFF_FOCUS_FADING and a visual bell we have to swap the colors in
pix_colors_focused/pix_colors_unfocused.
TEST CASE:
- set VISUAL_BELL_DURATION to 1 for better reproducibility
- run `urxvt &!; printf '\007'`
RESULT:
Before spawning the new window, the current one flickers shortly, and
the new window will stay in reverse video mode.
This will call scr_rvideo_mode before the new window is spawned and
reverses the fg/bg for `pix_colors`.
With the following focus_out handling `pix_colors` gets set to
`pix_colors_unfocused`, and when `bell_cb` is invoked, it will
reverse the colors for `pix_colors_unfocused` - but not the original
`pix_colors`.
The reverse video state will still be kept after the `focus_in` handler
though.. this might be due to the `pix_colors = pix_colors_focused` in
`rxvt_term::get_colors`?!
This patch fixes this by applying the swapping to `pix_colors_focused`
and `pix_colors_unfocused` instead, if `OFF_FOCUS_FADING` is defined
and `rs[Rs_fade]` is in use.
---
src/screen.C | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/screen.C b/src/screen.C
index 115afbf2..f3c6d576 100644
--- a/src/screen.C
+++ b/src/screen.C
@@ -1716,6 +1716,14 @@ rxvt_term::scr_rvideo_mode (bool on) NOTHROW
{
rvideo_state = on;
+#if OFF_FOCUS_FADING
+ if (rs[Rs_fade])
+ {
+ ::swap (pix_colors_focused[Color_fg], pix_colors_focused[Color_bg]);
+ ::swap (pix_colors_unfocused[Color_fg],
pix_colors_unfocused[Color_bg]);
+ }
+ else
+#endif
::swap (pix_colors[Color_fg], pix_colors[Color_bg]);
#ifdef HAVE_IMG
if (bg_img == 0)
--
2.11.0
_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/mailman/listinfo/rxvt-unicode