X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Fsplash.c;h=491ebe80c2f1b355e2f83407750225953087c2ef;hb=de460e831dc8578acfa8b72251ab9346c99c1f96;hp=ead36d7c1c38179eefc5377dc62650bf65b79fb3;hpb=c494fd2e6b3b25582375d62e40f4f5cc984ca424;p=xscreensaver diff --git a/driver/splash.c b/driver/splash.c index ead36d7c..491ebe80 100644 --- a/driver/splash.c +++ b/driver/splash.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1991-2006 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 @@ -170,6 +170,10 @@ make_splash_dialog (saver_info *si) return; ssi = &si->screens[mouse_screen (si)]; + + if (!ssi || !ssi->screen) + return; /* WTF? Trying to splash while no screens connected? */ + cmap = DefaultColormapOfScreen (ssi->screen); sp = (splash_dialog_data *) calloc (1, sizeof(*sp)); @@ -376,7 +380,7 @@ make_splash_dialog (saver_info *si) attrs.event_mask = (ExposureMask | ButtonPressMask | ButtonReleaseMask); { - int sx, sy, w, h; + int sx = 0, sy = 0, w, h; int mouse_x = 0, mouse_y = 0; { @@ -393,7 +397,10 @@ make_splash_dialog (saver_info *si) } } - get_screen_viewport (ssi, &sx, &sy, &w, &h, mouse_x, mouse_y, False); + x = ssi->x; + y = ssi->y; + w = ssi->width; + h = ssi->height; if (si->prefs.debug_p) w /= 2; x = sx + (((w + sp->width) / 2) - sp->width); y = sy + (((h + sp->height) / 2) - sp->height); @@ -414,7 +421,9 @@ make_splash_dialog (saver_info *si) attrmask, &attrs); XSetWindowBackground (si->dpy, si->splash_dialog, sp->background); - sp->logo_pixmap = xscreensaver_logo (ssi->screen, ssi->current_visual, + sp->logo_pixmap = xscreensaver_logo (ssi->screen, + /* same visual as si->splash_dialog */ + DefaultVisualOfScreen (ssi->screen), si->splash_dialog, cmap, sp->background, &sp->logo_pixels, &sp->logo_npixels,