Skip to content

Commit 2eba959

Browse files
committed
Moved methods to workspace_show() - better place for them (means
clicking on a workspace now sets the last one for that workspace group).
1 parent 7abfd9a commit 2eba959

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/workspace.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,10 @@ void workspace_show(Con *workspace) {
608608

609609
/* Push any sticky windows to the now visible workspace. */
610610
output_push_sticky_windows(old_focus);
611+
612+
/* update num_last_selected for this workspaces with same num (but diff name) */
613+
clear_num_last_selected_by_num(workspace->num);
614+
workspace->num_last_selected = true;
611615
}
612616

613617
/*
@@ -678,8 +682,6 @@ Con *workspace_next(void) {
678682
if (child == current) {
679683
found_current = true;
680684
} else if (found_current && current->num == child->num) {
681-
clear_num_last_selected_by_num(child->num);
682-
child->num_last_selected = true;
683685
return child;
684686
}
685687
}
@@ -690,10 +692,6 @@ Con *workspace_next(void) {
690692
next = first_opposite ? first_opposite : first;
691693
}
692694

693-
if (next) {
694-
clear_num_last_selected_by_num(next->num);
695-
next->num_last_selected = true;
696-
}
697695
return next;
698696
}
699697

@@ -760,8 +758,6 @@ Con *workspace_prev(void) {
760758
if (child == current) {
761759
found_current = true;
762760
} else if (found_current && current->num == child->num) {
763-
clear_num_last_selected_by_num(child->num);
764-
child->num_last_selected = true;
765761
return child;
766762
}
767763
}
@@ -772,10 +768,6 @@ Con *workspace_prev(void) {
772768
prev = first_opposite ? first_opposite : last;
773769
}
774770

775-
if (prev) {
776-
clear_num_last_selected_by_num(prev->num);
777-
prev->num_last_selected = true;
778-
}
779771
return prev;
780772
}
781773

0 commit comments

Comments
 (0)