mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 18:09:50 +01:00
Added moveintogroup dispatcher
This commit is contained in:
parent
3bfaeacf7d
commit
55b412e0f4
2 changed files with 28 additions and 2 deletions
|
@ -61,6 +61,7 @@ CKeybindManager::CKeybindManager() {
|
|||
m_mDispatchers["focusurgentorlast"] = focusUrgentOrLast;
|
||||
m_mDispatchers["focuscurrentorlast"] = focusCurrentOrLast;
|
||||
m_mDispatchers["lockgroups"] = lockGroups;
|
||||
m_mDispatchers["moveintogroup"] = moveIntoGroup;
|
||||
|
||||
m_tScrollTimer.reset();
|
||||
}
|
||||
|
@ -1131,7 +1132,7 @@ void CKeybindManager::moveFocusTo(std::string args) {
|
|||
|
||||
if (PLASTWINDOW->m_iMonitorID != PWINDOWTOCHANGETO->m_iMonitorID) {
|
||||
// event
|
||||
const auto PNEWMON = g_pCompositor->getMonitorFromID(PWINDOWTOCHANGETO->m_iMonitorID);
|
||||
const auto PNEWMON = g_pCompositor->getMonitorFromID(PWINDOWTOCHANGETO->m_iMonitorID);
|
||||
const auto PNEWWORKSPACE = g_pCompositor->getWorkspaceByID(PWINDOWTOCHANGETO->m_iWorkspaceID);
|
||||
|
||||
g_pCompositor->setActiveMonitor(PNEWMON);
|
||||
|
@ -2056,3 +2057,26 @@ void CKeybindManager::lockGroups(std::string args) {
|
|||
g_pKeybindManager->m_bGroupsLocked = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CKeybindManager::moveIntoGroup(std::string args) {
|
||||
char arg = args[0];
|
||||
|
||||
if (!isDirection(args)) {
|
||||
Debug::log(ERR, "Cannot move into group in direction %c, unsupported direction. Supported: l,r,u/t,d/b", arg);
|
||||
return;
|
||||
}
|
||||
|
||||
const auto PWINDOW = g_pCompositor->m_pLastWindow;
|
||||
|
||||
if (!PWINDOW || PWINDOW->m_bIsFloating)
|
||||
return;
|
||||
|
||||
const auto PWINDOWINDIR = g_pCompositor->getWindowInDirection(PWINDOW, arg);
|
||||
|
||||
if (!PWINDOWINDIR || !PWINDOWINDIR->m_sGroupData.pNextWindow)
|
||||
return;
|
||||
|
||||
g_pLayoutManager->getCurrentLayout()->onWindowRemoved(PWINDOW);
|
||||
|
||||
PWINDOWINDIR->insertWindowToGroup(PWINDOW);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,8 @@ struct SKeybind {
|
|||
bool shadowed = false;
|
||||
};
|
||||
|
||||
enum eFocusWindowMode {
|
||||
enum eFocusWindowMode
|
||||
{
|
||||
MODE_CLASS_REGEX = 0,
|
||||
MODE_TITLE_REGEX,
|
||||
MODE_ADDRESS,
|
||||
|
@ -135,6 +136,7 @@ class CKeybindManager {
|
|||
static void mouse(std::string);
|
||||
static void bringActiveToTop(std::string);
|
||||
static void lockGroups(std::string);
|
||||
static void moveIntoGroup(std::string);
|
||||
|
||||
friend class CCompositor;
|
||||
friend class CInputManager;
|
||||
|
|
Loading…
Reference in a new issue