diff options
author | Giovanni Panozzo <giovanni@panozzo.it> | 2018-09-08 21:40:13 +0300 |
---|---|---|
committer | Giovanni Panozzo <giovanni@panozzo.it> | 2018-09-09 01:44:12 +0300 |
commit | 3b6e8df784a0adb578aed33c9f2a9dbec254f33b (patch) | |
tree | 0a7c16b6fb477fa60855c0b2eaf2a2451f7cdfb3 /src | |
parent | 9423342d793d38782f54ea668043f917aba0be24 (diff) |
Allow wayland backend again when GTK >= 3.22.27
Undo commit 5fa1132dac5d988130ce1f27c0b2edf69ed0ae1c because now,
under GTK 3.22.37, clibpoard owner-change signal seems to correctly
change the clipboard owner (see GTK fixed bug 790031).
Enabling Wayland will also fix keyboard grabbing of Windows/Super
key which cannot be grabbed under XWayland (issue #1395).
Diffstat (limited to 'src')
-rw-r--r-- | src/remmina.c | 7 | ||||
-rw-r--r-- | src/remmina_public.c | 27 | ||||
-rw-r--r-- | src/remmina_public.h | 1 |
3 files changed, 34 insertions, 1 deletions
diff --git a/src/remmina.c b/src/remmina.c index 0dc69df3e..eac14d790 100644 --- a/src/remmina.c +++ b/src/remmina.c @@ -267,7 +267,12 @@ int main(int argc, char* argv[]) const gchar *app_id; int status; - gdk_set_allowed_backends("x11,broadway,quartz,mir"); + /* Enable wayland backend only after GTK 3.22.27 or the clipboard + * will not work. See GTK bug 790031 */ + if (remmina_gtk_check_version(3,22,27)) + gdk_set_allowed_backends("wayland,x11,broadway,quartz,mir"); + else + gdk_set_allowed_backends("x11,broadway,quartz,mir"); remmina_masterthread_exec_save_main_thread_id(); diff --git a/src/remmina_public.c b/src/remmina_public.c index a26da37c7..d553a0951 100644 --- a/src/remmina_public.c +++ b/src/remmina_public.c @@ -700,3 +700,30 @@ int remmina_public_split_resolution_string(const char *resolution_string, int *w *h = lh; return 1; } + +/* Return TRUE if current gtk version library in use is greater or equal than + * the requered major.minor.micro */ +gboolean remmina_gtk_check_version(guint major, guint minor, guint micro) +{ + guint rtmajor, rtminor, rtmicro; + rtmajor = gtk_get_major_version(); + if (rtmajor > major) { + return TRUE; + }else if (rtmajor == major) { + rtminor = gtk_get_minor_version(); + if (rtminor > minor) { + return TRUE; + }else if (rtminor == minor) { + rtmicro = gtk_get_micro_version(); + if (rtmicro >= micro) { + return TRUE; + }else { + return FALSE; + } + }else { + return FALSE; + } + }else { + return FALSE; + } +} diff --git a/src/remmina_public.h b/src/remmina_public.h index ecbf96718..3031e29c4 100644 --- a/src/remmina_public.h +++ b/src/remmina_public.h @@ -116,3 +116,4 @@ gchar* remmina_public_str_replace(const gchar *string, const gchar *search, cons * and overwrites the original string */ gchar* remmina_public_str_replace_in_place(gchar *string, const gchar *search, const gchar *replacement); int remmina_public_split_resolution_string(const char *resolution_string, int *w, int *h); +gboolean remmina_gtk_check_version(guint major, guint minor, guint micro); |