mirror of https://github.com/hyprwm/Hyprland
Compare commits
4 Commits
862190c6f5
...
aba320a2a5
Author | SHA1 | Date |
---|---|---|
はれなよ | aba320a2a5 | |
はれなよ | fee0e044d8 | |
Harenayo | 724f07cd2f | |
Alexander | b7f42a1e88 |
|
@ -30,14 +30,27 @@ void Events::listener_RendererDestroy(wl_listener* listener, void* data) {
|
|||
}
|
||||
|
||||
void Events::listener_sessionActive(wl_listener* listener, void* data) {
|
||||
Debug::log(LOG, "Session got activated!");
|
||||
if (g_pCompositor->m_sWLRSession->active) {
|
||||
Debug::log(LOG, "Session got activated!");
|
||||
|
||||
g_pCompositor->m_bSessionActive = true;
|
||||
g_pCompositor->m_bSessionActive = true;
|
||||
|
||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||
g_pCompositor->scheduleFrameForMonitor(m.get());
|
||||
g_pHyprRenderer->applyMonitorRule(m.get(), &m->activeMonitorRule, true);
|
||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||
g_pCompositor->scheduleFrameForMonitor(m.get());
|
||||
g_pHyprRenderer->applyMonitorRule(m.get(), &m->activeMonitorRule, true);
|
||||
}
|
||||
|
||||
g_pConfigManager->m_bWantsMonitorReload = true;
|
||||
} else {
|
||||
Debug::log(LOG, "Session got inactivated!");
|
||||
|
||||
g_pCompositor->m_bSessionActive = false;
|
||||
|
||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||
m->noFrameSchedule = true;
|
||||
m->framesToSkip = 1;
|
||||
}
|
||||
|
||||
Debug::log(LOG, "Destroyed all render data, frames to skip for each: 2");
|
||||
}
|
||||
|
||||
g_pConfigManager->m_bWantsMonitorReload = true;
|
||||
}
|
||||
|
|
|
@ -810,18 +810,7 @@ bool CKeybindManager::handleVT(xkb_keysym_t keysym) {
|
|||
|
||||
Debug::log(LOG, "Switching from VT {} to VT {}", ttynum, TTY);
|
||||
|
||||
if (!wlr_session_change_vt(g_pCompositor->m_sWLRSession, TTY))
|
||||
return true; // probably same session
|
||||
|
||||
g_pCompositor->m_bSessionActive = false;
|
||||
|
||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||
m->noFrameSchedule = true;
|
||||
m->framesToSkip = 1;
|
||||
}
|
||||
|
||||
Debug::log(LOG, "Switched to VT {}, destroyed all render data, frames to skip for each: 2", TTY);
|
||||
|
||||
wlr_session_change_vt(g_pCompositor->m_sWLRSession, TTY);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1048,14 +1037,20 @@ SWorkspaceIDName getWorkspaceToChangeFromArgs(std::string args, PHLWORKSPACE PCU
|
|||
return {WORKSPACE_NOT_CHANGED, ""};
|
||||
}
|
||||
|
||||
const auto ID = PCURRENTWORKSPACE->m_iID;
|
||||
if (const auto PWORKSPACETOCHANGETO = g_pCompositor->getWorkspaceByID(PPREVWS.id); PWORKSPACETOCHANGETO) {
|
||||
if (PER_MON && PCURRENTWORKSPACE->m_iMonitorID != PWORKSPACETOCHANGETO->m_iMonitorID)
|
||||
return {WORKSPACE_NOT_CHANGED, ""};
|
||||
return {ID, PWORKSPACETOCHANGETO->m_szName};
|
||||
}
|
||||
const auto ID = PCURRENTWORKSPACE->m_iID;
|
||||
const auto PWORKSPACETOCHANGETO = g_pCompositor->getWorkspaceByID(PPREVWS.id);
|
||||
if (!PWORKSPACETOCHANGETO)
|
||||
return {ID, PPREVWS.name.empty() ? std::to_string(PPREVWS.id) : PPREVWS.name};
|
||||
|
||||
return {ID, PPREVWS.name.empty() ? std::to_string(PPREVWS.id) : PPREVWS.name};
|
||||
if (!PER_MON || PCURRENTWORKSPACE->m_iMonitorID == PWORKSPACETOCHANGETO->m_iMonitorID)
|
||||
return {ID, PWORKSPACETOCHANGETO->m_szName};
|
||||
|
||||
// PER_MON and cur ws is not on same monitor with prev per monitor
|
||||
const auto POTHERWSTOCHANGETO = g_pCompositor->getWorkspaceByID(PCURRENTWORKSPACE->getPrevWorkspaceIDName(false).id);
|
||||
if (POTHERWSTOCHANGETO && POTHERWSTOCHANGETO->m_iMonitorID == PCURRENTWORKSPACE->m_iMonitorID)
|
||||
return {ID, POTHERWSTOCHANGETO->m_szName};
|
||||
|
||||
return {WORKSPACE_NOT_CHANGED, ""};
|
||||
}
|
||||
|
||||
void CKeybindManager::changeworkspace(std::string args) {
|
||||
|
|
Loading…
Reference in New Issue