From 3f0827a2d108c8e24e57f46817c5e48e48e3e76e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 12 Jun 2010 17:47:47 +0000 Subject: [PATCH] * fixes a warning * try to launch screen_blanker by path when a launch by signature fails. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37120 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../filters/screen_saver/ScreenSaverFilter.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/add-ons/input_server/filters/screen_saver/ScreenSaverFilter.cpp b/src/add-ons/input_server/filters/screen_saver/ScreenSaverFilter.cpp index 8e13c05f84..80f04d1560 100644 --- a/src/add-ons/input_server/filters/screen_saver/ScreenSaverFilter.cpp +++ b/src/add-ons/input_server/filters/screen_saver/ScreenSaverFilter.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -172,7 +173,7 @@ ScreenSaverFilter::_WatchSettings() void ScreenSaverFilter::_Invoke() { - if (fCurrentCorner == fNeverBlankCorner && fNeverBlankCorner != NO_CORNER + if ((fCurrentCorner == fNeverBlankCorner && fNeverBlankCorner != NO_CORNER) || (fSettings.TimeFlags() & ENABLE_SAVER) == 0 || fIsRunning || be_roster->IsRunning(SCREEN_BLANKER_SIG)) @@ -183,6 +184,21 @@ ScreenSaverFilter::_Invoke() // the blanker twice in any case. fIsRunning = true; } + + // Try really hard to launch it. It's very likely that this fails, + // when we run from the CD and there is only an incomplete mime + // database for example... + BPath path; + if (find_directory(B_SYSTEM_BIN_DIRECTORY, &path) != B_OK + || path.Append("screen_blanker") != B_OK) { + path.SetTo("/boot/system/bin/screen_blanker"); + } + BEntry entry(path.Path()); + entry_ref ref; + if (entry.GetRef(&ref) == B_OK + && be_roster->Launch(&ref) == B_OK) { + fIsRunning = true; + } }