[Xfce4-commits] <xfce4-panel:devel> * Clip the cairo drawing area in the clock plugin and panel window.

Nick Schermer nick at xfce.org
Tue Aug 11 20:22:58 CEST 2009


Updating branch refs/heads/devel
         to ccef2d45d3a9c9ce7b9d0d67b450c142fe8bd82f (commit)
       from fa9a56e6efad4763bb67a4fdafe6d754c8da80ab (commit)

commit ccef2d45d3a9c9ce7b9d0d67b450c142fe8bd82f
Author: Nick Schermer <nick at xfce.org>
Date:   Thu Aug 14 19:34:18 2008 +0200

    * Clip the cairo drawing area in the clock plugin and panel window.

 panel/panel-window.c         |    4 ++++
 plugins/clock/clock-analog.c |    4 ++++
 plugins/clock/clock-binary.c |    4 ++++
 plugins/clock/clock-lcd.c    |    4 ++++
 4 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/panel/panel-window.c b/panel/panel-window.c
index d19cce7..a02aeb1 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -353,6 +353,10 @@ panel_window_expose_event (GtkWidget      *widget,
     {
       /* create cairo context */
       cr = gdk_cairo_create (widget->window);
+      
+      /* clip the drawing area */
+      gdk_cairo_rectangle (cr, &event->area);
+      cairo_clip (cr);
 
       /* use another state when the panel is selected */
       if (G_UNLIKELY (window->is_active_panel))
diff --git a/plugins/clock/clock-analog.c b/plugins/clock/clock-analog.c
index 5502fab..777613b 100644
--- a/plugins/clock/clock-analog.c
+++ b/plugins/clock/clock-analog.c
@@ -227,6 +227,10 @@ xfce_clock_analog_expose_event (GtkWidget      *widget,
 
     if (G_LIKELY (cr != NULL))
     {
+        /* clip the drawing region */
+        gdk_cairo_rectangle (cr, &event->area);
+        cairo_clip (cr);
+        
         /* get the local time */
         xfce_clock_util_get_localtime (&tm);
 
diff --git a/plugins/clock/clock-binary.c b/plugins/clock/clock-binary.c
index e71ed93..6980c95 100644
--- a/plugins/clock/clock-binary.c
+++ b/plugins/clock/clock-binary.c
@@ -273,6 +273,10 @@ xfce_clock_binary_expose_event (GtkWidget      *widget,
 
     if (G_LIKELY (cr != NULL))
     {
+        /* clip the drawing region */
+        gdk_cairo_rectangle (cr, &event->area);
+        cairo_clip (cr);
+        
         /* get the current time */
         xfce_clock_util_get_localtime (&tm);
 
diff --git a/plugins/clock/clock-lcd.c b/plugins/clock/clock-lcd.c
index 5c3f3ae..adc968a 100644
--- a/plugins/clock/clock-lcd.c
+++ b/plugins/clock/clock-lcd.c
@@ -311,6 +311,10 @@ xfce_clock_lcd_expose_event (GtkWidget      *widget,
 
     if (G_LIKELY (cr != NULL))
     {
+        /* clip the drawing region */
+        gdk_cairo_rectangle (cr, &event->area);
+        cairo_clip (cr);
+        
         /* get the local time */
         xfce_clock_util_get_localtime (&tm);
 



More information about the Xfce4-commits mailing list