+ st->ball.x = PONG_W/2;
+ st->ball.y = PONG_H/2;
+ st->ball.w = 16;
+ st->ball.h = 8;
+
+ /* The mouse warping business breaks tablet input. */
+ if (st->l_paddle.player == PLAYER_MOUSE &&
+ st->r_paddle.player == PLAYER_TABLET)
+ {
+ st->l_paddle.player = PLAYER_TABLET;
+ }
+ if (st->r_paddle.player == PLAYER_MOUSE &&
+ st->l_paddle.player == PLAYER_TABLET)
+ {
+ st->r_paddle.player = PLAYER_TABLET;
+ }
+
+ if (st->clock) {
+ st->l_paddle.player = PLAYER_AI;
+ st->r_paddle.player = PLAYER_AI;
+ fprintf(stderr, "%s: clock mode requires AI control\n", progname);
+
+ }
+
+# ifndef HAVE_JWXYZ
+ if (st->l_paddle.player == PLAYER_MOUSE ||
+ st->r_paddle.player == PLAYER_MOUSE ||
+ st->l_paddle.player == PLAYER_TABLET ||
+ st->r_paddle.player == PLAYER_TABLET)
+ {
+ XColor black = {0, 0, 0, 0};
+ Pixmap cursor_pix = XCreatePixmap(dpy, window, 4, 4, 1);
+ XGCValues gcv;
+ GC mono_gc;
+
+ gcv.foreground = 0;
+ mono_gc = XCreateGC(dpy, cursor_pix, GCForeground, &gcv);
+ st->null_cursor = XCreatePixmapCursor(dpy, cursor_pix, cursor_pix,
+ &black, &black, 0, 0);
+ XFillRectangle(dpy, cursor_pix, mono_gc, 0, 0, 4, 4);
+ XFreeGC(dpy, mono_gc);
+
+ XSelectInput(dpy, window,
+ PointerMotionMask | FocusChangeMask |
+ KeyPressMask | KeyReleaseMask |
+ ButtonPressMask | ButtonReleaseMask);
+
+ if (needs_grab(st))
+ {
+ grab_pointer(st);
+ }
+ else
+ {
+ XDefineCursor(dpy, window, st->null_cursor);
+ }
+ }
+# endif
+
+ st->m_unit = get_integer_resource (st->dpy, "speed", "Integer");
+ st->noise = get_float_resource(st->dpy, "noise", "Float");
+ st->clock = get_boolean_resource(st->dpy, "clock", "Boolean");