libobs: Fix Wayland push to talk (sort of)#13387
Open
thomasza92 wants to merge 1 commit intoobsproject:masterfrom
Open
libobs: Fix Wayland push to talk (sort of)#13387thomasza92 wants to merge 1 commit intoobsproject:masterfrom
thomasza92 wants to merge 1 commit intoobsproject:masterfrom
Conversation
Querying global key state is sometimes unreliable, so unknown polling states should not be treated the same as a released hotkey. Added a pressed-state enum in order to distinguish between pressed, released, and unknown key states.
|
Possibly coflict with this: #13363. It completely refactored |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Querying global key state is sometimes unreliable, so unknown states should not be treated the same as a released hotkey.
Added a pressed-state enum in order to distinguish between pressed, released, and unknown key states.
Motivation and Context
I initially ran into this issue while trying to setup OBS with Arch using Wayland. I quickly found that I could not get push to talk working correctly. I checked the open issues and saw that there were at least two I could find which I believe were describing the same problem I was experiencing (#10701 #13169).
This comment is what I based my fix on: #10701 (comment)
While I was testing the fix I also ran into this same issue on macOS when building from source at the current latest commit (085a51a). Perhaps someone can further verify that this problem exists there. I originally planned to gate the changes behind checks for linux and wayland but since it was causing problems for me on macOS as well I opted for the following changes instead.
Note that this PR touches several different files and deals with some core functionality of OBS. That being said, I tried to keep the changes as minimal as possible. Any further discussion or suggestion on edits would be greatly appreciated.
How Has This Been Tested?
I tested this on Arch Linux, Windows 11, and macOS, all of which seemed to work fine, but I think more testing should definitely be done.
Types of changes
This PR does NOT fix the issue of hotkeys not working on Wayland when the window is not in focus!!
I believe the only way to fix that issue would be to integrate OBS with Global Shortcuts through XDG Desktop Portal. That is a much bigger change and is probably beyond my capabilities.
Checklist: