command/input: add map-to-output

This commit is contained in:
LordMZTE
2024-02-20 21:54:06 +01:00
committed by Isaac Freund
parent 95da9b5875
commit 0cb7c49cc3
9 changed files with 92 additions and 18 deletions

View File

@ -138,6 +138,19 @@ pub fn inputAllowed(self: Self, wlr_surface: *wlr.Surface) bool {
true;
}
/// Reconfigures all devices' libinput configuration as well as their output mapping.
/// This is called on outputs being added or removed and on the input configuration being changed.
pub fn reconfigureDevices(self: *Self) void {
var it = self.devices.iterator(.forward);
while (it.next()) |device| {
for (self.configs.items) |config| {
if (@import("globber").match(device.identifier, config.glob)) {
config.apply(device);
}
}
}
}
fn handleNewInput(listener: *wl.Listener(*wlr.InputDevice), wlr_device: *wlr.InputDevice) void {
const self = @fieldParentPtr(Self, "new_input", listener);