commit - e6f4b2e311cd461dd2d8380ba21ab113e5c8c072
commit + 59d7d92ee7a1de3387cedb079b1bfcfc75d34b8b
blob - 9a23547ae78d282eae03c4345e45215ba99dbf50
blob + 1361b42e285ef00cdbd0e28a62b1588e70616511
--- src/libdraw/x11-event.c
+++ src/libdraw/x11-event.c
return eread(~0UL, e);
}
+static void
+eflush(void)
+{
+ /* avoid generating a message if there's nothing to show. */
+ /* this test isn't perfect, though; could do flushimage(display, 0) then call extract */
+ /* also: make sure we don't interfere if we're multiprocessing the display */
+ if(display->locking){
+ /* if locking is being done by program, this means it can't depend on automatic flush in emouse() etc. */
+ if(canqlock(&display->qlock)){
+ if(display->bufp > display->buf)
+ flushimage(display, 1);
+ unlockdisplay(display);
+ }
+ }else
+ if(display->bufp > display->buf)
+ flushimage(display, 1);
+}
+
ulong
eread(ulong keys, Event *e)
{
xmask = ExposureMask;
+ eflush();
+
if(keys&Emouse)
xmask |= MouseMask|StructureNotifyMask;
if(keys&Ekeyboard)
XEvent xe;
Mouse m;
+ eflush();
again:
if(XCheckWindowEvent(_x.display, _x.drawable, MouseMask, &xe)){
if(xtoplan9mouse(&xe, &m) < 0)
{
XEvent xe;
+ eflush();
again:
if(XCheckWindowEvent(_x.display, _x.drawable, KeyPressMask, &xe)){
if(xtoplan9kbd(&xe) == -1)
xmoveto(p);
}
+void
+esetcursor(Cursor *c)
+{
+ xsetcursor(c);
+}
+