-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: hackvr action: commit revision: path_from: revision_from: 2b33983d0700e4c40969f76f29c41d082a1d5e3a: path_to: revision_to:
commit 2b33983d0700e4c40969f76f29c41d082a1d5e3a Author: epoch <epoch@thebackupbox.net> Date: Sun Apr 7 16:48:34 2024 -0500 added an XFlush to flipscreen because it would not actually update the window. added commented notes about event types. ignore the NoExpose event now. diff --git a/src/graphics_cs_x11.c b/src/graphics_cs_x11.c
--- a/src/graphics_cs_x11.c +++ b/src/graphics_cs_x11.c @@ -231,6 +231,7 @@ void set_color_blue() { void flipscreen() { XCopyArea(x11_global.dpy,x11_global.backbuffer,x11_global.w,x11_global.gc,0,0,gra_global.width,gra_global.height,0,0); + XFlush(x11_global.dpy); } void set_aspect_ratio() { @@ -529,6 +530,45 @@ int graphics_sub_init() { return x11_global.fd;//we're fine } +/* stolen from https://stackoverflow.com/questions/35745561/how-can-i-convert-an-xevent-to-a-string +const char *type[37] = {0}; +type[2] = "KeyPress"; +type[3] = "KeyRelease"; +type[4] = "ButtonPress"; +type[5] = "ButtonRelease"; +type[6] = "MotionNotify"; +type[7] = "EnterNotify"; +type[8] = "LeaveNotify"; +type[9] = "FocusIn"; +type[10] = "FocusOut"; +type[11] = "KeymapNotify"; +type[12] = "Expose"; +type[13] = "GraphicsExpose"; +type[14] = "NoExpose"; +type[15] = "VisibilityNotify"; +type[16] = "CreateNotify"; +type[17] = "DestroyNotify"; +type[18] = "UnmapNotify"; +type[19] = "MapNotify"; +type[20] = "MapRequest"; +type[21] = "ReparentNotify"; +type[22] = "ConfigureNotify"; +type[23] = "ConfigureRequest"; +type[24] = "GravityNotify"; +type[25] = "ResizeRequest"; +type[26] = "CirculateNotify"; +type[27] = "CirculateRequest"; +type[28] = "PropertyNotify"; +type[29] = "SelectionClear"; +type[30] = "SelectionRequest"; +type[31] = "SelectionNotify"; +type[32] = "ColormapNotify"; +type[33] = "ClientMessage"; +type[34] = "MappingNotify"; +type[35] = "GenericEvent"; +type[36] = "LASTEvent"; +*/ + void graphics_event_handler(struct shit *me,char *line) {//line should always be empty int redrawplzkthx=0; Window root;//just used to sponge up a return value @@ -540,8 +580,14 @@ void graphics_event_handler(struct shit *me,char *line) {//line should always be } while(XCheckMaskEvent(x11_global.dpy,HV_GRAPHICS_X11_EVENT_MASK,&e)) {//we should squish all of the window events. they just cause a redraw anyway switch(e.type) { - case Expose: case NoExpose: case MapNotify: case FocusIn: case FocusOut: case VisibilityNotify: + case NoExpose: break; // wtf is NoExpose anyway? let's not redraw for it. + case Expose: + case MapNotify: + case FocusIn: + case FocusOut: + case VisibilityNotify: //if(e.xexpose.count == 0) redraw=1; + fprintf(stderr,"# got a window event (%d) redrawing I guess.\n",e.type); redrawplzkthx=1; break;
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 17:04:09 2024