Implement libinput device configuration
We need to defer config application to the first manage_start event using a should_manage flag so that all *_support events have arrived before we try applying the configs This commit also has two other fixes - fixes a potential use-after-free by telling InputDevice when a LibinputDevice is .removed. - fix logFn (removed "if (scope != .default) return;") I used kwm to help figure out the manage pattern for the input config. Link to kwm: https://github.com/kewuaa/kwm
This commit is contained in:
parent
3ce98712df
commit
296f875993
5 changed files with 184 additions and 22 deletions
12
src/main.zig
12
src/main.zig
|
|
@ -213,11 +213,11 @@ var runtime_log_level: std.log.Level = switch (builtin.mode) {
|
|||
.ReleaseSafe, .ReleaseFast, .ReleaseSmall => .info,
|
||||
};
|
||||
|
||||
// pub const std_options: std.Options = .{
|
||||
// // Tell std.log to leave all log level filtering to us.
|
||||
// .log_level = .debug,
|
||||
// .logFn = logFn,
|
||||
// };
|
||||
pub const std_options: std.Options = .{
|
||||
// Tell std.log to leave all log level filtering to us.
|
||||
.log_level = .debug,
|
||||
.logFn = logFn,
|
||||
};
|
||||
|
||||
pub fn logFn(
|
||||
comptime level: std.log.Level,
|
||||
|
|
@ -227,8 +227,6 @@ pub fn logFn(
|
|||
) void {
|
||||
if (@intFromEnum(level) > @intFromEnum(runtime_log_level)) return;
|
||||
|
||||
if (scope != .default) return;
|
||||
|
||||
const scope_prefix = if (scope == .default) ": " else "(" ++ @tagName(scope) ++ "): ";
|
||||
|
||||
stderr.print(level.asText() ++ scope_prefix ++ format ++ "\n", args) catch return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue