X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fxmatrix.c;h=85ed51e72cf5f438c9e4ec24a05a3e0820cbb967;hb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;hp=ba467049c5ba3f61b8a5428a5268deb73cdb6271;hpb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;p=xscreensaver diff --git a/hacks/xmatrix.c b/hacks/xmatrix.c index ba467049..85ed51e7 100644 --- a/hacks/xmatrix.c +++ b/hacks/xmatrix.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1999-2012 Jamie Zawinski +/* xscreensaver, Copyright (c) 1999-2014 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -335,11 +335,13 @@ fill_input (m_state *s) if (!s->tc) return; - if (loadBytes > 0){ - char c = textclient_getc (s->tc); - n = (c > 0 ? 1 : -1); - s->buf [s->buf_pos] = c; - } + if (loadBytes > 0) + { + int c = textclient_getc (s->tc); + n = (c > 0 ? 1 : -1); + s->buf [s->buf_pos] = (char) c; + } + if (n > 0) { s->do_fill_buff = False; @@ -1341,7 +1343,7 @@ hack_text (m_state *state) AGAIN: c = ((unsigned char *) state->typing)[0]; - c1 = ((unsigned char *) state->typing)[1]; + c1 = c ? ((unsigned char *) state->typing)[1] : 0; state->typing_delay = (!c || c1 == '\n' ? state->typing_line_delay @@ -1709,7 +1711,8 @@ xmatrix_reshape (Display *dpy, Window window, void *closure, state->xgwa.width, state->xgwa.height, state->grid_width - 2, - state->grid_height - 1); + state->grid_height - 1, + 0); } static Bool @@ -1779,10 +1782,16 @@ xmatrix_event (Display *dpy, Window window, void *closure, XEvent *event) return True; default: - return False; + break; } } + if (screenhack_event_helper (dpy, window, event)) + { + set_mode (state, DRAIN_MATRIX); + return True; + } + return False; } @@ -1816,7 +1825,7 @@ static const char *xmatrix_defaults [] = { "*usePipe: False", "*usePty: False", "*program: xscreensaver-text", - "*geometry: 800x600", + "*geometry: 960x720", 0 };