Skip to content

Commit

Permalink
libmate-panel-applet: Applet factory Wayland support
Browse files Browse the repository at this point in the history
  • Loading branch information
wmww authored and raveit65 committed Jan 25, 2019
1 parent 3e4a50d commit 8c9a517
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion libmate-panel-applet/mate-panel-applet-factory.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8c9a517

Please sign in to comment.