X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=driver%2Fwindows.c;h=9dbb5004cfbe5428dabe4486803e038d64c49629;hp=e6ca0bf53cae9ae0c6668c596e288e97107834dd;hb=6b1c86cf395f59389e4ece4ea8f4bea2c332745b;hpb=0d6b320def9180cf907ceaed56b23a972a11b757 diff --git a/driver/windows.c b/driver/windows.c index e6ca0bf5..9dbb5004 100644 --- a/driver/windows.c +++ b/driver/windows.c @@ -1,5 +1,5 @@ /* windows.c --- turning the screen black; dealing with visuals, virtual roots. - * xscreensaver, Copyright (c) 1991-2004 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2008 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -1044,12 +1044,14 @@ get_screen_viewport (saver_screen_info *ssi, { target_x = ssi->x; target_y = ssi->y; + which = ssi->number; } /* Find the Xinerama rectangle that contains the mouse position. */ for (i = 0; i < si->nscreens; i++) { - if (target_x >= si->screens[i].x && + if (which == -1 && + target_x >= si->screens[i].x && target_y >= si->screens[i].y && target_x < si->screens[i].x + si->screens[i].width && target_y < si->screens[i].y + si->screens[i].height) @@ -1419,7 +1421,12 @@ initialize_screensaver_window_1 (saver_screen_info *ssi) attrs.backing_pixel = ssi->black_pixel; attrs.border_pixel = ssi->black_pixel; - if (p->debug_p && !p->quad_p) width = width / 2; + if (p->debug_p +# ifdef QUAD_MODE + && !p->quad_p +# endif + ) + width = width / 2; if (!p->verbose_p || printed_visual_info) ; @@ -1597,9 +1604,21 @@ resize_screensaver_window (saver_info *si) */ int nscreens; XineramaScreenInfo *xsi = XineramaQueryScreens (si->dpy, &nscreens); - if (nscreens != si->nscreens) abort(); + + if (nscreens != si->nscreens) { + /* Apparently some Xinerama implementations let you use a hot-key + to change the number of screens in use! This is, of course, + documented nowhere. Let's try to do something marginally less + bad than crashing. + */ + fprintf (stderr, "%s: bad craziness: xinerama screen count changed " + "from %d to %d!\n", blurb(), si->nscreens, nscreens); + if (nscreens > si->nscreens) + nscreens = si->nscreens; + } + if (!xsi) abort(); - for (i = 0; i < si->nscreens; i++) + for (i = 0; i < nscreens; i++) { saver_screen_info *ssi = &si->screens[i]; if (p->verbose_p && @@ -1677,7 +1696,12 @@ resize_screensaver_window (saver_info *si) changes.height = height; changes.border_width = 0; - if (p->debug_p && !p->quad_p) changes.width = changes.width / 2; + if (p->debug_p +# ifdef QUAD_MODE + && !p->quad_p +# endif + ) + changes.width = changes.width / 2; if (p->verbose_p) fprintf (stderr,