idle: support ext-idle-notify-v1, drop KDE protocol

This commit is a breaking change as it drops support for the now
obsolete org_kde_kwin_idle protocol.
This commit is contained in:
Isaac Freund 2022-12-24 18:18:09 +01:00
parent 05c9194eba
commit 6ac3928556
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11
5 changed files with 7 additions and 9 deletions

2
deps/zig-wlroots vendored

@ -1 +1 @@
Subproject commit b485332edb2bfc8db42d474a019e7df835a7d1be Subproject commit 6c5a55081ead808496e76d535b9de4e8cdef00c3

View File

@ -13,11 +13,9 @@ const IdleInhibitor = @import("IdleInhibitor.zig");
idle_inhibit_manager: *wlr.IdleInhibitManagerV1, idle_inhibit_manager: *wlr.IdleInhibitManagerV1,
new_idle_inhibitor: wl.Listener(*wlr.IdleInhibitorV1), new_idle_inhibitor: wl.Listener(*wlr.IdleInhibitorV1),
inhibitors: std.TailQueue(IdleInhibitor) = .{}, inhibitors: std.TailQueue(IdleInhibitor) = .{},
idle: *wlr.Idle,
pub fn init(self: *Self, idle: *wlr.Idle) !void { pub fn init(self: *Self) !void {
self.idle_inhibit_manager = try wlr.IdleInhibitManagerV1.create(server.wl_server); self.idle_inhibit_manager = try wlr.IdleInhibitManagerV1.create(server.wl_server);
self.idle = idle;
self.new_idle_inhibitor.setNotify(handleNewIdleInhibitor); self.new_idle_inhibitor.setNotify(handleNewIdleInhibitor);
self.idle_inhibit_manager.events.new_inhibitor.add(&self.new_idle_inhibitor); self.idle_inhibit_manager.events.new_inhibitor.add(&self.new_idle_inhibitor);
} }
@ -48,7 +46,7 @@ pub fn idleInhibitCheckActive(self: *Self) void {
} }
} }
self.idle.setEnabled(null, !inhibited); server.input_manager.idle_notifier.setInhibited(inhibited);
} }
fn handleNewIdleInhibitor(listener: *wl.Listener(*wlr.IdleInhibitorV1), inhibitor: *wlr.IdleInhibitorV1) void { fn handleNewIdleInhibitor(listener: *wl.Listener(*wlr.IdleInhibitorV1), inhibitor: *wlr.IdleInhibitorV1) void {

View File

@ -39,7 +39,7 @@ const log = std.log.scoped(.input_manager);
new_input: wl.Listener(*wlr.InputDevice) = wl.Listener(*wlr.InputDevice).init(handleNewInput), new_input: wl.Listener(*wlr.InputDevice) = wl.Listener(*wlr.InputDevice).init(handleNewInput),
idle: *wlr.Idle, idle_notifier: *wlr.IdleNotifierV1,
pointer_constraints: *wlr.PointerConstraintsV1, pointer_constraints: *wlr.PointerConstraintsV1,
relative_pointer_manager: *wlr.RelativePointerManagerV1, relative_pointer_manager: *wlr.RelativePointerManagerV1,
virtual_pointer_manager: *wlr.VirtualPointerManagerV1, virtual_pointer_manager: *wlr.VirtualPointerManagerV1,
@ -64,7 +64,7 @@ pub fn init(self: *Self) !void {
self.* = .{ self.* = .{
// These are automatically freed when the display is destroyed // These are automatically freed when the display is destroyed
.idle = try wlr.Idle.create(server.wl_server), .idle_notifier = try wlr.IdleNotifierV1.create(server.wl_server),
.pointer_constraints = try wlr.PointerConstraintsV1.create(server.wl_server), .pointer_constraints = try wlr.PointerConstraintsV1.create(server.wl_server),
.relative_pointer_manager = try wlr.RelativePointerManagerV1.create(server.wl_server), .relative_pointer_manager = try wlr.RelativePointerManagerV1.create(server.wl_server),
.virtual_pointer_manager = try wlr.VirtualPointerManagerV1.create(server.wl_server), .virtual_pointer_manager = try wlr.VirtualPointerManagerV1.create(server.wl_server),

View File

@ -326,7 +326,7 @@ pub fn focusOutput(self: *Self, output: *Output) void {
} }
pub fn handleActivity(self: Self) void { pub fn handleActivity(self: Self) void {
server.input_manager.idle.notifyActivity(self.wlr_seat); server.input_manager.idle_notifier.notifyActivity(self.wlr_seat);
} }
pub fn handleViewMap(self: *Self, view: *View) !void { pub fn handleViewMap(self: *Self, view: *View) !void {

View File

@ -128,7 +128,7 @@ pub fn init(self: *Self) !void {
try self.control.init(); try self.control.init();
try self.status_manager.init(); try self.status_manager.init();
try self.layout_manager.init(); try self.layout_manager.init();
try self.idle_inhibitor_manager.init(self.input_manager.idle); try self.idle_inhibitor_manager.init();
try self.lock_manager.init(); try self.lock_manager.init();
// These all free themselves when the wl_server is destroyed // These all free themselves when the wl_server is destroyed