Skip to content

libobs: Fix error when used with wayland multi-seat #12293

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidedmundson
Copy link
Contributor

Description

libobs has a callback when the capability of any seat is announced. It checks the capabilities of that seat, but then fetches the keyboard of the last announced seat. This would break is the first announced seat only has a pointer, and a second seat had a keyboard.

Keyboard removal with multi-seat is broken and not addressed in this patch, but it won't crash.

Motivation and Context

I had a bug filed against Qt, the author there posts the crash https://bugreports.qt.io/browse/QTBUG-137374

How Has This Been Tested?

It has not.

Types of changes

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

Checklist:

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

libobs has a callback when the capability of any seat is announced.
It checks the capabilities of that seat, but then fetches the keyboard
of the last announced seat. This would break is the first announced seat
only has a pointer, and a second seat had a keyboard.

Keyboard removal with multi-seat is broken and not addressed in this
patch, but it won't crash.
@kkartaltepe
Copy link
Collaborator

Thanks for investigating. This code probably needs to be cleaned up further to deal with multi-seat users. As it will just unbind the keyboard if a later seat does not have a keyboard becoming useless, if you are interested in that. Or i can pick it up if you are not.

@davidedmundson
Copy link
Contributor Author

Thanks for investigating. This code probably needs to be cleaned up further to deal with multi-seat users.

Yeah, definitely. Arguably you'd want to sniff every key on every keyboard.

As it will just unbind the keyboard if a later seat does not have a keyboard becoming useless

We also need to handle the seat being removed, that should also release the relevant keyboard.

if you are interested in that. Or i can pick it up if you are not.

It would be great if you could pick it up please. Feel free to close this.

Let me know if there's anything I could add in Qt that would make this easier.

@chronically-late
Copy link

I reported the original issue here (#12237)
I've tested it with this commit and it works/obs starts without issue.

Thank you @davidedmundson!

@kkartaltepe
Copy link
Collaborator

I reported the original issue here (#12237) I've tested it with this commit and it works/obs starts without issue.

Thank you @davidedmundson!

If you can test, #12302 should do the same thing.

Yeah, definitely. Arguably you'd want to sniff every key on every keyboard.

You dont need to sell me on X11.

@WizardCM WizardCM added Bug Fix Non-breaking change which fixes an issue Linux Affects Linux labels Jun 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue Linux Affects Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants