X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fmaze.c;h=40edf41b58bf9e8dfdc310585680c9b963d037a2;hb=f65151994eba80ecabcdac6eef6fa0dde7e2d45b;hp=2593f235dad23be6df40b8f27a368a6dc5cfe9f3;hpb=481b95e2617b69e6fd4444432747d7e1e0c3dc85;p=xscreensaver diff --git a/hacks/maze.c b/hacks/maze.c index 2593f235..40edf41b 100644 --- a/hacks/maze.c +++ b/hacks/maze.c @@ -35,7 +35,7 @@ * Added bridge option. * modified: [ 8-11-95 ] Ed James * added fill of dead-end box to solve_maze while loop. - * modified: [ 3-7-93 ] Jamie Zawinski + * modified: [ 3-7-93 ] Jamie Zawinski * added the XRoger logo, cleaned up resources, made * grid size a parameter. * modified: [ 3-3-93 ] Jim Randell @@ -201,6 +201,9 @@ check_events (void) /* X event handler [ rhess ] */ case Expose: restart = 1; break; + default: + screenhack_handle_event(dpy, &e); + break; } return(1); } @@ -1367,13 +1370,13 @@ find_dead_regions(void) } } } - XSync(dpy, 0); + XSync(dpy, False); } static void solve_maze (void) /* solve it with graphical feedback */ { - int i, dir, from, x, y, ways, bt; + int i, dir, from, x, y, ways, bt = 0; /* plug up the surrounding wall */ maze[end_x][end_y] |= (WALL_TOP >> end_dir); @@ -1533,7 +1536,7 @@ enter_square (int n) /* move into a neighboring square */ /* - * jmr additions for Jamie Zawinski's screensaver stuff, + * jmr additions for Jamie Zawinski's screensaver stuff, * note that the code above this has probably been hacked about in some * arbitrary way. */ @@ -1612,7 +1615,13 @@ screenhack(Display *display, Window window) set_maze_sizes (xgwa.width, xgwa.height); if (! root) - XSelectInput (dpy, win, ExposureMask|ButtonPressMask|StructureNotifyMask); + { + XWindowAttributes xgwa; + XGetWindowAttributes (dpy, window, &xgwa); + XSelectInput (dpy, win, + xgwa.your_event_mask | ExposureMask | + ButtonPressMask |StructureNotifyMask); + } gc = XCreateGC(dpy, win, 0, 0); cgc = XCreateGC(dpy, win, 0, 0);