Skip to content
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

build-aux: Use fallback-x11 instead of x11 #9694

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

Etaash-mathamsetty
Copy link
Contributor

@Etaash-mathamsetty Etaash-mathamsetty commented Oct 11, 2023

Description

Fixes a warning when compiling/building the obs flatpak
fallback-x11 only enables x11 if the application doesn't use wayland, and instead falls back to x11. If the app uses wayland then the x11 socket is never made available I am assuming.

Motivation and Context

removes a warning

How Has This Been Tested?

Testing is unnecessary because it just uses the same behavior but removes a build time warning

Types of changes

Bug fix

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.

@derrod derrod requested a review from tytan652 October 11, 2023 20:58
@gxalpha
Copy link
Member

gxalpha commented Oct 11, 2023

Please adjust the commit message according to our commit guidelines.
Please also expand on the description/motivation here. How is fallback-x11 different from x11 (and in particular, why is it the correct fix)?, etc.

@GeorgesStavracas
Copy link
Member

The reason I specifically left x11 and not fallback-x11 is because some plugins may crash OBS if they can't connect to the X11 socket. One such example is the Input Overlay plugin.

Can you check if that's still the case?

@Etaash-mathamsetty
Copy link
Contributor Author

The reason I specifically left x11 and not fallback-x11 is because some plugins may crash OBS if they can't connect to the X11 socket. One such example is the Input Overlay plugin.

Can you check if that's still the case?

ah I didn't know about this

@GeorgesStavracas
Copy link
Member

It would still be fantastic to replace x11 with fallback-x11 though, so it's worth checking and maybe even reporting the crash to the plugin authors. But I'm afraid of other plugins that could crash as well. Also, @gxalpha's comment still applies, a more comprehensive commit message would be great to have as well.

@Etaash-mathamsetty
Copy link
Contributor Author

Etaash-mathamsetty commented Oct 11, 2023

It would still be fantastic to replace x11 with fallback-x11 though, so it's worth checking and maybe even reporting the crash to the plugin authors. But I'm afraid of other plugins that could crash as well. Also, @gxalpha's comment still applies, a more comprehensive commit message would be great to have as well.

Input overlay still uses x11, I am still wondering why they didn't use evdev though. It does need permissions, but polkit can handle that right?

@GeorgesStavracas
Copy link
Member

I don't think it's possible to install polkit rules or elevate permissions from a Flatpak sandbox

@tytan652
Copy link
Collaborator

tytan652 commented Oct 12, 2023

Input overlay still uses x11, I am still wondering why they didn't use evdev though. It does need permissions, but polkit can handle that right?

No, the author/maintainers of the plugin will have to find (or contribute to) a new way to do it without punching holes in the sandbox and relying on the x11 socket to work on both X11 and Wayland. (Or make the user modify the flatpak permission through a tutorial like some specific Flatpak extension does.)

If a plugin requires the x11 socket, it must be fixed to not make OBS crash under Wayland with no access to the x11 socket.

@WizardCM WizardCM added Bug Fix Non-breaking change which fixes an issue Enhancement Improvement to existing functionality and removed Bug Fix Non-breaking change which fixes an issue labels Oct 14, 2023
@tytan652
Copy link
Collaborator

tytan652 commented May 12, 2024

Tested with Flatseal, Input Overlay will/still crash with this kind of change.

@RytoEX
Copy link
Member

RytoEX commented May 14, 2024

cc @univrsal
See above about an issue we're seeing when trying to clean up our CI warnings.
If I had to guess, the issue is with libuiohook, but I haven't actually checked.

@univrsal
Copy link
Contributor

I'm pretty sure it's libuiohook. It could also be SLD2 but I assume that library behaves correctly. I can add a check and not start libuiohook if obs is running under wayland.

getenv("WAYLAND_DISPLAY") || obs_get_nix_platform() == OBS_NIX_PLATFORM_WAYLAND

Would either of these checks be enough?

@tytan652
Copy link
Collaborator

tytan652 commented May 15, 2024

@univrsal

You should check if you are on X11/Xorg since it's the only supported "platform" (and more future-proof).

obs_get_nix_platform() != OBS_NIX_PLATFORM_X11_EGL

We deprecated _GLX since a while so it can be ignored.

@univrsal
Copy link
Contributor

I've added the check. Seems to work from what I can tell but I can't test if it fixes the crash as I don't have the flatpak build.

@RytoEX
Copy link
Member

RytoEX commented Jun 1, 2024

@GeorgesStavracas Is this something we want to try out and see what breakages occur in the wild? If so, when would you feel it's appropriate to do so?

@GeorgesStavracas
Copy link
Member

I think we can try merging this right after the current release

@tytan652
Copy link
Collaborator

Blocked by #11019

@RytoEX RytoEX changed the title Use fallback-x11 instead of x11 for flatpak builds build-aux: Use fallback-x11 instead of x11 Sep 13, 2024
Copy link
Member

@RytoEX RytoEX left a comment

Choose a reason for hiding this comment

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

Approving based on prior conversation with @GeorgesStavracas .

@RytoEX RytoEX added this to the OBS Studio 31 milestone Sep 13, 2024
@RytoEX RytoEX merged commit 2a0e614 into obsproject:master Sep 13, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants