-
-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added move-workspace-to-index and move-workspace-to-monitor IPC actions #1007
base: main
Are you sure you want to change the base?
Conversation
I must say I have genuinely no idea what happened to the previous PR, but GitHub has decided that it's just... not a part of the equation anymore after some problems with getting rebase done correctly. All the previous comments should have now been addressed. I am deeply sorry for the confusion this must be causing... well everyone. |
7 copilot buttons and none could save them |
…icked, fixed other mentioned problems.
90468b5
to
72afddb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased. Noticed two issues:
- Command like
move-workspace-to-index 0 --reference 2
doesn't work because in this casefind_output_and_workspace_index()
returns a None output. - Command like
move-workspace-to-index 0 --reference browser
focuses the workspace after moving it, even if it wasn't focused before.
…workspace-to-index`
Those should be fixed:
|
Those problems should also be done, also fixed a bit of an issue where the active workspace on the monitor that had a workspace moved off it would be wrong if the workspace that was moved was not the active workspace. |
src/layout/mod.rs
Outdated
@@ -3884,11 +3898,20 @@ impl<W: LayoutElement> Layout<W> { | |||
// the last empty workspace, then insert before. | |||
let target_ws_idx = min(target.active_workspace_idx + 1, target.workspaces.len() - 1); | |||
target.workspaces.insert(target_ws_idx, ws); | |||
target.active_workspace_idx = target_ws_idx; | |||
target.workspace_switch = None; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also needed. Without it, the randomized test crashes:
thread 'layout::tests::random_operations_dont_panic' panicked at src/layout/mod.rs:7328:5:
Test failed: assertion failed: self.workspace_switch.is_none().
minimal failing input: ops = [
AddOutput(
3,
),
AddOutput(
2,
),
AddNamedWorkspace {
ws_name: 2,
output_name: None,
},
AddWindow {
params: TestWindowParams {
id: 1,
parent_id: None,
is_floating: false,
bbox: Rectangle<smithay::utils::geometry::Logical> {
x: 0,
y: 0,
width: 1,
height: 1,
},
min_max_size: (
Size<smithay::utils::geometry::Logical> {
w: 0,
h: 0,
},
Size<smithay::utils::geometry::Logical> {
w: 0,
h: 0,
},
),
},
},
MoveWorkspaceToOutput(
2,
),
FocusWorkspaceAutoBackAndForth(
0,
),
MoveWorkspaceToMonitor {
ws_name: Some(
2,
),
output_id: 2,
},
]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, reordered it to mirror the original order at which the operations were done.
No description provided.