- }
- else if (event.xany.type == Expose)
- {
- update_display (state, False);
- }
- else if (event.xany.type == KeyPress)
+
+
+ /* If we're running xscreensaver-text, then kill and restart it any
+ time the window is resized so that it gets an updated --cols arg
+ right away. But if we're running something else, leave it alone.
+ */
+ if (!strcmp (state->program, "xscreensaver-text"))
+ {
+ if (state->pid)
+ kill (state->pid, SIGTERM);
+ if (state->pipe)
+ pclose (state->pipe);
+ state->input_available_p = False;
+ relaunch_generator_timer (state, 0);
+ }
+}
+
+
+static Bool
+phosphor_event (Display *dpy, Window window, void *closure, XEvent *event)
+{
+ p_state *state = (p_state *) closure;
+
+ if (event->xany.type == Expose)
+ update_display (state, False);
+ else if (event->xany.type == KeyPress)
+ {
+ KeySym keysym;
+ unsigned char c = 0;
+ XLookupString (&event->xkey, (char *) &c, 1, &keysym,
+ &state->compose);
+ if (c != 0 && state->pipe)