[Xfce4-commits] <xfce4-panel:master> Restart systray manager on compositing changes.

Nick Schermer noreply at xfce.org
Tue Jan 4 18:46:01 CET 2011


Updating branch refs/heads/master
         to 6a2b1033cffb2ff7bc9a13445b437afab5cd15a4 (commit)
       from edcb230dc138feae2e99899ca28b96878174db33 (commit)

commit 6a2b1033cffb2ff7bc9a13445b437afab5cd15a4
Author: Nick Schermer <nick at xfce.org>
Date:   Tue Jan 4 18:21:54 2011 +0100

    Restart systray manager on compositing changes.

 plugins/systray/systray-socket.c |   10 ++++++----
 plugins/systray/systray.c        |   12 ++++++++++++
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/plugins/systray/systray-socket.c b/plugins/systray/systray-socket.c
index e77690e..d473270 100644
--- a/plugins/systray/systray-socket.c
+++ b/plugins/systray/systray-socket.c
@@ -166,7 +166,8 @@ systray_socket_size_allocate (GtkWidget     *widget,
   gboolean       resized = allocation->width != widget->allocation.width
                            ||allocation->height != widget->allocation.height;
 
-  if ((moved || resized) && GTK_WIDGET_MAPPED (widget))
+  if ((moved || resized)
+      && GTK_WIDGET_MAPPED (widget))
     {
       if (socket->is_composited)
         gdk_window_invalidate_rect (gdk_window_get_parent (widget->window),
@@ -175,7 +176,8 @@ systray_socket_size_allocate (GtkWidget     *widget,
 
   GTK_WIDGET_CLASS (systray_socket_parent_class)->size_allocate (widget, allocation);
 
-  if ((moved || resized) && GTK_WIDGET_MAPPED (widget))
+  if ((moved || resized)
+      && GTK_WIDGET_MAPPED (widget))
     {
       if (socket->is_composited)
         gdk_window_invalidate_rect (gdk_window_get_parent (widget->window),
@@ -208,9 +210,9 @@ systray_socket_expose_event (GtkWidget      *widget,
       /* clear to parent-relative pixmap */
       gdk_window_clear_area (widget->window,
                              event->area.x,
-           event->area.y,
+                             event->area.y,
                              event->area.width,
-           event->area.height);
+                             event->area.height);
     }
 
   return FALSE;
diff --git a/plugins/systray/systray.c b/plugins/systray/systray.c
index 9d46b12..cf90f5e 100644
--- a/plugins/systray/systray.c
+++ b/plugins/systray/systray.c
@@ -416,6 +416,14 @@ systray_plugin_screen_changed (GtkWidget *widget,
 }
 
 
+static void
+systray_plugin_composited_changed (GtkWidget *widget)
+{
+  /* restart the manager to add the sockets again */
+  systray_plugin_screen_changed (widget, gtk_widget_get_screen (widget));
+}
+
+
 
 static void
 systray_plugin_construct (XfcePanelPlugin *panel_plugin)
@@ -440,6 +448,10 @@ systray_plugin_construct (XfcePanelPlugin *panel_plugin)
   g_signal_connect (G_OBJECT (plugin), "screen-changed",
       G_CALLBACK (systray_plugin_screen_changed), NULL);
   systray_plugin_screen_changed (GTK_WIDGET (plugin), NULL);
+
+  /* restart internally if compositing changed */
+  g_signal_connect (G_OBJECT (plugin), "composited-changed",
+     G_CALLBACK (systray_plugin_composited_changed), NULL);
 }
 
 



More information about the Xfce4-commits mailing list