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

Listen to org.freedesktop.ScreenSaver events #300

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

oz123
Copy link

@oz123 oz123 commented Jun 21, 2024

This fixes #57.

@lukefromdc lukefromdc requested a review from a team January 9, 2025 18:15
@lukefromdc
Copy link
Member

I don't really have a good way to test this given both my setup and workflow

@oz123
Copy link
Author

oz123 commented Jan 9, 2025

I can build deb packages for you if it helps.
Testing is very easy. Start netflix or youtube in your browser, setup screensaver to start after 2 minutes.
You will notice that despite streaming video, the screensaver starts after 2 minutes.
When installing the packages with the patch, the screensaver will not start if you play video.

@lukefromdc
Copy link
Member

lukefromdc commented Jan 10, 2025 via email

@oz123
Copy link
Author

oz123 commented Jan 10, 2025

Thanks for the detailed explanation. As it seems, you are currently the only member with merge rights, so it's up to you.
I am able to set a virtual machine for you to connect with a VNC so you can test this.

@lukefromdc
Copy link
Member

lukefromdc commented Jan 10, 2025 via email

@mmueller
Copy link

I've had this bookmarked for a while, and I just noticed the request for testers. I tried this on my system (Manjaro 24.2.1), built mate-common and mate-screensaver in ~/mate and ran mate-screensaver manually out of there. All of my other MATE packages are running out of the OS's maintained versions.

It works, but there is a quirk.

  • I set screensaver to kick on after 1 minute.
  • Power management is set to turn off display after 30 minutes.
  • If I idle for a minute, screensaver kicks on (fade to black then lock).
  • I confirmed that with my system's mate-screensaver, it still fades to black during the video and locks.
  • I killed the system mate-screensaver and ran my local build.
  • Now, if I idle while watching a Youtube video, screensaver does not kick in. (Nice!)
  • However, the quirk: If I pause the video and start doing anything else, about 3 seconds later, the screensaver activates. No fade out, just sudden black/locked screen.

I tested pausing with the trackpad and clicking, and using the keyboard (spacebar) and then typing away in another window, and it will literally lock the screen on me while I'm scrolling or typing.

Since I'm clicking and typing, I would expect the session to be considered active, not idle. I wonder if there's some race condition between "session is idle" flag being updated and the "screensaver is being suppressed right now" message from dbus?

It's not really the fault of this PR, but it's probably exposing something that has been wrong for a while. I'm curious, @oz123 do you see this behavior, too? Or maybe it's specific to something about my setup.

@lukefromdc
Copy link
Member

THANK YOU for testing! We now know this needs work before I can merge it. The bug you found is a nasty one and if it got into a release would require an emergency fix and re-release

@spixi
Copy link

spixi commented Jan 22, 2025

Please note, that we still have to listen for org.mate.ScreenSaver, because many third-party application will check for the DESKTOP_SESSION variable and will only send the org.mate.ScreenSaver events if they detect MATE.

@oz123
Copy link
Author

oz123 commented Jan 22, 2025

Please note, that we still have to listen for org.mate.ScreenSaver, because many third-party application will check for the DESKTOP_SESSION variable and will only send the org.mate.ScreenSaver events if they detect MATE.

Can you be more specific? Which many ?

Firefox\Chrome is not anymore.

@spixi
Copy link

spixi commented Jan 23, 2025

Please note, that we still have to listen for org.mate.ScreenSaver, because many third-party application will check for the DESKTOP_SESSION variable and will only send the org.mate.ScreenSaver events if they detect MATE.

Can you be more specific? Which many ?

Firefox\Chrome is not anymore.

You can blame me that I introduced this into PCSX2. Other projects can be found here (and this is only the list of projects which host their code on GitHub):
https://github.com/search?q=org.mate.ScreenSaver+DESKTOP_SESSION&type=code

@oz123
Copy link
Author

oz123 commented Jan 23, 2025

Oh. Crap. All those should just list to org.freedesktop.ScreenSaver. I can give it a try to listen on multiple event types.

@mmueller Unfortunately, I can't confirm the behavior you are describing...

@spixi
Copy link

spixi commented Jan 23, 2025

Oh. Crap. All those should just list to org.freedesktop.ScreenSaver. I can give it a try to listen on multiple event types.

@mmueller Unfortunately, I can't confirm the behavior you are describing...

Sometimes, the logic is more hidden, but yeah, we now have a chicken egg problem and should listen to both events. https://github.com/videolan/vlc/blob/5857e58efdf5aad7c20bbe19be897f2865053174/modules/misc/inhibit/dbus.c

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

Successfully merging this pull request may close these issues.

MATE ScreenScreensaver should implement "XDG" Idle Inhibition Service specification
4 participants