summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2019-10-11 19:43:02 +0200
committerbakkeby <[email protected]>2019-10-11 19:43:02 +0200
commit251b933b19fe8cd66a9d91082a61ef6c0fd4d3c7 (patch)
treee392d28f4ae65d4674d4e8cd6f08bdd4b9b138b8
parent063fe260893492e81fa983a33f0716a2f1dce5e6 (diff)
downloaddwm-flexipatch-251b933b19fe8cd66a9d91082a61ef6c0fd4d3c7.tar.gz
dwm-flexipatch-251b933b19fe8cd66a9d91082a61ef6c0fd4d3c7.zip
Adding interim patch to ignore xft errors when drawing text on the status bar
-rw-r--r--README.md6
-rw-r--r--dwm.c7
-rw-r--r--patches.h7
3 files changed, 20 insertions, 0 deletions
diff --git a/README.md b/README.md
index 63fe026..1031a21 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,8 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
### Changelog:
+2019-10-11 - Added the patch to ignore Xft errors when drawing text in the status bar
+
2019-10-10 - Added mdpcontrol, scratchpad and spawn_cwd cpatches
2019-10-08 - Added columns layout and fakefullscreen patch
@@ -150,6 +152,10 @@ Refer to [https://dwm.suckless.org/](https://dwm.suckless.org/) for details on t
- with this patch dwm's built-in status bar is only shown when HOLDKEY is pressed
- additionally the bar will now overlay the display
+ - [ignore-xft-errors-when-drawing-text](https://groups.google.com/forum/m/#!topic/wmii/7bncCahYIww)
+ - sometimes dwm crashes when it cannot render some glyphs in window titles (usually emoji)
+ - this patch is essentially a hack to ignore any errors when drawing text on the status bar and may be removed if a more appropriate solution comes up
+
- [leftlayout](http://dwm.suckless.org/patches/leftlayout/)
- moves the layout symbol in the status bar to the left hand side
diff --git a/dwm.c b/dwm.c
index 1b9bbf5..336d3c3 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1476,12 +1476,19 @@ drawbar(Monitor *m)
#else
drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
#endif // TITLECOLOR_PATCH
+ #if IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
+ XSetErrorHandler(xerrordummy);
+ #endif // IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
#if CENTEREDWINDOWNAME_PATCH
int mid = (m->ww - TEXTW(m->sel->name)) / 2 - x;
drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0);
#else
drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
#endif // CENTEREDWINDOWNAME_PATCH
+ #if IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
+ XSync(dpy, False);
+ XSetErrorHandler(xerror);
+ #endif // IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
if (m->sel->isfloating)
#if ACTIVETAGINDICATORBAR_PATCH
drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw, m->sel->isfixed, 0);
diff --git a/patches.h b/patches.h
index a87e293..81f37ef 100644
--- a/patches.h
+++ b/patches.h
@@ -199,6 +199,13 @@
*/
#define HOLDBAR_PATCH 0
+/* Sometimes dwm crashes when it cannot render some glyphs in window titles (usually emoji).
+ * This patch is essentially a hack to ignore any errors when drawing text on the status bar.
+ * https://groups.google.com/forum/m/#!topic/wmii/7bncCahYIww
+ * https://docs.google.com/viewer?a=v&pid=forums&srcid=MDAwODA2MTg0MDQyMjE0OTgzMzMBMDQ3ODQzODkyMTU3NTAyMTMxNTYBX2RUMVNtOUtDQUFKATAuMQEBdjI&authuser=0
+ */
+#define IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH 0
+
/* This patch adds a keybinding to kills all visible clients that are not selected.
* https://dwm.suckless.org/patches/killunsel/
*/