obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

libobs: Avoid xdg-screensaver log spam

Open kamalmostafa opened this issue 1 year ago • 4 comments

Description

On systems without xdg-screensaver installed, the screensaver_thread whines every 30 seconds as it repeatedly tries and fails to execute it, resulting in this log spam:

warning: Failed to create xdg-screensaver: 2
warning: Failed to create xdg-screensaver: 2
warning: Failed to create xdg-screensaver: 2
...

Instead, verify that xdg-screensaver can be executed before starting the screensaver_thread. The (corrected) warning message appears only once if it can't, e.g.:

warning: Failed to reset xdg-screensaver: No such file or directory

Motivation and Context

Closes: obsproject/obs-studio#5479

How Has This Been Tested?

Manual testing on an installation without xdg-screensaver installed; logfile inspection.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)
  • Performance enhancement (non-breaking change which improves efficiency)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [ ] I have included updates to all appropriate documentation.

kamalmostafa avatar Aug 06 '24 06:08 kamalmostafa

This is not a fix for #9968, 9968 is in a Flatpak context.

It does fix the spam issue outside of one if the xdg-screensaver method is chosen and does not work, but the right fix inside a Flatpak is #10751. So just unlink the issue.

tytan652 avatar Aug 06 '24 06:08 tytan652

This is not a fix for #9968, 9968 is in a Flatpak context.

Dropped that Closes reference from the commit and PR description.

kamalmostafa avatar Aug 06 '24 06:08 kamalmostafa

Is this still needed after the improved selection from #10751 ?

kkartaltepe avatar Oct 05 '24 00:10 kkartaltepe

Is this still needed after the improved selection from #10751 ?

If fixes the log spam if we fallback to the xdg-screensaver method and is not functional.

tytan652 avatar Oct 05 '24 04:10 tytan652