summaryrefslogtreecommitdiff
path: root/libmate-panel-applet/mate-panel-applet-factory.c
diff options
context:
space:
mode:
authorWilliam Wold <[email protected]>2019-01-23 09:31:38 -0500
committerraveit65 <[email protected]>2019-01-25 18:52:06 +0100
commit8c9a5171c3894788523db54207bf4e4158c53b1d (patch)
tree2328cb74a21874098d1f11717ba5f806962a653c /libmate-panel-applet/mate-panel-applet-factory.c
parent3e4a50d937eecb9b510614e3a62e8844a5fb46b0 (diff)
downloadmate-panel-8c9a5171c3894788523db54207bf4e4158c53b1d.tar.bz2
mate-panel-8c9a5171c3894788523db54207bf4e4158c53b1d.tar.xz
libmate-panel-applet: Applet factory Wayland support
Diffstat (limited to 'libmate-panel-applet/mate-panel-applet-factory.c')
-rw-r--r--libmate-panel-applet/mate-panel-applet-factory.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libmate-panel-applet/mate-panel-applet-factory.c b/libmate-panel-applet/mate-panel-applet-factory.c
index 57e5a0c2..2c6c1840 100644
--- a/libmate-panel-applet/mate-panel-applet-factory.c
+++ b/libmate-panel-applet/mate-panel-applet-factory.c
@@ -19,11 +19,17 @@
* Boston, MA 02110-1301, USA.
*/
+#include <config.h>
+
#include "mate-panel-applet.h"
#include "panel-applet-private.h"
#include "mate-panel-applet-factory.h"
+#ifdef HAVE_X11
+#include <gdk/gdkx.h>
+#endif
+
struct _MatePanelAppletFactory {
GObject base;
@@ -215,7 +221,15 @@ mate_panel_applet_factory_get_applet (MatePanelAppletFactory *factory,
gdk_display_get_default_screen (gdk_display_get_default ()) :
gdk_screen_get_default ();
- xid = mate_panel_applet_get_xid (MATE_PANEL_APPLET (applet), screen);
+#ifdef HAVE_X11
+ if (GDK_IS_X11_DISPLAY (gdk_screen_get_display (screen))) {
+ xid = mate_panel_applet_get_xid (MATE_PANEL_APPLET (applet), screen);
+ } else
+#endif
+ { // Not using X11
+ xid = 0;
+ }
+
uid = factory->next_uid++;
object_path = mate_panel_applet_get_object_path (MATE_PANEL_APPLET (applet));
g_hash_table_insert (factory->applets, GUINT_TO_POINTER (uid), applet);
@@ -309,6 +323,9 @@ mate_panel_applet_factory_register_service (MatePanelAppletFactory *factory)
{
gchar *service_name;
+ if (!factory)
+ return FALSE;
+
service_name = g_strdup_printf (MATE_PANEL_APPLET_FACTORY_SERVICE_NAME, factory->factory_id);
factory->owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
service_name,