obs-studio
obs-studio copied to clipboard
libobs/util: Improve inhibit functions on Linux
Description
Avoid creating the screensaver inhibitor thread when another method has been applied.
Make inhibition unavailable in a Flatpak if portal is not available.
Motivation and Context
- If the Portal or the D-Bus method is in place, adding the xdg-screensaver thread is overkill. It should be just a fallback.
- Flatpak only support the Portal method, so spamming xdg-screensaver will do nothing
How Has This Been Tested?
Types of changes
- Bug fix (non-breaking change which fixes an issue)
- 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.
- [ ] The code has been tested.
- [x] All commit messages are properly formatted and commits squashed where appropriate.
- [x] I have included updates to all appropriate documentation.