mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 19:05:59 +01:00
moveactive monitor
This commit is contained in:
parent
8bb908a8da
commit
500cbd135f
1 changed files with 22 additions and 0 deletions
|
@ -367,6 +367,28 @@ void CKeybindManager::moveFocusTo(std::string args) {
|
|||
void CKeybindManager::moveActiveTo(std::string args) {
|
||||
char arg = args[0];
|
||||
|
||||
const auto LASTMONITOR = g_pCompositor->m_pLastMonitor;
|
||||
|
||||
if (args.find("mon:") == 0) {
|
||||
// hack: save the active window
|
||||
const auto PACTIVE = g_pCompositor->m_pLastWindow;
|
||||
|
||||
// monitor
|
||||
focusMonitor(args.substr(4));
|
||||
|
||||
if (LASTMONITOR == g_pCompositor->m_pLastMonitor) {
|
||||
Debug::log(ERR, "moveActiveTo: moving to an invalid mon");
|
||||
return;
|
||||
}
|
||||
|
||||
// restore the active
|
||||
g_pCompositor->focusWindow(PACTIVE);
|
||||
|
||||
moveActiveToWorkspace(std::to_string(g_pCompositor->m_pLastMonitor->activeWorkspace));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isDirection(args)) {
|
||||
Debug::log(ERR, "Cannot move window in direction %c, unsupported direction. Supported: l,r,u/t,d/b", arg);
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue