- if (! (mi->xlmft->got_init & (1 << mi->screen_number))) {
- mi->xlmft->got_init |= 1 << mi->screen_number;
- XClearWindow (mi->dpy, mi->window);
- mi->xlmft->hack_init (mi);
+ mi->xlmft->got_init |= 1 << mi->screen_number;
+ XClearWindow (mi->dpy, mi->window);
+ mi->xlmft->hack_init (mi);
+}
+
+
+static Bool
+xlockmore_got_init (ModeInfo *mi)
+{
+ return mi->xlmft->got_init & (1 << mi->screen_number);
+}
+
+
+static void
+xlockmore_abort_erase (ModeInfo *mi)
+{
+ if (mi->eraser) {
+ eraser_free (mi->eraser);
+ mi->eraser = NULL;
+ }
+ mi->needs_clear = False;
+}
+
+
+static void
+xlockmore_check_init (ModeInfo *mi)
+{
+ if (! xlockmore_got_init (mi)) {
+ xlockmore_abort_erase (mi);
+ xlockmore_do_init (mi);