diff options
author | William Wold <[email protected]> | 2019-06-20 04:38:04 +0000 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-06-23 10:12:24 +0200 |
commit | ee2c41faa98ac00e48e16b0128e610720330e6fe (patch) | |
tree | b77e88e73a9c33487bf99694d36304797eb64ddd | |
parent | 49942432f1d908d801d8ec353887eee2d110e5e2 (diff) | |
download | mate-panel-ee2c41faa98ac00e48e16b0128e610720330e6fe.tar.bz2 mate-panel-ee2c41faa98ac00e48e16b0128e610720330e6fe.tar.xz |
Wayland support for main.c
-rw-r--r-- | mate-panel/main.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/mate-panel/main.c b/mate-panel/main.c index af7e126b..82d475c1 100644 --- a/mate-panel/main.c +++ b/mate-panel/main.c @@ -27,12 +27,15 @@ #include "panel-session.h" #include "panel-schemas.h" #include "panel-stock-icons.h" -#include "panel-action-protocol.h" #include "panel-lockdown.h" #include "panel-icon-names.h" #include "panel-reset.h" #include "panel-run-dialog.h" + +#ifdef HAVE_X11 +#include "panel-action-protocol.h" #include "xstuff.h" +#endif /* globals */ GSList *panels = NULL; @@ -157,7 +160,13 @@ main (int argc, char **argv) return -1; } - panel_action_protocol_init (); + display = gdk_display_get_default (); + +#ifdef HAVE_X11 + if (GDK_IS_X11_DISPLAY (display)) + panel_action_protocol_init (); +#endif + panel_multimonitor_init (); panel_init_stock_icons_and_items (); @@ -170,11 +179,21 @@ main (int argc, char **argv) (GFunc)panel_widget_add_forbidden, NULL); - xstuff_init (); + gboolean found_backend = FALSE; + +#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). */ - display = gdk_display_get_default (); gdk_display_flush (display); /* Do this at the end, to be sure that we're really ready when |