mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 06:25:58 +01:00
keybinds: only warp on different monitor ws
This commit is contained in:
parent
727160f0a4
commit
c2b5dd1be6
1 changed files with 3 additions and 1 deletions
|
@ -784,6 +784,7 @@ void CKeybindManager::changeworkspace(std::string args) {
|
||||||
PMONITORWORKSPACEOWNER->changeWorkspace(pWorkspaceToChangeTo);
|
PMONITORWORKSPACEOWNER->changeWorkspace(pWorkspaceToChangeTo);
|
||||||
|
|
||||||
if (PMONITOR != PMONITORWORKSPACEOWNER) {
|
if (PMONITOR != PMONITORWORKSPACEOWNER) {
|
||||||
|
g_pCompositor->warpCursorTo(PMONITORWORKSPACEOWNER->vecPosition + PMONITORWORKSPACEOWNER->vecSize / 2.f);
|
||||||
g_pCompositor->setActiveMonitor(PMONITORWORKSPACEOWNER);
|
g_pCompositor->setActiveMonitor(PMONITORWORKSPACEOWNER);
|
||||||
if (const auto PLASTWINDOW = pWorkspaceToChangeTo->getLastFocusedWindow(); PLASTWINDOW)
|
if (const auto PLASTWINDOW = pWorkspaceToChangeTo->getLastFocusedWindow(); PLASTWINDOW)
|
||||||
g_pCompositor->focusWindow(PLASTWINDOW);
|
g_pCompositor->focusWindow(PLASTWINDOW);
|
||||||
|
@ -815,9 +816,10 @@ void CKeybindManager::changeworkspace(std::string args) {
|
||||||
g_pCompositor->setActiveMonitor(PMONITORWORKSPACEOWNER);
|
g_pCompositor->setActiveMonitor(PMONITORWORKSPACEOWNER);
|
||||||
|
|
||||||
PMONITORWORKSPACEOWNER->changeWorkspace(pWorkspaceToChangeTo);
|
PMONITORWORKSPACEOWNER->changeWorkspace(pWorkspaceToChangeTo);
|
||||||
g_pCompositor->warpCursorTo(PMONITORWORKSPACEOWNER->vecPosition + PMONITORWORKSPACEOWNER->vecSize / 2.f);
|
|
||||||
|
|
||||||
if (PMONITOR != PMONITORWORKSPACEOWNER) {
|
if (PMONITOR != PMONITORWORKSPACEOWNER) {
|
||||||
|
g_pCompositor->warpCursorTo(PMONITORWORKSPACEOWNER->vecPosition + PMONITORWORKSPACEOWNER->vecSize / 2.f);
|
||||||
|
|
||||||
if (const auto PLASTWINDOW = pWorkspaceToChangeTo->getLastFocusedWindow(); PLASTWINDOW)
|
if (const auto PLASTWINDOW = pWorkspaceToChangeTo->getLastFocusedWindow(); PLASTWINDOW)
|
||||||
g_pCompositor->focusWindow(PLASTWINDOW);
|
g_pCompositor->focusWindow(PLASTWINDOW);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue