From 7aeeeccb9e816497ce5248cb8152551c308183c9 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Sat, 22 Feb 2025 12:00:38 -0700 Subject: [PATCH] screen_blanker: activate the window before hiding the cursor In some situations an app launching in the background will steal our status as the active application which causes HideCursor() to fail when the screensaver resumes. This is particularly noticeable when the screen lock is used early in the boot and things like Tracker and Deskbar are still launching. Change-Id: I37c432d277ce30716b9c98ad6a500c9313cbea92 Reviewed-on: https://review.haiku-os.org/c/haiku/+/9045 Tested-by: Commit checker robot Reviewed-by: waddlesplash --- src/bin/screen_blanker/ScreenBlanker.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bin/screen_blanker/ScreenBlanker.cpp b/src/bin/screen_blanker/ScreenBlanker.cpp index 6055c0a6c3..13572beb9d 100644 --- a/src/bin/screen_blanker/ScreenBlanker.cpp +++ b/src/bin/screen_blanker/ScreenBlanker.cpp @@ -251,6 +251,8 @@ ScreenBlanker::MessageReceived(BMessage* message) case kMsgResumeSaver: { if (fWindow->Lock()) { + // ensure that our window and application are active before calling HideCursor() + fWindow->Activate(); HideCursor(); fPasswordWindow->SetPassword(""); fPasswordWindow->Hide();