summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/splash.c
diff options
context:
space:
mode:
authoronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-10-01 13:18:03 +0000
committeronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-10-01 13:18:03 +0000
commit1091a3a5a9153efcc92630fb8edac260553f3cad (patch)
treeb945663c0719461c727bf755cb8af5a57bdcaa64 /beryl-plugins/src/splash.c
parenta46c5669a1af5b7ab367c4245c934d778e5d51a6 (diff)
downloadmarex-dev-1091a3a5a9153efcc92630fb8edac260553f3cad.tar.gz
marex-dev-1091a3a5a9153efcc92630fb8edac260553f3cad.tar.bz2
try to load default images on fail
git-svn-id: file:///beryl/trunk@422 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/splash.c')
-rw-r--r--beryl-plugins/src/splash.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/beryl-plugins/src/splash.c b/beryl-plugins/src/splash.c
index c8d550c..a7ce507 100644
--- a/beryl-plugins/src/splash.c
+++ b/beryl-plugins/src/splash.c
@@ -161,11 +161,12 @@ splashPreparePaintScreen (CompScreen * s, int ms)
}
}
- if (ss->initiate) {
+ if (ss->initiate)
+ {
ss->fade_in = ss->fade_out =
- sd->opt[SPLASH_DISPLAY_OPTION_FADE_TIME].value.f * 1000.0;
+ sd->opt[SPLASH_DISPLAY_OPTION_FADE_TIME].value.f * 1000.0;
ss->time =
- sd->opt[SPLASH_DISPLAY_OPTION_DISPLAY_TIME].value.f * 1000.0;
+ sd->opt[SPLASH_DISPLAY_OPTION_DISPLAY_TIME].value.f * 1000.0;
ss->initiate = FALSE;
}
@@ -189,6 +190,33 @@ splashPreparePaintScreen (CompScreen * s, int ms)
sd->opt[SPLASH_DISPLAY_OPTION_LOGO].value.
s, &ss->logoSize[0], &ss->logoSize[1]);
if (!ss->hasBack)
+ {
+ ss->hasBack =
+ readImageToTexture (s, &ss->back_img,
+ SPLASH_DISPLAY_OPTION_BACKGROUND_DEFAULT,
+ &ss->backSize[0], &ss->backSize[1]);
+ if (ss->hasBack)
+ {
+ fprintf (stderr,
+ "[SPLASH]: Could not load splash background image \"%s\" using default!\n",
+ sd->opt[SPLASH_DISPLAY_OPTION_BACKGROUND].value.
+ s);
+ }
+ }
+ if (!ss->hasLogo)
+ {
+ ss->hasLogo =
+ readImageToTexture (s, &ss->logo_img,
+ SPLASH_DISPLAY_OPTION_LOGO_DEFAULT,
+ &ss->logoSize[0], &ss->logoSize[1]);
+ if (ss->hasLogo)
+ {
+ fprintf (stderr,
+ "[SPLASH]: Could not load splash logo image \"%s\" using default!\n",
+ sd->opt[SPLASH_DISPLAY_OPTION_LOGO].value.s);
+ }
+ }
+ if (!ss->hasBack)
fprintf (stderr,
"[SPLASH]: Could not load splash background image \"%s\" !\n",
sd->opt[SPLASH_DISPLAY_OPTION_BACKGROUND].value.s);
@@ -628,8 +656,7 @@ splashDisplayInitOptions (SplashDisplay * sd)
o->value.action.state = CompActionStateInitKey;
o->value.action.key.modifiers = SPLASH_DISPLAY_OPTION_INITIATE_MOD;
o->value.action.key.keysym =
- XStringToKeysym
- (SPLASH_DISPLAY_OPTION_INITIATE_KEY);
+ XStringToKeysym (SPLASH_DISPLAY_OPTION_INITIATE_KEY);
o = &sd->opt[SPLASH_DISPLAY_OPTION_BACKGROUND];
o->name = "background_file";