From 50923426bf684402160dd7748f14560afd447b73 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 12 Jan 2020 14:53:46 -0500 Subject: devdraw: x11 working again Need to think a bit more about locking, but overall it's a working devdraw. Multiclient mode may not be working but nothing is using it yet. --- src/cmd/devdraw/devdraw.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/cmd/devdraw/devdraw.h') diff --git a/src/cmd/devdraw/devdraw.h b/src/cmd/devdraw/devdraw.h index 06ce4f8a..4980ed90 100644 --- a/src/cmd/devdraw/devdraw.h +++ b/src/cmd/devdraw/devdraw.h @@ -85,7 +85,7 @@ struct Client // Only accessed/modified by the graphics thread. const void* view; - + // eventlk protects the keyboard and mouse events. QLock eventlk; Kbdbuf kbd; @@ -204,14 +204,19 @@ void rpc_setmouse(Client*, Point); void rpc_shutdown(void); void rpc_topwin(Client*); void rpc_main(void); - -// TODO: rpc_flush is called from draw_datawrite, -// which holds c->drawlk. Is this OK? +void rpc_bouncemouse(Client*, Mouse); void rpc_flush(Client*, Rectangle); +// rpc_gfxdrawlock and rpc_gfxdrawunlock +// are called around drawing operations to lock and unlock +// access to the graphics display, for systems where the +// individual memdraw operations use the graphics display (X11, not macOS). +void rpc_gfxdrawlock(void); +void rpc_gfxdrawunlock(void); + // draw* routines are called on the RPC thread, // invoked by the RPC server to do pixel pushing. -// c->drawlk is held on entry. +// No locks are held on entry. int draw_dataread(Client*, void*, int); int draw_datawrite(Client*, void*, int); void draw_initdisplaymemimage(Client*, Memimage*); -- cgit v1.2.3