According to wl_clipboard_rs that crate should not be used for applications that have a window, instead it recommends using smithay-clipboard. I suggest a new api be added that supports that, for example:
let display_handle = ...;
let mut clipboard = Clipboard::with_wl_surface( display_handle);
Alternatively, most people will likely be using winit to handle creating and managing a window, so it could be used as an optional dependency, and have api something like:
let mut clipboard = Clipboard::with_window(&window);
In this example Clipboard itself could detect whether or not it's running on wayland and decide whether to use the window handle.
Implementing this will allow the application to work on more compositors, without the need to resort to xwayland.
According to
wl_clipboard_rsthat crate should not be used for applications that have a window, instead it recommends usingsmithay-clipboard. I suggest a new api be added that supports that, for example:Alternatively, most people will likely be using
winitto handle creating and managing a window, so it could be used as an optional dependency, and have api something like:In this example
Clipboarditself could detect whether or not it's running on wayland and decide whether to use the window handle.Implementing this will allow the application to work on more compositors, without the need to resort to xwayland.