diff options
author | William Wold <[email protected]> | 2020-09-13 23:29:48 -0700 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-09-27 10:59:27 +0200 |
commit | 1d4048e1d057841dd5fa4d3eebc721da3fc38ccd (patch) | |
tree | b9d9f1946f6d324f18f5151d5eb8d3f561cff23d | |
parent | fa8759fc6c94cfb4d66f44580ed3960daeb9a2a2 (diff) | |
download | mate-panel-1d4048e1d057841dd5fa4d3eebc721da3fc38ccd.tar.bz2 mate-panel-1d4048e1d057841dd5fa4d3eebc721da3fc38ccd.tar.xz |
Use gdk_set_allowed_backends () instead of custom check
-rw-r--r-- | mate-panel/main.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/mate-panel/main.c b/mate-panel/main.c index db1fafb4..15b7303d 100644 --- a/mate-panel/main.c +++ b/mate-panel/main.c @@ -104,6 +104,14 @@ main (int argc, char **argv) g_option_context_add_group (context, gtk_get_option_group (TRUE)); g_option_context_add_main_entries (context, options, GETTEXT_PACKAGE); + #if defined(HAVE_X11) && defined(HAVE_WAYLAND) + gdk_set_allowed_backends ("wayland,x11"); + #elif defined(HAVE_WAYLAND) + gdk_set_allowed_backends ("wayland"); + #else + gdk_set_allowed_backends ("x11"); + #endif + gtk_init (&argc, &argv); error = NULL; @@ -183,25 +191,12 @@ main (int argc, char **argv) (GFunc)panel_widget_add_forbidden, NULL); - gboolean found_backend = FALSE; - -#ifdef HAVE_WAYLAND - if (GDK_IS_WAYLAND_DISPLAY (display)) { - found_backend = TRUE; - } -#endif - #ifdef HAVE_X11 if (GDK_IS_X11_DISPLAY (display)) { xstuff_init (); - found_backend = TRUE; } #endif - if (!found_backend) { - g_error("GDK platform not supported"); - } - /* Flush to make sure our struts are seen by everyone starting * immediate after (eg, the caja desktop). */ gdk_display_flush (display); |