seperate workspaces by monitor
This commit is contained in:
parent
c555593ae2
commit
a29937ebe8
5 changed files with 44 additions and 20 deletions
|
|
@ -698,8 +698,14 @@ impl ConfigProxyHandler {
|
|||
}
|
||||
|
||||
fn get_existing_workspace(&self, ws: Workspace) -> Result<Option<Rc<WorkspaceNode>>, CphError> {
|
||||
self.get_workspace(ws)
|
||||
.map(|ws| self.state.workspaces.get(&*ws))
|
||||
self.get_workspace(ws).map(|name| {
|
||||
self.state
|
||||
.workspaces
|
||||
.lock()
|
||||
.values()
|
||||
.find(|ws| ws.name.as_str() == name.as_str())
|
||||
.cloned()
|
||||
})
|
||||
}
|
||||
|
||||
fn get_device_handler_data(
|
||||
|
|
@ -1054,9 +1060,10 @@ impl ConfigProxyHandler {
|
|||
fn handle_set_seat_workspace(&self, seat: Seat, ws: Workspace) -> Result<(), CphError> {
|
||||
let seat = self.get_seat(seat)?;
|
||||
let name = self.get_workspace(ws)?;
|
||||
let workspace = match self.state.workspaces.get(name.deref()) {
|
||||
let output = seat.get_fallback_output();
|
||||
let workspace = match output.find_workspace(name.deref()) {
|
||||
Some(ws) => ws,
|
||||
_ => seat.get_fallback_output().create_workspace(name.deref()),
|
||||
_ => output.create_workspace(name.deref()),
|
||||
};
|
||||
seat.set_workspace(&workspace);
|
||||
Ok(())
|
||||
|
|
@ -1065,12 +1072,12 @@ impl ConfigProxyHandler {
|
|||
fn handle_set_window_workspace(&self, window: Window, ws: Workspace) -> Result<(), CphError> {
|
||||
let window = self.get_window(window)?;
|
||||
let name = self.get_workspace(ws)?;
|
||||
let workspace = match self.state.workspaces.get(name.deref()) {
|
||||
let Some(output) = window.node_output() else {
|
||||
return Ok(());
|
||||
};
|
||||
let workspace = match output.find_workspace(name.deref()) {
|
||||
Some(ws) => ws,
|
||||
_ => match window.node_output() {
|
||||
Some(o) => o.create_workspace(name.deref()),
|
||||
_ => return Ok(()),
|
||||
},
|
||||
_ => output.create_workspace(name.deref()),
|
||||
};
|
||||
toplevel_set_workspace(&self.state, window, &workspace);
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue