- {
- static int screen_tick = 0;
- mi->num_screens = 10;
- mi->screen_number = screen_tick++;
- if (screen_tick >= mi->num_screens)
- mi->num_screens += 10;
- }
-
+ mi->num_screens = ScreenCount (dpy);
+ mi->screen_number = XScreenNumberOfScreen (mi->xgwa.screen);
+# else
+ /* No, that doesn't work.
+ The xlockmore docs/HACKERS.GUIDE says that xlock modes are supposed to
+ support repeated calls to init_*() for the same screen in the same
+ session, but in practice, a number of them blow up if you do that.
+ So instead we're stuck with a world where on OSX/iOS, we have to
+ increment the screen number every time the hack is run. Arrgh.
+ */
+ mi->num_screens = 40;
+ mi->screen_number = xlmft->screen_count;
+ if (mi->screen_number >= mi->num_screens) abort();
+ xlmft->screen_count++;
+# endif