-
-
Notifications
You must be signed in to change notification settings - Fork 31
[idle detection] wayland check might not be accurate #168
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Hey! Lovely work on your app! I am personally building my own Breaktimer app using rust, and i needed a user idle feature. I realized there's a user-idle crate but it's missing wayland support so i tried to build my own, but then I stumbled upon your implementation, which was superb! Sorry for yanking it 😄
TLDR; While testing your logic for the is_wayland fn, I realized there is a bug in it.
Please correct me if I'm wrong, but I believe the logic on here should be:
if let Ok(true) = env::var("XDG_SESSION_TYPE").map(|v| v == "wayland") {
instead of:
if let Ok(_) = env::var("XDG_SESSION_TYPE").map(|v| v == "wayland") {
To basically check the boolean, as the 2nd approach simply ignores any returned value. I am new to rust and this is my first project so I may be drastically wrong.
On the off chance that I'm right, I'm happy to open a PR to fix it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working