Skip to content
Permalink
Browse files

libmate-panel-applet: Applet factory Wayland support

  • Loading branch information...
wmww authored and raveit65 committed Jan 23, 2019
1 parent 3e4a50d commit 8c9a5171c3894788523db54207bf4e4158c53b1d
Showing with 18 additions and 1 deletion.
  1. +18 −1 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,

0 comments on commit 8c9a517

Please sign in to comment.
You can’t perform that action at this time.