mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-07 23:51:55 -07:00
@@ -2692,6 +2692,16 @@ void CCompositor::registerWorkspace(PHLWORKSPACE w) {
|
|||||||
w->m_events.destroy.listenStatic([this, weak = PHLWORKSPACEREF{w}] { std::erase(m_workspaces, weak); });
|
w->m_events.destroy.listenStatic([this, weak = PHLWORKSPACEREF{w}] { std::erase(m_workspaces, weak); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<PHLWORKSPACE> CCompositor::getWorkspacesCopy() {
|
||||||
|
std::vector<PHLWORKSPACE> wsp;
|
||||||
|
auto range = getWorkspaces();
|
||||||
|
wsp.reserve(std::ranges::distance(range));
|
||||||
|
for (auto& r : range) {
|
||||||
|
wsp.emplace_back(r.lock());
|
||||||
|
}
|
||||||
|
return wsp;
|
||||||
|
}
|
||||||
|
|
||||||
void CCompositor::performUserChecks() {
|
void CCompositor::performUserChecks() {
|
||||||
static auto PNOCHECKXDG = CConfigValue<Hyprlang::INT>("misc:disable_xdg_env_checks");
|
static auto PNOCHECKXDG = CConfigValue<Hyprlang::INT>("misc:disable_xdg_env_checks");
|
||||||
static auto PNOCHECKQTUTILS = CConfigValue<Hyprlang::INT>("misc:disable_hyprland_qtutils_check");
|
static auto PNOCHECKQTUTILS = CConfigValue<Hyprlang::INT>("misc:disable_hyprland_qtutils_check");
|
||||||
|
@@ -79,6 +79,7 @@ class CCompositor {
|
|||||||
auto getWorkspaces() {
|
auto getWorkspaces() {
|
||||||
return std::views::filter(m_workspaces, [](const auto& e) { return e; });
|
return std::views::filter(m_workspaces, [](const auto& e) { return e; });
|
||||||
}
|
}
|
||||||
|
std::vector<PHLWORKSPACE> getWorkspacesCopy();
|
||||||
void registerWorkspace(PHLWORKSPACE w);
|
void registerWorkspace(PHLWORKSPACE w);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@@ -216,12 +216,12 @@ void CMonitor::onConnect(bool noRule) {
|
|||||||
|
|
||||||
setupDefaultWS(monitorRule);
|
setupDefaultWS(monitorRule);
|
||||||
|
|
||||||
for (auto const& ws : g_pCompositor->getWorkspaces()) {
|
for (auto const& ws : g_pCompositor->getWorkspacesCopy()) {
|
||||||
if (!valid(ws.lock()))
|
if (!valid(ws))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (ws->m_lastMonitor == m_name || g_pCompositor->m_monitors.size() == 1 /* avoid lost workspaces on recover */) {
|
if (ws->m_lastMonitor == m_name || g_pCompositor->m_monitors.size() == 1 /* avoid lost workspaces on recover */) {
|
||||||
g_pCompositor->moveWorkspaceToMonitor(ws.lock(), m_self.lock());
|
g_pCompositor->moveWorkspaceToMonitor(ws, m_self.lock());
|
||||||
ws->startAnim(true, true, true);
|
ws->startAnim(true, true, true);
|
||||||
ws->m_lastMonitor = "";
|
ws->m_lastMonitor = "";
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user