From 32c413ab80fc78d8a46318d6ad82ec67f81775bd Mon Sep 17 00:00:00 2001 From: actionless Date: Mon, 1 May 2023 00:15:59 +0200 Subject: [PATCH 1/2] fix(x: xdrawglyphfontspecs): fix bg of reversed text --- x.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/x.c b/x.c index 95df522..4f0f980 100644 --- a/x.c +++ b/x.c @@ -2060,8 +2060,16 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i } if (base.mode & ATTR_REVERSE) { - bg = &dc.col[defaultbg_reverse]; - fg = &dc.col[defaultfg_reverse]; + /*bg = &dc.col[defaultbg_reverse];*/ + /*fg = &dc.col[defaultfg_reverse];*/ + if (bg == fg) { + bg = &dc.col[defaultfg_reverse]; + fg = &dc.col[defaultbg_reverse]; + } else { + temp = fg; + fg = bg; + bg = temp; + } } if (base.mode & ATTR_BLINK && win.mode & MODE_BLINK) From 4436957b72b924adff95254bca27cea5db825c79 Mon Sep 17 00:00:00 2001 From: actionless Date: Mon, 1 May 2023 00:16:36 +0200 Subject: [PATCH 2/2] fixup! fix(x: xdrawglyphfontspecs): fix bg of reversed text --- x.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/x.c b/x.c index 4f0f980..798880e 100644 --- a/x.c +++ b/x.c @@ -2060,8 +2060,6 @@ xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, i } if (base.mode & ATTR_REVERSE) { - /*bg = &dc.col[defaultbg_reverse];*/ - /*fg = &dc.col[defaultfg_reverse];*/ if (bg == fg) { bg = &dc.col[defaultfg_reverse]; fg = &dc.col[defaultbg_reverse];