From 6ac3928556af555df7572e6b2f6ff32ba0be1d68 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sat, 24 Dec 2022 18:18:09 +0100 Subject: [PATCH] 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. --- deps/zig-wlroots | 2 +- river/IdleInhibitorManager.zig | 6 ++---- river/InputManager.zig | 4 ++-- river/Seat.zig | 2 +- river/Server.zig | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/deps/zig-wlroots b/deps/zig-wlroots index b485332..6c5a550 160000 --- a/deps/zig-wlroots +++ b/deps/zig-wlroots @@ -1 +1 @@ -Subproject commit b485332edb2bfc8db42d474a019e7df835a7d1be +Subproject commit 6c5a55081ead808496e76d535b9de4e8cdef00c3 diff --git a/river/IdleInhibitorManager.zig b/river/IdleInhibitorManager.zig index 88ba041..184dbdb 100644 --- a/river/IdleInhibitorManager.zig +++ b/river/IdleInhibitorManager.zig @@ -13,11 +13,9 @@ const IdleInhibitor = @import("IdleInhibitor.zig"); idle_inhibit_manager: *wlr.IdleInhibitManagerV1, new_idle_inhibitor: wl.Listener(*wlr.IdleInhibitorV1), 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 = idle; self.new_idle_inhibitor.setNotify(handleNewIdleInhibitor); 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 { diff --git a/river/InputManager.zig b/river/InputManager.zig index 08e3858..44f6ac3 100644 --- a/river/InputManager.zig +++ b/river/InputManager.zig @@ -39,7 +39,7 @@ const log = std.log.scoped(.input_manager); new_input: wl.Listener(*wlr.InputDevice) = wl.Listener(*wlr.InputDevice).init(handleNewInput), -idle: *wlr.Idle, +idle_notifier: *wlr.IdleNotifierV1, pointer_constraints: *wlr.PointerConstraintsV1, relative_pointer_manager: *wlr.RelativePointerManagerV1, virtual_pointer_manager: *wlr.VirtualPointerManagerV1, @@ -64,7 +64,7 @@ pub fn init(self: *Self) !void { self.* = .{ // 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), .relative_pointer_manager = try wlr.RelativePointerManagerV1.create(server.wl_server), .virtual_pointer_manager = try wlr.VirtualPointerManagerV1.create(server.wl_server), diff --git a/river/Seat.zig b/river/Seat.zig index 1ffddaa..05110ce 100644 --- a/river/Seat.zig +++ b/river/Seat.zig @@ -326,7 +326,7 @@ pub fn focusOutput(self: *Self, output: *Output) 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 { diff --git a/river/Server.zig b/river/Server.zig index ab1e294..c3ce236 100644 --- a/river/Server.zig +++ b/river/Server.zig @@ -128,7 +128,7 @@ pub fn init(self: *Self) !void { try self.control.init(); try self.status_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(); // These all free themselves when the wl_server is destroyed