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

Fix unspecified wayland/x11 dep from clipboard feature #5478

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

xangelix
Copy link
Contributor

@xangelix xangelix commented Dec 15, 2024

As far as I can tell, it's not actually possible for an eframe native application to build without wayland, and as a result, target the xwayland compositor option by default, at the moment. If you enable only the x11 feature and run your application on a wayland machine, you will see that it still has been built with, and fully supports the wayland compositor, as if the feature had been enabled.

This is because the clipboard feature in egui-winit requires both the arboard crate (which supports all non-wayland systems except android) and the smithay-clipboard crate which supports only wayland systems.

This causes an annoying issue with the features as they can only be additive with the current Cargo.toml spec. We cannot enable the smithay-clipboard feature only if both clipboard and wayland are enabled. As such, we should enable the entire wayland feature when smithay-clipboard is enabled (because it effectively already does this) and default to just arboard-- while providing features for both nonwayland and wayland targets.

While clipboard-nonwayland and clipboard-wayland aren't ideal nomenclature, it seems like the most clear option IMO. Alternatively, we could have clipboard default to just arboard, but then you would need the user to realize if they are only targeting wayland, they should disable the clipboard feature, and only enable the clipboard-wayland feature.

Of course, open to alternatives if someone can think of something cleaner, but I think this is significantly better than forcing wayland to be included at the moment (especially since winit's x11/wayland implementations are quite far from feature parity).

@xangelix xangelix marked this pull request as draft December 15, 2024 20:23
Copy link

Preview available at https://egui-pr-preview.github.io/pr/5478-linux-compositor-dep-isolation
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@xangelix xangelix marked this pull request as ready for review December 15, 2024 21:26
@xangelix xangelix force-pushed the linux-compositor-dep-isolation branch from 526b3f5 to 288ccb6 Compare December 18, 2024 18:31
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.

Wayland dependencies are pulled in for eframe, even when wayland feature is disabled.
1 participant