Skip to content

Enable Qt message loop on Linux#447

Merged
RytoEX merged 1 commit into
obsproject:masterfrom
tytan652:enable_qt_loop_on_linux
Aug 22, 2024
Merged

Enable Qt message loop on Linux#447
RytoEX merged 1 commit into
obsproject:masterfrom
tytan652:enable_qt_loop_on_linux

Conversation

@tytan652

@tytan652 tytan652 commented Aug 1, 2024

Copy link
Copy Markdown
Contributor

Description

Fixes obsproject/obs-studio#7146 for normally any CEF build.

This fixes issues cause by building CEF with use_gtk=true which is the default.

Motivation and Context

We built CEF with use_gtk=false to avoid having collision between Qt and CEF using the Glib event loop.
Using the Qt loop avoids this collision to ever happen.

How Has This Been Tested?

Type (keyboard) in a custom browser dock, a crash should occur with use_gtk=true with no Qt loop.

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.
  • I have included updates to all appropriate documentation.

This fixes issues cause by building CEF with use_gtk=true which is the default.
@kkartaltepe

Copy link
Copy Markdown
Contributor

thought we tried this and it didnt work to prevent gtk widgets from murdering cef.

@tytan652

tytan652 commented Aug 1, 2024

Copy link
Copy Markdown
Contributor Author

use_gtk=false was mainly added to fix obsproject/obs-studio#7146 caused by CEF(/GTK) messing with Glib default loop which is used by Qt.

If this does not work in the long term, a MainMessageLoop (like MainMessageLoopMultithreadedGtk in cefclient) would need to be implemented to be sure that CEF does not use the GLib default context directly.

@WizardCM WizardCM self-requested a review August 4, 2024 00:12
@WizardCM WizardCM added the kind/bug Categorizes issue or PR as related to a bug. label Aug 4, 2024
@RytoEX

RytoEX commented Aug 21, 2024

Copy link
Copy Markdown
Member

Is this change compatible with CEF 103/5060 as well as CEF 126+?

@tytan652

tytan652 commented Aug 22, 2024

Copy link
Copy Markdown
Contributor Author

Tested with https://cef-builds.spotifycdn.com/cef_binary_103.0.12%2Bg8eb56c7%2Bchromium-103.0.5060.134_linux64_minimal.tar.bz2 (so use_gtk=true)

And the keyboard crash does not occur, and look like it works.

Edit: It was mainly tested with CEF 126/127.

@RytoEX RytoEX left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tentatively seems fine to me.

@RytoEX RytoEX merged commit 98d94a4 into obsproject:master Aug 22, 2024
@tytan652 tytan652 deleted the enable_qt_loop_on_linux branch August 22, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Categorizes issue or PR as related to a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Typing anything on a keyboard within browser panel in focus causes OBS to close

4 participants