mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-05 06:31:57 -07:00
added swapnext
This commit is contained in:
@@ -39,6 +39,7 @@ CKeybindManager::CKeybindManager() {
|
||||
m_mDispatchers["dpms"] = dpms;
|
||||
m_mDispatchers["movewindowpixel"] = moveWindow;
|
||||
m_mDispatchers["resizewindowpixel"] = resizeWindow;
|
||||
m_mDispatchers["swapnext"] = swapNext;
|
||||
|
||||
m_tScrollTimer.reset();
|
||||
}
|
||||
@@ -1437,3 +1438,22 @@ void CKeybindManager::dpms(std::string arg) {
|
||||
|
||||
g_pCompositor->m_bDPMSStateON = enable;
|
||||
}
|
||||
|
||||
void CKeybindManager::swapnext(std::string arg) {
|
||||
|
||||
CWindow* toSwap = nullptr;
|
||||
|
||||
if (!g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow))
|
||||
return;
|
||||
|
||||
const auto PLASTWINDOW = g_pCompositor->m_pLastWindow;
|
||||
|
||||
if (arg == "last" || arg == "l" || arg == "prev" || arg == "p")
|
||||
toSwap = g_pCompositor->getPrevWindowOnWorkspace(PLASTWINDOW);
|
||||
else
|
||||
toSwap = g_pCompositor->getNextWindowOnWorkspace(PLASTWINDOW);
|
||||
|
||||
g_pLayoutManager->getCurrentLayout()->switchWindows(PLASTWINDOW, toSwap);
|
||||
|
||||
g_pCompositor->focusWindow(PLASTWINDOW);
|
||||
}
|
||||
|
Reference in New Issue
Block a user