1
0
Fork 0
forked from wry/wry

config: add fallback output mode

This commit is contained in:
khyperia 2025-12-23 14:57:02 +01:00 committed by Julian Orth
parent a975e3b25a
commit dd3f8bad40
16 changed files with 215 additions and 19 deletions

View file

@ -780,7 +780,7 @@ impl State {
pub fn ensure_map_workspace(&self, seat: Option<&Rc<WlSeatGlobal>>) -> Rc<WorkspaceNode> {
seat.cloned()
.or_else(|| self.seat_queue.last().map(|s| s.deref().clone()))
.map(|s| s.get_cursor_output())
.map(|s| s.get_fallback_output())
.or_else(|| self.root.outputs.lock().values().next().cloned())
.or_else(|| self.dummy_output.get())
.unwrap()
@ -916,7 +916,7 @@ impl State {
let ws = match self.workspaces.get(name) {
Some(ws) => ws,
_ => {
let output = output.unwrap_or_else(|| seat.get_cursor_output());
let output = output.unwrap_or_else(|| seat.get_fallback_output());
if output.is_dummy {
log::warn!("Not showing workspace because seat is on dummy output");
return;
@ -929,7 +929,7 @@ impl State {
pub fn float_map_ws(&self) -> Rc<WorkspaceNode> {
if let Some(seat) = self.seat_queue.last() {
let output = seat.get_cursor_output();
let output = seat.get_fallback_output();
if !output.is_dummy {
return output.ensure_workspace();
}