[maemo-commits] [maemo-commits] r9381 - in projects/haf/trunk/sapwood: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Jan 29 11:50:29 EET 2007
Author: tko
Date: 2007-01-29 11:50:27 +0200 (Mon, 29 Jan 2007)
New Revision: 9381

Modified:
   projects/haf/trunk/sapwood/ChangeLog
   projects/haf/trunk/sapwood/src/sapwood-draw.c
Log:
Set window shape mask more carefully to avoid infinite expose loops

2007-01-27  Tommi Komulainen  <tommi.komulainen at nokia.com>

	* src/sapwood-draw.c (get_window_for_shape): Consider setting the
	window shape mask only when painting to widget->window, otherwise it
	can cause an infinite expose loop.


Modified: projects/haf/trunk/sapwood/ChangeLog
===================================================================
--- projects/haf/trunk/sapwood/ChangeLog	2007-01-29 09:50:23 UTC (rev 9380)
+++ projects/haf/trunk/sapwood/ChangeLog	2007-01-29 09:50:27 UTC (rev 9381)
@@ -1,3 +1,9 @@
+2007-01-27  Tommi Komulainen  <tommi.komulainen at nokia.com>
+
+	* src/sapwood-draw.c (get_window_for_shape): Consider setting the
+	window shape mask only when painting to widget->window, otherwise it
+	can cause an infinite expose loop.
+
 2007-01-25  Tommi Komulainen  <tommi.komulainen at nokia.com>
 	
 	* === Release 2.91.0 ===

Modified: projects/haf/trunk/sapwood/src/sapwood-draw.c
===================================================================
--- projects/haf/trunk/sapwood/src/sapwood-draw.c	2007-01-29 09:50:23 UTC (rev 9380)
+++ projects/haf/trunk/sapwood/src/sapwood-draw.c	2007-01-29 09:50:27 UTC (rev 9381)
@@ -95,7 +95,15 @@
 static GdkBitmap *
 get_window_for_shape (ThemeImage *image, GdkWindow *window, GtkWidget *widget)
 {
-  if (image->background_shaped)
+  /* It's not a good idea to set a shape mask when painting on anything but
+   * widget->window, not only does the shape mask get wrongly offset but also
+   * causes re-exposing the widget, and we'll re-apply the shape mask, ad
+   * infinitum.
+   *
+   * Noticed when GtkMenu was changed to do two paints, the other one being on
+   * ->bin_window (http://bugzilla.gnome.org/show_bug.cgi?id=169532)
+   */
+  if (image->background_shaped && window == widget->window)
     {
       if (GTK_IS_MENU (widget))
 	return gtk_widget_get_parent_window (widget);


More information about the maemo-commits mailing list