[haiku-commits] Re: r37120 - haiku/trunk/src/add-ons/input_server/filters/screen_saver

  • From: Stephan Assmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 12 Jun 2010 20:12:42 +0200

Hi Jérôme,

On 2010-06-12 at 19:47:47 [+0200], korli@xxxxxxxxxxxxxxxx wrote:
> @@ -172,7 +173,7 @@
>  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 @@
>          // 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;
> +    }
>  }

From the diff it looks like it also executes the fallback code-path even when 
the launch by signature succeeded.

Best regards,
-Stephan



Other related posts: