1
0
Fork 0
forked from wry/wry

config: allow mapping input devices to outputs

This commit is contained in:
Julian Orth 2024-05-01 15:29:52 +02:00
parent efdca4de49
commit 86e283d255
18 changed files with 420 additions and 13 deletions

View file

@ -41,6 +41,7 @@ use {
zwp_primary_selection_source_v1::ZwpPrimarySelectionSourceV1,
DynDataSource, IpcError,
},
wl_output::WlOutputGlobal,
wl_seat::{
gesture_owner::GestureOwnerHolder,
kb_owner::KbOwnerHolder,
@ -1163,4 +1164,17 @@ impl DeviceHandlerData {
seat.handle_xkb_state_change(&old.borrow(), &new.borrow());
}
}
pub fn set_output(&self, output: Option<&WlOutputGlobal>) {
match output {
None => {
log::info!("Removing output mapping of {}", self.device.name());
self.output.take();
}
Some(o) => {
log::info!("Mapping {} to {}", self.device.name(), o.connector.name);
self.output.set(Some(o.opt.clone()));
}
}
}
}