[maemo-commits] [maemo-commits] r14235 - in projects/haf/trunk/hildon-desktop: . libhildondesktop

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Oct 1 16:13:37 EEST 2007
Author: jobi
Date: 2007-10-01 16:13:35 +0300 (Mon, 01 Oct 2007)
New Revision: 14235

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-toggle-button.c
Log:

2007-09-28 Johan Bilien  <johan.bilien at nokia.com>

	* libhildondesktop/hildon-desktop-toggle-button.c
	(hildon_desktop_toggle_button_expose): paint the button on
	its allocation only. Fixes: NB#71538



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-10-01 12:38:30 UTC (rev 14234)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-10-01 13:13:35 UTC (rev 14235)
@@ -1,5 +1,11 @@
 2007-09-28 Johan Bilien  <johan.bilien at nokia.com>
 
+	* libhildondesktop/hildon-desktop-toggle-button.c
+	(hildon_desktop_toggle_button_expose): paint the button on
+	its allocation only. Fixes: NB#71538
+
+2007-09-28 Johan Bilien  <johan.bilien at nokia.com>
+
 	* src/hd-desktop.c: removed debug message
 
 2007-09-28 Johan Bilien  <johan.bilien at nokia.com>

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-toggle-button.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-toggle-button.c	2007-10-01 12:38:30 UTC (rev 14234)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-toggle-button.c	2007-10-01 13:13:35 UTC (rev 14235)
@@ -93,6 +93,8 @@
       gint                              x_offset, y_offset;
       Picture                           picture = None;
       gboolean                          picture_is_ours = FALSE;
+      gint                              x, y;
+      guint                             width, height;
 
       button = GTK_BUTTON (widget);
       priv = HILDON_DESKTOP_TOGGLE_BUTTON (widget)->priv;
@@ -115,16 +117,27 @@
           g_return_val_if_fail (picture != None, FALSE);
         }
 
+      /* event->area inter widget->allocation */
+      x = MAX (widget->allocation.x, event->area.x);
+      y = MAX (widget->allocation.y, event->area.y);
+      width = MIN (widget->allocation.x + widget->allocation.width,
+                   event->area.x + event->area.width) -
+              MAX (widget->allocation.x, event->area.x);
+      height = MIN (widget->allocation.y + widget->allocation.height,
+                    event->area.y + event->area.height) -
+               MAX (widget->allocation.y, event->area.y);
+
+
       if (priv->normal_picture != None)
         XRenderComposite (GDK_DISPLAY (),
                           PictOpOver,
                           priv->normal_picture,
                           priv->normal_picture_mask,
                           picture,
-                          event->area.x, event->area.y,
-                          event->area.x, event->area.y,
-                          event->area.x - x_offset, event->area.y - y_offset,
-                          event->area.width, event->area.height);
+                          x, y,
+                          x, y,
+                          x - x_offset, y - y_offset,
+                          width, height);
 
       if (priv->pressed_picture != None  && button->depressed)
         XRenderComposite (GDK_DISPLAY (),
@@ -132,10 +145,10 @@
                           priv->pressed_picture,
                           priv->pressed_picture_mask,
                           picture,
-                          event->area.x, event->area.y,
-                          event->area.x, event->area.y,
-                          event->area.x - x_offset, event->area.y - y_offset,
-                          event->area.width, event->area.height);
+                          x, y,
+                          x, y,
+                          x - x_offset, y - y_offset,
+                          width, height);
 
       if (priv->focus_picture != None && GTK_WIDGET_HAS_FOCUS (widget))
         XRenderComposite (GDK_DISPLAY (),
@@ -143,10 +156,10 @@
                           priv->focus_picture,
                           priv->focus_picture_mask,
                           picture,
-                          event->area.x, event->area.y,
-                          event->area.x, event->area.y,
-                          event->area.x - x_offset, event->area.y - y_offset,
-                          event->area.width, event->area.height);
+                          x, y,
+                          x, y,
+                          x - x_offset, y - y_offset,
+                          width, height);
 
       if (picture_is_ours)
         XRenderFreePicture (GDK_DISPLAY (),


More information about the maemo-commits mailing list