From 0af93f816d3334d87c1fd481652cac764fd034af Mon Sep 17 00:00:00 2001 From: Bettehem Date: Wed, 17 Aug 2022 15:13:01 +0300 Subject: [PATCH] Fixed clipboard not working on GNOME Wayland. --- src/sharing.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/sharing.rs b/src/sharing.rs index 4adc9f5..18644e4 100644 --- a/src/sharing.rs +++ b/src/sharing.rs @@ -34,7 +34,13 @@ fn is_wayland() -> bool { fn gdk_backend() -> String { env::var("GDK_BACKEND").unwrap_or_default() } - session_type().as_str() == "wayland" || !wl_display().is_empty() || gdk_backend() == "wayland" + fn current_desktop() -> String { + env::var("XDG_CURRENT_DESKTOP").unwrap_or_default() + } + current_desktop() != "GNOME" + && (session_type().as_str() == "wayland" + || !wl_display().is_empty() + || gdk_backend() == "wayland") } #[cfg(not(feature = "share_selection"))]