Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore_dbus_inhibit = false doesn't work #8

Closed
grappas opened this issue Feb 18, 2024 · 14 comments
Closed

ignore_dbus_inhibit = false doesn't work #8

grappas opened this issue Feb 18, 2024 · 14 comments

Comments

@grappas
Copy link
Contributor

grappas commented Feb 18, 2024

It seems that it hooks to it correctly, but does nothing with it:

[LOG] Idled: rule 60ff7bf8ec40                                                                                                                                                             ─╯
[LOG] Running hyprctl dispatch dpms off
[LOG] Executing hyprctl dispatch dpms off
[LOG] Process Created with pid 212972
ok
[LOG] Resumed: rule 60ff7bf8ec40
[LOG] Running notify-send "Welcome back!"
[LOG] Executing notify-send "Welcome back!"
[LOG] Process Created with pid 213939
[LOG] ScreenSaver inhibit: true dbus message from  with content video-playing
[LOG] Inhibit locks: 1
[LOG] Cookie 1337 sent
[LOG] Idled: rule 60ff7bf8ec40
[LOG] Running hyprctl dispatch dpms off
[LOG] Executing hyprctl dispatch dpms off

and arms idle anyway.

[LOG] Resumed: rule 62c5a9214c40
[LOG] Running notify-send "Welcome back!"
[LOG] Executing notify-send "Welcome back!"
[LOG] Process Created with pid 3597785
[LOG] ScreenSaver inhibit: true dbus message from Steam with content Client interface
[LOG] Inhibit locks: 1
[LOG] Cookie 1337 sent
[WARN] No cookie in uninhibit
[LOG] ScreenSaver inhibit: false dbus message from ? with content ?
[LOG] Inhibit locks: 0
[WARN] No cookie in uninhibit
[LOG] ScreenSaver inhibit: false dbus message from ? with content ?
[WARN] BUG THIS: inhibit locks < 0
[LOG] ScreenSaver inhibit: true dbus message from Steam with content Client interface
[LOG] Inhibit locks: 0
[LOG] Cookie 1338 sent
[WARN] No cookie in uninhibit
[LOG] ScreenSaver inhibit: false dbus message from ? with content ?
[WARN] BUG THIS: inhibit locks < 0
[LOG] ScreenSaver inhibit: true dbus message from Steam with content Client interface
[LOG] Inhibit locks: 0
[LOG] Cookie 1339 sent
[WARN] No cookie in uninhibit
[LOG] ScreenSaver inhibit: false dbus message from ? with content ?
[WARN] BUG THIS: inhibit locks < 0

very last commit.

@vaxerski
Copy link
Member

vaxerski commented Feb 18, 2024

right. Fixed in afcef91

Also the fuck is steam doing here?

@grappas
Copy link
Contributor Author

grappas commented Feb 18, 2024

yeaaaa...
now:

[WARN] No cookie in uninhibit
[LOG] ScreenSaver inhibit: false dbus message from ? with content ?
[LOG] Inhibit locks: 0
[LOG] ScreenSaver inhibit: true dbus message from  with content video-playing
[LOG] Inhibit locks: 1
[LOG] Cookie 1338 sent
[LOG] Idled: rule 62a430eb4c40
[LOG] Ignoring, inhibit locks: 1
[WARN] No cookie in uninhibit
[LOG] ScreenSaver inhibit: false dbus message from ? with content ?
[LOG] Inhibit locks: 0

After yt video stopped playback (by itself) it seems to be treated as idle command is already armed (but it doesn't) or it just does not. I have to reset timer (with mouse/keyboard):

[LOG] Idled: rule 62a430eb4c40                                                                                                                                                             
[LOG] Running hyprctl dispatch dpms off
[LOG] Executing hyprctl dispatch dpms off
[LOG] Process Created with pid 1370790
ok
[LOG] Resumed: rule 62a430eb4c40
[LOG] Running notify-send "Welcome back!"
[LOG] Executing notify-send "Welcome back!"
[LOG] Process Created with pid 1371492

@grappas
Copy link
Contributor Author

grappas commented Feb 18, 2024

and again:

[WARN] No cookie in uninhibit                                                                                                                                                              ─╯
[LOG] ScreenSaver inhibit: false dbus message from ? with content ?
[WARN] BUG THIS: inhibit locks < 0
[LOG] ScreenSaver inhibit: true dbus message from  with content video-playing
[LOG] Inhibit locks: 0
[LOG] Cookie 1342 sent
[WARN] No cookie in uninhibit
[LOG] ScreenSaver inhibit: false dbus message from ? with content ?
[WARN] BUG THIS: inhibit locks < 0
[LOG] ScreenSaver inhibit: true dbus message from  with content video-playing
[LOG] Inhibit locks: 0
[LOG] Cookie 1343 sent
[WARN] No cookie in uninhibit
[LOG] ScreenSaver inhibit: false dbus message from ? with content ?
[WARN] BUG THIS: inhibit locks < 0
[LOG] ScreenSaver inhibit: true dbus message from  with content video-playing
[LOG] Inhibit locks: 0
[LOG] Cookie 1344 sent

@grappas
Copy link
Contributor Author

grappas commented Feb 18, 2024

Ok. [WARN] BUG THIS: inhibit locks < 0 appears only if there's already some playback on hypridle launch.

@vaxerski
Copy link
Member

I guess we should clamp it at 0 then instead of allowing it to go negative

@grappas
Copy link
Contributor Author

grappas commented Feb 18, 2024

Yes and no. What - for some borderline cases - when it would stood at i.e. +1 indefinitely?

@vaxerski
Copy link
Member

err, only for negatives...

@vaxerski
Copy link
Member

vaxerski commented Feb 18, 2024

patch.txt
try this

@grappas
Copy link
Contributor Author

grappas commented Feb 19, 2024

Get some sleep vax xD

@grappas
Copy link
Contributor Author

grappas commented Feb 19, 2024

How about this?
#11

@grappas
Copy link
Contributor Author

grappas commented Feb 19, 2024

Here's the problem:
Time's not up:
onResume() is armed:

[LOG] Resumed: rule 5d1e367e9c20
[LOG] Ignoring from onResumed(), inhibit locks: 1

Time is up: onIdle() is armed:

[LOG] Idled: rule 5d1e367e9c20
[LOG] Ignoring from onIdled(), inhibit locks: 1

But if no input is given while i.e. yt video is done playing spawn(pListener->onTimeout); is never executed:

[WARN] No cookie in uninhibit
[LOG] ScreenSaver inhibit: false dbus message from ? with content ?
[LOG] Inhibit locks: 0

When we give some input:

[LOG] Resumed: rule 5d1e367e9c20
[LOG] Running notify-send "Welcome back!"
[LOG] Executing notify-send "Welcome back!"
[LOG] Process Created with pid 580795

It has to be some way to:
make onInhibt() handle this if onIdled() is armed, to do it again.
obraz
C++

@vaxerski
Copy link
Member

what? I dont understand

@grappas
Copy link
Contributor Author

grappas commented Feb 19, 2024

When onIdled() executes while inhibit > 0, spawn(pListener->onTimeout); (from onIdled()) will never execute.
In other words dpms will never go off until you give some input and reset timeout.

In other words: you watch youtube, fall asleep, your monitor is on all night, even though the video is long done playing. ¯\_(ツ)_/¯

@grappas
Copy link
Contributor Author

grappas commented Feb 27, 2024

Could you review the code I PRed?

@grappas grappas closed this as completed Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants