X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fxlockmore.c;h=d5b71f9bb4f956b595cd1daf50b3a6d324117bd4;hp=c90be11f87f3f7c39fbc0eff9ccd8fe384756598;hb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;hpb=dba664f31aa87285db4d76cf8c5e66335299703a diff --git a/hacks/xlockmore.c b/hacks/xlockmore.c index c90be11f..d5b71f9b 100644 --- a/hacks/xlockmore.c +++ b/hacks/xlockmore.c @@ -294,12 +294,26 @@ xlockmore_init (Display *dpy, Window window, #ifdef HAVE_COCOA +# if 0 /* In Cocoa-based xscreensaver, all hacks run in the same address space, so each one needs to get its own screen number. Believe what jwxyz says about screen counts and numbers. */ 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 root_p = True; #else /* !HAVE_COCOA -- real Xlib */