Skip to content

libobs: Fix Wayland push to talk (sort of)#13387

Open
thomasza92 wants to merge 1 commit intoobsproject:masterfrom
thomasza92:fix-wayland-ptt
Open

libobs: Fix Wayland push to talk (sort of)#13387
thomasza92 wants to merge 1 commit intoobsproject:masterfrom
thomasza92:fix-wayland-ptt

Conversation

@thomasza92
Copy link
Copy Markdown

@thomasza92 thomasza92 commented May 2, 2026

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

  • Bug fix (non-breaking change which fixes an issue)

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:

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

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.
@suogesi
Copy link
Copy Markdown

suogesi commented May 2, 2026

Possibly coflict with this: #13363. It completely refactored handle_binding. Would you like to discuss this with me?

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.

2 participants