Added circlenext

This commit is contained in:
vaxerski 2022-06-10 11:39:06 +02:00
parent c451e13e4f
commit c6953329d5
2 changed files with 14 additions and 1 deletions

View file

@ -26,6 +26,7 @@ CKeybindManager::CKeybindManager() {
m_mDispatchers["togglespecialworkspace"] = toggleSpecialWorkspace; m_mDispatchers["togglespecialworkspace"] = toggleSpecialWorkspace;
m_mDispatchers["forcerendererreload"] = forceRendererReload; m_mDispatchers["forcerendererreload"] = forceRendererReload;
m_mDispatchers["resizeactive"] = resizeActive; m_mDispatchers["resizeactive"] = resizeActive;
m_mDispatchers["circlenext"] = circleNext;
} }
void CKeybindManager::addKeybind(SKeybind kb) { void CKeybindManager::addKeybind(SKeybind kb) {
@ -869,3 +870,14 @@ void CKeybindManager::resizeActive(std::string args) {
g_pLayoutManager->getCurrentLayout()->resizeActiveWindow(Vector2D(X, Y)); g_pLayoutManager->getCurrentLayout()->resizeActiveWindow(Vector2D(X, Y));
} }
void CKeybindManager::circleNext(std::string) {
if (!g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow))
return;
g_pCompositor->focusWindow(g_pCompositor->getNextWindowOnWorkspace(g_pCompositor->m_pLastWindow));
const auto MIDPOINT = g_pCompositor->m_pLastWindow->m_vRealPosition.goalv() + g_pCompositor->m_pLastWindow->m_vRealSize.goalv() / 2.f;
wlr_cursor_warp(g_pCompositor->m_sWLRCursor, nullptr, MIDPOINT.x, MIDPOINT.y);
}

View file

@ -56,6 +56,7 @@ private:
static void toggleSpecialWorkspace(std::string); static void toggleSpecialWorkspace(std::string);
static void forceRendererReload(std::string); static void forceRendererReload(std::string);
static void resizeActive(std::string); static void resizeActive(std::string);
static void circleNext(std::string);
friend class CCompositor; friend class CCompositor;
}; };