Skip to content

Commit 8c9a517

Browse files
wmwwraveit65
authored andcommitted
libmate-panel-applet: Applet factory Wayland support
1 parent 3e4a50d commit 8c9a517

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

libmate-panel-applet/mate-panel-applet-factory.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@
1919
* Boston, MA 02110-1301, USA.
2020
*/
2121

22+
#include <config.h>
23+
2224
#include "mate-panel-applet.h"
2325
#include "panel-applet-private.h"
2426

2527
#include "mate-panel-applet-factory.h"
2628

29+
#ifdef HAVE_X11
30+
#include <gdk/gdkx.h>
31+
#endif
32+
2733
struct _MatePanelAppletFactory {
2834
GObject base;
2935

@@ -215,7 +221,15 @@ mate_panel_applet_factory_get_applet (MatePanelAppletFactory *factory,
215221
gdk_display_get_default_screen (gdk_display_get_default ()) :
216222
gdk_screen_get_default ();
217223

218-
xid = mate_panel_applet_get_xid (MATE_PANEL_APPLET (applet), screen);
224+
#ifdef HAVE_X11
225+
if (GDK_IS_X11_DISPLAY (gdk_screen_get_display (screen))) {
226+
xid = mate_panel_applet_get_xid (MATE_PANEL_APPLET (applet), screen);
227+
} else
228+
#endif
229+
{ // Not using X11
230+
xid = 0;
231+
}
232+
219233
uid = factory->next_uid++;
220234
object_path = mate_panel_applet_get_object_path (MATE_PANEL_APPLET (applet));
221235
g_hash_table_insert (factory->applets, GUINT_TO_POINTER (uid), applet);
@@ -309,6 +323,9 @@ mate_panel_applet_factory_register_service (MatePanelAppletFactory *factory)
309323
{
310324
gchar *service_name;
311325

326+
if (!factory)
327+
return FALSE;
328+
312329
service_name = g_strdup_printf (MATE_PANEL_APPLET_FACTORY_SERVICE_NAME, factory->factory_id);
313330
factory->owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
314331
service_name,

0 commit comments

Comments
 (0)