summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mate-panel/libmate-panel-applet-private/mate-panel-applet-container.c12
-rw-r--r--mate-panel/libmate-panel-applet-private/mate-panel-applet-container.h1
-rw-r--r--mate-panel/libmate-panel-applet-private/mate-panel-applet-frame-dbus.c4
-rw-r--r--mate-panel/mate-panel-applet-frame.c6
-rw-r--r--mate-panel/mate-panel-applet-frame.h2
-rw-r--r--mate-panel/panel-test-applets.c1
6 files changed, 21 insertions, 5 deletions
diff --git a/mate-panel/libmate-panel-applet-private/mate-panel-applet-container.c b/mate-panel/libmate-panel-applet-private/mate-panel-applet-container.c
index f2e39019..1076ff1d 100644
--- a/mate-panel/libmate-panel-applet-private/mate-panel-applet-container.c
+++ b/mate-panel/libmate-panel-applet-private/mate-panel-applet-container.c
@@ -441,6 +441,7 @@ on_factory_appeared (GDBusConnection *connection,
static void
mate_panel_applet_container_get_applet (MatePanelAppletContainer *container,
+ GdkScreen *screen,
const gchar *iid,
GVariant *props,
GCancellable *cancellable,
@@ -449,7 +450,7 @@ mate_panel_applet_container_get_applet (MatePanelAppletContainer *container,
{
GSimpleAsyncResult *result;
AppletFactoryData *data;
- gint screen;
+ gint screen_number;
gchar *bus_name;
gchar *factory_id;
gchar *applet_id;
@@ -474,12 +475,14 @@ mate_panel_applet_container_get_applet (MatePanelAppletContainer *container,
factory_id = g_strndup (iid, strlen (iid) - strlen (applet_id));
applet_id += 2;
- screen = gdk_screen_get_number (gtk_widget_get_screen (container->priv->socket));
+ /* we can't use the screen of the container widget since it's not in a
+ * widget hierarchy yet */
+ screen_number = gdk_screen_get_number (screen);
data = g_new (AppletFactoryData, 1);
data->result = result;
data->factory_id = factory_id;
- data->parameters = g_variant_new ("(si*)", applet_id, screen, props);
+ data->parameters = g_variant_new ("(si*)", applet_id, screen_number, props);
data->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
bus_name = g_strdup_printf (MATE_PANEL_APPLET_BUS_NAME, factory_id);
@@ -498,6 +501,7 @@ mate_panel_applet_container_get_applet (MatePanelAppletContainer *container,
void
mate_panel_applet_container_add (MatePanelAppletContainer *container,
+ GdkScreen *screen,
const gchar *iid,
GCancellable *cancellable,
GAsyncReadyCallback callback,
@@ -509,7 +513,7 @@ mate_panel_applet_container_add (MatePanelAppletContainer *container,
mate_panel_applet_container_cancel_pending_operations (container);
- mate_panel_applet_container_get_applet (container, iid, properties,
+ mate_panel_applet_container_get_applet (container, screen, iid, properties,
cancellable, callback, user_data);
}
diff --git a/mate-panel/libmate-panel-applet-private/mate-panel-applet-container.h b/mate-panel/libmate-panel-applet-private/mate-panel-applet-container.h
index 4b1e316a..3013c7ea 100644
--- a/mate-panel/libmate-panel-applet-private/mate-panel-applet-container.h
+++ b/mate-panel/libmate-panel-applet-private/mate-panel-applet-container.h
@@ -75,6 +75,7 @@ GtkWidget *mate_panel_applet_container_new (void);
void mate_panel_applet_container_add (MatePanelAppletContainer *container,
+ GdkScreen *screen,
const gchar *iid,
GCancellable *cancellable,
GAsyncReadyCallback callback,
diff --git a/mate-panel/libmate-panel-applet-private/mate-panel-applet-frame-dbus.c b/mate-panel/libmate-panel-applet-private/mate-panel-applet-frame-dbus.c
index b2e90e73..3a694773 100644
--- a/mate-panel/libmate-panel-applet-private/mate-panel-applet-frame-dbus.c
+++ b/mate-panel/libmate-panel-applet-private/mate-panel-applet-frame-dbus.c
@@ -411,6 +411,7 @@ mate_panel_applet_frame_dbus_load (const gchar *iid,
MatePanelAppletFrameDBus *dbus_frame;
MatePanelAppletFrame *frame;
GVariantBuilder builder;
+ GdkScreen *screen;
gchar *conf_path;
gchar *background;
guint orient;
@@ -425,6 +426,7 @@ mate_panel_applet_frame_dbus_load (const gchar *iid,
frame = MATE_PANEL_APPLET_FRAME (dbus_frame);
_mate_panel_applet_frame_set_iid (frame, iid);
+ screen = panel_applet_frame_activating_get_screen (frame_act);
orient = get_mate_panel_applet_orient (mate_panel_applet_frame_activating_get_orientation (frame_act));
conf_path = mate_panel_applet_frame_activating_get_conf_path (frame_act);
/* we can't really get a background string at this point since we don't
@@ -456,7 +458,7 @@ mate_panel_applet_frame_dbus_load (const gchar *iid,
g_object_set_data (G_OBJECT (frame), "mate-panel-applet-frame-activating", frame_act);
mate_panel_applet_container_add (dbus_frame->priv->container,
- iid, NULL,
+ screen, iid, NULL,
(GAsyncReadyCallback) mate_panel_applet_frame_dbus_activated,
frame,
g_variant_builder_end (&builder));
diff --git a/mate-panel/mate-panel-applet-frame.c b/mate-panel/mate-panel-applet-frame.c
index 12f1c103..e950d789 100644
--- a/mate-panel/mate-panel-applet-frame.c
+++ b/mate-panel/mate-panel-applet-frame.c
@@ -801,6 +801,12 @@ mate_panel_applet_frame_activating_free (MatePanelAppletFrameActivating *frame_a
g_slice_free (MatePanelAppletFrameActivating, frame_act);
}
+GdkScreen *
+panel_applet_frame_activating_get_screen (MatePanelAppletFrameActivating *frame_act)
+{
+ return gtk_widget_get_screen (frame_act->panel);
+}
+
PanelOrientation
mate_panel_applet_frame_activating_get_orientation(MatePanelAppletFrameActivating *frame_act)
{
diff --git a/mate-panel/mate-panel-applet-frame.h b/mate-panel/mate-panel-applet-frame.h
index d8518830..489f2de4 100644
--- a/mate-panel/mate-panel-applet-frame.h
+++ b/mate-panel/mate-panel-applet-frame.h
@@ -107,6 +107,7 @@ void mate_panel_applet_frame_set_panel (MatePanelAppletFrame *frame
typedef struct _MatePanelAppletFrameActivating MatePanelAppletFrameActivating;
+GdkScreen *panel_applet_frame_activating_get_screen (MatePanelAppletFrameActivating *frame_act);
PanelOrientation mate_panel_applet_frame_activating_get_orientation (MatePanelAppletFrameActivating *frame_act);
guint32 mate_panel_applet_frame_activating_get_size (MatePanelAppletFrameActivating *frame_act);
gboolean mate_panel_applet_frame_activating_get_locked (MatePanelAppletFrameActivating *frame_act);
@@ -144,3 +145,4 @@ void _mate_panel_applet_frame_applet_lock (MatePanelAppletFrame *fram
#endif
#endif /* __MATE_PANEL_APPLET_FRAME_H__ */
+
diff --git a/mate-panel/panel-test-applets.c b/mate-panel/panel-test-applets.c
index ed844c89..f17ad8d1 100644
--- a/mate-panel/panel-test-applets.c
+++ b/mate-panel/panel-test-applets.c
@@ -164,6 +164,7 @@ load_applet_into_window (const char *title,
g_variant_builder_add (&builder, "{sv}",
"orient", g_variant_new_uint32 (orientation));
mate_panel_applet_container_add (MATE_PANEL_APPLET_CONTAINER (container),
+ gtk_widget_get_screen (applet_window),
title, NULL,
(GAsyncReadyCallback)applet_activated_cb,
applet_window,