mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 00:25:59 +01:00
allow cyclenext on null focus
This commit is contained in:
parent
1a767b021b
commit
9e227a52c0
1 changed files with 11 additions and 3 deletions
|
@ -1422,9 +1422,6 @@ void CKeybindManager::resizeWindow(std::string args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CKeybindManager::circleNext(std::string arg) {
|
void CKeybindManager::circleNext(std::string arg) {
|
||||||
if (!g_pCompositor->m_pLastWindow)
|
|
||||||
return;
|
|
||||||
|
|
||||||
auto switchToWindow = [&](CWindow* PWINDOWTOCHANGETO) {
|
auto switchToWindow = [&](CWindow* PWINDOWTOCHANGETO) {
|
||||||
if (PWINDOWTOCHANGETO == g_pCompositor->m_pLastWindow || !PWINDOWTOCHANGETO)
|
if (PWINDOWTOCHANGETO == g_pCompositor->m_pLastWindow || !PWINDOWTOCHANGETO)
|
||||||
return;
|
return;
|
||||||
|
@ -1447,6 +1444,17 @@ void CKeybindManager::circleNext(std::string arg) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!g_pCompositor->m_pLastWindow) {
|
||||||
|
// if we have a clear focus, find the first window and get the next focusable.
|
||||||
|
if (g_pCompositor->getWindowsOnWorkspace(g_pCompositor->m_pLastMonitor->activeWorkspace) > 0) {
|
||||||
|
const auto PWINDOW = g_pCompositor->getNextWindowOnWorkspace(g_pCompositor->getFirstWindowOnWorkspace(g_pCompositor->m_pLastMonitor->activeWorkspace), true);
|
||||||
|
|
||||||
|
switchToWindow(PWINDOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (arg == "last" || arg == "l" || arg == "prev" || arg == "p")
|
if (arg == "last" || arg == "l" || arg == "prev" || arg == "p")
|
||||||
switchToWindow(g_pCompositor->getPrevWindowOnWorkspace(g_pCompositor->m_pLastWindow, true));
|
switchToWindow(g_pCompositor->getPrevWindowOnWorkspace(g_pCompositor->m_pLastWindow, true));
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue