From a86d99e0daabffd6b8600cc74edbb334268025b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Mon, 21 Jul 2008 16:01:51 +0000 Subject: [PATCH] Opening previously open windows on non-boot partitions obviously only worked if the automounter already mounted these partitions. Since this happens asynchronously, it sometimes worked and sometimes not. The very simply and non-hacky fix for this problem is to send a message from the automounter to the application looper to have it open the previous windows after the initial mount scan is done. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26549 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/AutoMounter.cpp | 3 +++ src/kits/tracker/Commands.h | 1 + src/kits/tracker/Tracker.cpp | 9 +++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/kits/tracker/AutoMounter.cpp b/src/kits/tracker/AutoMounter.cpp index b16bd1ca86..460996b6c3 100644 --- a/src/kits/tracker/AutoMounter.cpp +++ b/src/kits/tracker/AutoMounter.cpp @@ -459,6 +459,7 @@ AutoMounter::MessageReceived(BMessage *message) switch (message->what) { case kMsgInitialScan: _MountVolumes(fNormalMode, fRemovableMode, true); + be_app->PostMessage(kOpenPreviouslyOpenWindows); break; case kMountVolume: @@ -1486,6 +1487,8 @@ AutoMounter::InitialRescan() } sInitialRescan = false; + + be_app->PostMessage(kOpenPreviouslyOpenWindows); } diff --git a/src/kits/tracker/Commands.h b/src/kits/tracker/Commands.h index 4131ec6bee..698118b249 100644 --- a/src/kits/tracker/Commands.h +++ b/src/kits/tracker/Commands.h @@ -53,6 +53,7 @@ const uint32 kCloseWindowAndChildren = 'Tcwc'; // end external app messages +const uint32 kOpenPreviouslyOpenWindows = 'Topw'; const uint32 kRestoreState = 'Trst'; const uint32 kCutMoreSelectionToClipboard = 'Tmvm'; diff --git a/src/kits/tracker/Tracker.cpp b/src/kits/tracker/Tracker.cpp index 7b9cdb8dc5..038d5801fe 100644 --- a/src/kits/tracker/Tracker.cpp +++ b/src/kits/tracker/Tracker.cpp @@ -356,6 +356,11 @@ TTracker::MessageReceived(BMessage *message) return; switch (message->what) { + case kOpenPreviouslyOpenWindows: + if (!BootedInSafeMode()) + _OpenPreviouslyOpenedWindows(); + break; + case kGetInfo: OpenInfoWindows(message); break; @@ -1327,10 +1332,6 @@ TTracker::ReadyToRun() } } else delete model; - - // open previously open windows - if (!BootedInSafeMode()) - _OpenPreviouslyOpenedWindows(); } // kick off building the mime type list for find panels, etc.