Fix unspecified wayland/x11 dep from clipboard feature #5478
+38
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
wayland
feature is disabled. #4538As 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 thearboard
crate (which supports all non-wayland systems except android) and thesmithay-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 bothclipboard
andwayland
are enabled. As such, we should enable the entire wayland feature whensmithay-clipboard
is enabled (because it effectively already does this) and default to justarboard
-- while providing features for both nonwayland and wayland targets.While
clipboard-nonwayland
andclipboard-wayland
aren't ideal nomenclature, it seems like the most clear option IMO. Alternatively, we could haveclipboard
default to justarboard
, but then you would need the user to realize if they are only targeting wayland, they should disable theclipboard
feature, and only enable theclipboard-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).