void StackAndTile::_ActivateWindow(SATWindow* satWindow) { if (satWindow == NULL) return; SATGroup* group = satWindow->GetGroup(); if (group == NULL) return; Desktop* desktop = satWindow->GetWindow()->Desktop(); if (desktop == NULL) return; WindowArea* area = satWindow->GetWindowArea(); if (area == NULL) return; area->MoveToTopLayer(satWindow); // save the active window of the current group SATWindow* frontWindow = GetSATWindow(fDesktop->FocusWindow()); SATGroup* currentGroup = _GetSATGroup(frontWindow); if (currentGroup != NULL && currentGroup != group && frontWindow != NULL) currentGroup->SetActiveWindow(frontWindow); else group->SetActiveWindow(satWindow); const WindowAreaList& areas = group->GetAreaList(); int32 areasCount = areas.CountItems(); for (int32 i = 0; i < areasCount; i++) { WindowArea* currentArea = areas.ItemAt(i); if (currentArea == area) continue; desktop->ActivateWindow(currentArea->TopWindow()->GetWindow()); } desktop->ActivateWindow(satWindow->GetWindow()); }
void StackAndTile::WindowWorkspacesChanged(Window* window, uint32 workspaces) { SATWindow* satWindow = GetSATWindow(window); if (satWindow == NULL) return; SATGroup* group = satWindow->GetGroup(); if (group == NULL) return; Desktop* desktop = satWindow->GetWindow()->Desktop(); if (desktop == NULL) return; const WindowAreaList& areaList = group->GetAreaList(); for (int32 i = 0; i < areaList.CountItems(); i++) { WindowArea* area = areaList.ItemAt(i); if (area->WindowList().HasItem(satWindow)) continue; SATWindow* topWindow = area->TopWindow(); desktop->SetWindowWorkspaces(topWindow->GetWindow(), workspaces); } }
void StackAndTile::WindowSentBehind(Window* window, Window* behindOf) { SATWindow* satWindow = GetSATWindow(window); if (satWindow == NULL) return; SATGroup* group = satWindow->GetGroup(); if (group == NULL) return; Desktop* desktop = satWindow->GetWindow()->Desktop(); if (desktop == NULL) return; const WindowAreaList& areaList = group->GetAreaList(); for (int32 i = 0; i < areaList.CountItems(); i++) { WindowArea* area = areaList.ItemAt(i); SATWindow* topWindow = area->TopWindow(); if (topWindow == NULL || topWindow == satWindow) continue; desktop->SendWindowBehind(topWindow->GetWindow(), behindOf); } }