summaryrefslogtreecommitdiff
path: root/libmate-panel-applet/mate-panel-applet-factory.c
diff options
context:
space:
mode:
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,