Tracker: Open Desktop folder in own window in browser mode.

... in a few more cases.

If you are in spatial mode and you double-click on the Desktop folder
it activates the Desktop putting all other Tracker windows in the
background.

If you are in browser mode and you double-click on the Desktop folder
it opens the Desktop folder in the current window.

If you issue 'open ~/Desktop' from Terminal or if you have Expander set
to open the expanded folder and you expand something on the Desktop
it won't open the Desktop folder in its own window in either spatial or
browser mode.

This patch alters Trackers behavior to  open the Desktop folder in its own
window in these cases when you are in browser mode.

One might argue (as a few have on IRC) that this behavior should also
happen in spatial mode, but, this patch does not alter the behavior of
spatial mode. In spatial mode opening the Desktop folder with
'open ~/Desktop' or extracting a zip file with Expander on the Desktop
simply activates the Desktop pushing all other Tracker windows into the
background state.

Fixes #10929
This commit is contained in:
John Scipione 2014-06-10 00:57:33 -04:00
parent 157e4b428a
commit 646b1fe1e8

View File

@ -965,12 +965,13 @@ TTracker::OpenContainerWindow(Model* model, BMessage* originalRefsList,
uint32 workspace = (uint32)(1 << current_workspace());
int32 windowCount = 0;
while (window) {
// At least one window open, just pull to front
// make sure we don't jerk workspaces around
uint32 windowWorkspaces = window->Workspaces();
if (windowWorkspaces & workspace) {
while (window != NULL) {
if ((window->Workspaces() & workspace) != 0
&& (dynamic_cast<BDeskWindow*>(window) == NULL
|| !TrackerSettings().SingleWindowBrowse())) {
// We found at least one window that is open and is not Desktop
// or we're in spatial mode, activate it and make sure we don't
// jerk the workspaces around.
window->Activate();
someWindowActivated = true;
}