From 21ceb10d7e49a52946537873e2079456c650f0d8 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann Date: Tue, 30 Mar 2021 10:10:07 -0500 Subject: [PATCH] Wait for deskbar to launch --- src/DeskbarView.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/DeskbarView.cpp b/src/DeskbarView.cpp index 18ab909..dac666f 100644 --- a/src/DeskbarView.cpp +++ b/src/DeskbarView.cpp @@ -260,15 +260,18 @@ our_image(image_info& image) return B_ERROR; } - int32 installDeskbar() { int32 deskbarId = -1; - removeDeskbar(); - BDeskbar deskbar; + // Just in case deskbar hasn't launched yet + if (BDeskbar().IsRunning() == false) + sleep(3); + removeDeskbar(); + + BDeskbar deskbar; deskbar.AddItem( new DeskbarView(BRect(0,0, deskbar.MaxItemHeight() - 1, deskbar.MaxItemHeight() - 1)),