Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Hy3Layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -858,14 +858,14 @@ Hy3Node* Hy3Layout::focusMonitor(ShiftDirection direction) {
return nullptr;
}

bool Hy3Layout::shiftMonitor(Hy3Node& node, ShiftDirection direction, bool follow) {
bool Hy3Layout::shiftMonitor(Hy3Node& node, ShiftDirection direction, bool follow, bool warp) {
auto next_monitor = g_pCompositor->getMonitorInDirection(shiftToMathDirection(direction));

if (next_monitor) {
Desktop::focusState()->rawMonitorFocus(next_monitor);
auto next_workspace = next_monitor->m_activeWorkspace;
if (next_workspace) {
moveNodeToWorkspace(node.layout()->workspace().get(), next_workspace->m_name, follow, false);
moveNodeToWorkspace(node.layout()->workspace().get(), next_workspace->m_name, follow, warp);
return true;
}
}
Expand Down Expand Up @@ -1504,6 +1504,9 @@ Hy3Node* Hy3Layout::shiftOrGetFocus(
if (break_parent->is_root()) {
if (!shift) return focusMonitor(direction);

// Moving out of the root group should mirror focus movement and cross monitors.
if (shiftMonitor(node, direction, true, true)) return nullptr;

auto new_layout =
shiftIsVertical(direction) ? Hy3GroupLayout::SplitV : Hy3GroupLayout::SplitH;
break_origin->wrap(new_layout, GroupEphemeralityOption::Standard);
Expand Down
2 changes: 1 addition & 1 deletion src/Hy3Layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class Hy3Layout: public Layout::ITiledAlgorithm {
void shiftWindow(const CWorkspace* workspace, ShiftDirection, bool once, bool visible);
void shiftFocus(const CWorkspace* workspace, ShiftDirection, bool visible, bool warp);
void toggleFocusLayer(const CWorkspace* workspace, bool warp);
bool shiftMonitor(Hy3Node&, ShiftDirection, bool follow);
bool shiftMonitor(Hy3Node&, ShiftDirection, bool follow, bool warp);
Hy3Node* focusMonitor(ShiftDirection);

void warpCursor();
Expand Down