input/actions: Change active workspace / output when migrated
Without this, a workspace moved with the key binding seems to disappear. This seems more consistent with the behavior of other key bindings.
This commit is contained in:
parent
8aa501c0e0
commit
3debae2495
2 changed files with 37 additions and 17 deletions
|
|
@ -878,14 +878,14 @@ impl Workspaces {
|
|||
}
|
||||
|
||||
// Move workspace from one output to another, explicitly by the user
|
||||
fn migrate_workspace(
|
||||
pub fn migrate_workspace(
|
||||
&mut self,
|
||||
from: &Output,
|
||||
to: &Output,
|
||||
handle: &WorkspaceHandle,
|
||||
workspace_state: &mut WorkspaceUpdateGuard<'_, State>,
|
||||
) {
|
||||
if !self.sets.contains_key(to) {
|
||||
if !self.sets.contains_key(to) || from == to {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1354,19 +1354,6 @@ impl Common {
|
|||
self.refresh(); // cleans up excess of workspaces and empty workspaces
|
||||
}
|
||||
|
||||
pub fn migrate_workspace(&mut self, from: &Output, to: &Output, handle: &WorkspaceHandle) {
|
||||
if from == to {
|
||||
return;
|
||||
}
|
||||
|
||||
let mut shell = self.shell.write();
|
||||
shell
|
||||
.workspaces
|
||||
.migrate_workspace(from, to, handle, &mut self.workspace_state.update());
|
||||
|
||||
std::mem::drop(shell);
|
||||
}
|
||||
|
||||
pub fn update_config(&mut self) {
|
||||
let mut shell = self.shell.write();
|
||||
let shell_ref = &mut *shell;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue