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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Jun 21 13:26:00 EEST 2007
Author: jobi
Date: 2007-06-21 13:25:59 +0300 (Thu, 21 Jun 2007)
New Revision: 12415

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-picture.c
   projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-home-area.c
Log:

2007-06-21  Johan Bilien  <johan.bilien at nokia.com>

	* libhildondesktop/hildon-home-area.c:
	- fixed handling of the damage events
	* libhildondesktop/hildon-desktop-picture.c:
	- load pictures with IncludeInferior



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-06-21 10:12:11 UTC (rev 12414)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-06-21 10:25:59 UTC (rev 12415)
@@ -1,3 +1,10 @@
+2007-06-21  Johan Bilien  <johan.bilien at nokia.com>
+
+	* libhildondesktop/hildon-home-area.c:
+	- fixed handling of the damage events
+	* libhildondesktop/hildon-desktop-picture.c:
+	- load pictures with IncludeInferior
+
 2007-06-20  Moises Martinez  <moises.martinez at nokia.com>
 
 	* libhildondesktop/hildon-desktop-popup-window.c:

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-picture.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-picture.c	2007-06-21 10:12:11 UTC (rev 12414)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-picture.c	2007-06-21 10:25:59 UTC (rev 12415)
@@ -284,10 +284,12 @@
   if (format == NULL)
     return None;
 
+  pa.subwindow_mode = IncludeInferiors;
+  pa.repeat = False;
   picture = XRenderCreatePicture (GDK_DISPLAY (),
                                   GDK_DRAWABLE_XID (drawable),
                                   format,
-                                  0,
+                                  CPSubwindowMode | CPRepeat,
                                   &pa);
 
   return picture;

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-home-area.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-home-area.c	2007-06-21 10:12:11 UTC (rev 12414)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-home-area.c	2007-06-21 10:25:59 UTC (rev 12415)
@@ -995,7 +995,6 @@
                     alloc->y - priv->y_offset,
                     alloc->width,
                     alloc->height);
-
 }
 
 static void
@@ -1351,11 +1350,13 @@
                                    &rectangle,
                                    1);
 
+#if 0
       XFixesSetPictureClipRegion (GDK_DISPLAY (),
                                   priv->picture,
                                   0,
                                   0,
                                   region);
+#endif
 
       gdk_error_trap_push ();
       XQueryTree (GDK_DISPLAY (),
@@ -1403,27 +1404,50 @@
                                       GdkEvent         *event,
                                       GtkWidget        *child)
 {
-  XAnyEvent            *aevent = xevent;
+  XEvent               *aevent = xevent;
   HildonHomeArea       *area = HILDON_HOME_AREA (child->parent);
   HildonHomeAreaClass  *klass = HILDON_HOME_AREA_GET_CLASS (area);
 
-
   if (aevent->type == klass->xdamage_event_base + XDamageNotify)
     {
-      XDamageNotifyEvent *ev = xevent;
-      GdkRectangle rect;
-      XserverRegion parts;
+      XDamageNotifyEvent       *ev = xevent;
+      XserverRegion             parts;
+      XRectangle               *rects;
+      guint                     i, n_rect;
 
-      rect.x = ev->area.x + child->allocation.x;
-      rect.y = ev->area.y + child->allocation.y;
-      rect.width = ev->area.width;
-      rect.height = ev->area.height;
-
       parts = XFixesCreateRegion (GDK_DISPLAY (), 0, 0);
       XDamageSubtract (GDK_DISPLAY (), ev->damage, None, parts);
-      XFixesDestroyRegion (GDK_DISPLAY (), parts);
 
-      gdk_window_invalidate_rect (child->parent->window, &rect, FALSE);
+      rects = XFixesFetchRegion (GDK_DISPLAY (),
+                                 parts,
+                                 &n_rect);
+
+      XFixesDestroyRegion (GDK_DISPLAY (),
+                           parts);
+
+      for (i = 0; i < n_rect; i++)
+        {
+          GdkRectangle  rect;
+
+          rect.x = child->allocation.x + rects[i].x;
+          rect.y = child->allocation.y + rects[i].y;
+          rect.width  = rects[i].width;
+          rect.height = rects[i].height;
+
+#if 0
+          g_debug ("Got damage on %i, %i %ix%i",
+                   rect.x,
+                   rect.y,
+                   rect.width,
+                   rect.height);
+#endif
+
+          gdk_window_invalidate_rect (GTK_WIDGET (area)->window,
+                                      &rect,
+                                      FALSE);
+        }
+
+      XFree (rects);
     }
 
   return GDK_FILTER_CONTINUE;
@@ -2223,8 +2247,8 @@
                               widget->allocation.height};
 
       gdk_window_invalidate_rect (GTK_WIDGET (area)->window, &invalid, TRUE);
-      invalid.x = x;
-      invalid.y = y;
+      invalid.x = x + GTK_WIDGET (area)->allocation.x;
+      invalid.y = y + GTK_WIDGET (area)->allocation.y;
       gdk_window_invalidate_rect (GTK_WIDGET (area)->window, &invalid, TRUE);
     }
 


More information about the maemo-commits mailing list