summaryrefslogtreecommitdiff
path: root/src/managers/KeybindManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-06 13:48:17 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-06-06 13:48:17 +0200
commitd743ac7bb1339a7407affb97792eb47fb0fe708c (patch)
treebf92222053ae5d629c4ac21139204b472f61bb0f /src/managers/KeybindManager.cpp
parent322a4954123e71295eb035557debaaf093489d31 (diff)
added forcerendererreload and some more vt changes
Diffstat (limited to 'src/managers/KeybindManager.cpp')
-rw-r--r--src/managers/KeybindManager.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 82aa5575..7d08d358 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -24,6 +24,7 @@ CKeybindManager::CKeybindManager() {
m_mDispatchers["movecurrentworkspacetomonitor"] = moveCurrentWorkspaceToMonitor;
m_mDispatchers["moveworkspacetomonitor"] = moveWorkspaceToMonitor;
m_mDispatchers["togglespecialworkspace"] = toggleSpecialWorkspace;
+ m_mDispatchers["forcerendererreload"] = forceRendererReload;
}
void CKeybindManager::addKeybind(SKeybind kb) {
@@ -109,8 +110,17 @@ bool CKeybindManager::handleInternalKeybinds(xkb_keysym_t keysym) {
const auto PSESSION = wlr_backend_get_session(g_pCompositor->m_sWLRBackend);
if (PSESSION) {
- const auto TTY = keysym - XKB_KEY_XF86Switch_VT_1 + 1;
+ const int TTY = keysym - XKB_KEY_XF86Switch_VT_1 + 1;
wlr_session_change_vt(PSESSION, TTY);
+
+ for (auto& m : g_pCompositor->m_lMonitors) {
+ g_pHyprOpenGL->destroyMonitorResources(&m); // mark resources as unusable anymore
+ m.noFrameSchedule = true;
+ m.framesToSkip = 2;
+ }
+
+ Debug::log(LOG, "Switched to VT %i, destroyed all render data, frames to skip for each: 2", TTY);
+
return true;
}
@@ -826,4 +836,11 @@ void CKeybindManager::toggleSpecialWorkspace(std::string args) {
}
g_pInputManager->refocus();
+}
+
+void CKeybindManager::forceRendererReload(std::string args) {
+ for (auto& m : g_pCompositor->m_lMonitors) {
+ auto rule = g_pConfigManager->getMonitorRuleFor(m.szName);
+ g_pHyprRenderer->applyMonitorRule(&m, &rule, true);
+ }
} \ No newline at end of file