summaryrefslogtreecommitdiff
path: root/libmate-panel-applet/mate-panel-applet.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2017-07-14 15:38:31 -0400
committerlukefromdc <[email protected]>2017-08-13 14:37:24 -0400
commit6bcad424c6efaf2b37f1810f52ab9ffd24377cd8 (patch)
tree78c134b411d66dd497b2b73356f9cf247b952455 /libmate-panel-applet/mate-panel-applet.c
parent2f5fb35954021ba1fbd71aa3c6304394d2d67bdd (diff)
downloadmate-panel-6bcad424c6efaf2b37f1810f52ab9ffd24377cd8.tar.bz2
mate-panel-6bcad424c6efaf2b37f1810f52ab9ffd24377cd8.tar.xz
don't use GtkPlug/GtkSocket for in process applets
1. This will allow panel to exit/stop without crashing when using in process applets. It was crashing because of following assert: g_assert (widget->priv->verifying_invariants_count > 0); 2. In process applet will not have extra background. Transparency should now work as expected. This fixes redrawing of in-process applet backgrounds with GTK 3.22 based on https://github.com/GNOME/gnome-panel/commit/df4ec78272624660e1e01b7382dac3e1f83cfc4a
Diffstat (limited to 'libmate-panel-applet/mate-panel-applet.c')
-rw-r--r--libmate-panel-applet/mate-panel-applet.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/libmate-panel-applet/mate-panel-applet.c b/libmate-panel-applet/mate-panel-applet.c
index bf7a1f35..e881667e 100644
--- a/libmate-panel-applet/mate-panel-applet.c
+++ b/libmate-panel-applet/mate-panel-applet.c
@@ -908,13 +908,19 @@ mate_panel_applet_can_focus (GtkWidget *widget)
/* Taken from libmatecomponentui/matecomponent/matecomponent-plug.c */
static gboolean
-mate_panel_applet_button_event (GtkWidget *widget,
+mate_panel_applet_button_event (MatePanelApplet *applet,
GdkEventButton *event)
{
+ GtkWidget *widget;
GdkWindow *window;
GdkWindow *socket_window;
XEvent xevent;
+ if (!applet->priv->out_of_process)
+ return FALSE;
+
+ widget = applet->priv->plug;
+
if (!gtk_widget_is_toplevel (widget))
return FALSE;
@@ -998,7 +1004,7 @@ mate_panel_applet_button_press (GtkWidget *widget,
return TRUE;
}
- return mate_panel_applet_button_event (applet->priv->plug, event);
+ return mate_panel_applet_button_event (applet, event);
}
static gboolean
@@ -1007,7 +1013,7 @@ mate_panel_applet_button_release (GtkWidget *widget,
{
MatePanelApplet *applet = MATE_PANEL_APPLET (widget);
- return mate_panel_applet_button_event (applet->priv->plug, event);
+ return mate_panel_applet_button_event (applet, event);
}
static gboolean
@@ -1882,6 +1888,9 @@ mate_panel_applet_constructor (GType type,
construct_properties);
applet = MATE_PANEL_APPLET (object);
+ if (!applet->priv->out_of_process)
+ return object;
+
applet->priv->plug = gtk_plug_new (0);
GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(applet->priv->plug));
@@ -2443,6 +2452,9 @@ guint32
mate_panel_applet_get_xid (MatePanelApplet *applet,
GdkScreen *screen)
{
+ if (applet->priv->out_of_process == FALSE)
+ return 0;
+
gtk_window_set_screen (GTK_WINDOW (applet->priv->plug), screen);
gtk_widget_show (applet->priv->plug);
@@ -2459,5 +2471,14 @@ G_MODULE_EXPORT GtkWidget *
mate_panel_applet_get_applet_widget (const gchar *factory_id,
guint uid)
{
- return mate_panel_applet_factory_get_applet_widget (factory_id, uid);
+ GtkWidget *widget;
+
+ widget = mate_panel_applet_factory_get_applet_widget (factory_id, uid);
+ if (!widget) {
+ return NULL;
+ }
+
+ mate_panel_applet_setup (MATE_PANEL_APPLET (widget));
+
+ return widget;
}