[dev] [st] [PATCH] Remove expose() to prevent unresponsiveness

From: S. Gilles <sgilles_AT_math.umd.edu>
Date: Thu, 22 Jun 2017 19:36:03 -0400

---
Doc, it hurts when I do this:
 - have a huge st (say, 100 x 200 rows x cols?)
 - take a floating window and gently wave it over st for a second
   or two, generating lots of Expose events
 - switch to st and try to type
 - wait for 20+ seconds for all the damn redraw()s to finish
 - see typing finally show up
The first thing I tried was to delete expose() from x.c, which has
been working perfectly for the past hour or so: st is responsive
and I haven't seen any visual issues.
Since it seems to work for my specific setup, I'm proposing this
patch, but I'm sort of expecting/hoping that somebody who knows
more than I do (so anything at all) about X11/xcb will explain why
handling Expose events is actually needed. In that case, I'll try
something more complicated to limit an Expose cascade to a single
expose().
Thanks,
S. Gilles
 x.c | 8 --------
 1 file changed, 8 deletions(-)
diff --git a/x.c b/x.c
index fbfd350..434217b 100644
--- a/x.c
+++ b/x.c
_AT_@ -90,7 +90,6 @@ static int xgeommasktogravity(int);
 static int xloadfont(Font *, FcPattern *);
 static void xunloadfont(Font *);
 
-static void expose(XEvent *);
 static void visibility(XEvent *);
 static void unmap(XEvent *);
 static void kpress(XEvent *);
_AT_@ -115,7 +114,6 @@ static void (*handler[LASTEvent])(XEvent *) = {
 	[ConfigureNotify] = resize,
 	[VisibilityNotify] = visibility,
 	[UnmapNotify] = unmap,
-	[Expose] = expose,
 	[FocusIn] = focus,
 	[FocusOut] = focus,
 	[MotionNotify] = bmotion,
_AT_@ -1440,12 +1438,6 @@ drawregion(int x1, int y1, int x2, int y2)
 }
 
 void
-expose(XEvent *ev)
-{
-	redraw();
-}
-
-void
 visibility(XEvent *ev)
 {
 	XVisibilityEvent *e = &ev->xvisibility;
-- 
2.13.1
Received on Fri Jun 23 2017 - 01:36:03 CEST

This archive was generated by hypermail 2.3.0 : Fri Jun 23 2017 - 01:48:14 CEST