[maemo-commits] [maemo-commits] r17728 - in projects/haf/trunk/libmatchbox2: . matchbox/core

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Mar 18 14:41:24 EET 2009
Author: aendrodi
Date: 2009-03-18 14:41:20 +0200 (Wed, 18 Mar 2009)
New Revision: 17728

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-window-manager.c
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.h
Log:
	NB#105933 Only close controls of thumbnails are shown in the switcher
	          view and when tapped on them desktop is crashing in a
		  mentioned scenario

	Caused by extra unexpected MapNotify:es.

	* matchbox/core/mb-wm-client.h:
	  Add a skip_maps counter to MBWindowManagerClient.
	* matchbox/core/mb-window-manager.c (mb_wm_handle_map_notify):
	  Ignore a MapNotify when we ignore an UnmapNotify due to
	  window reparenting.  Also ignore MapNotify:es sent because
	  of compositing.

	This will break ABI so be sure to recompile hildon-desktop
	with the changed header.


Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-03-18 12:41:02 UTC (rev 17727)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-03-18 12:41:20 UTC (rev 17728)
@@ -1,3 +1,21 @@
+2009-03-17  Adam Endrodi  <adam.endrodi at blumsoft.eu>
+
+	NB#105933 Only close controls of thumbnails are shown in the switcher
+	          view and when tapped on them desktop is crashing in a
+		  mentioned scenario
+
+	Caused by extra unexpected MapNotify:es.
+
+	* matchbox/core/mb-wm-client.h:
+	  Add a skip_maps counter to MBWindowManagerClient.
+	* matchbox/core/mb-window-manager.c (mb_wm_handle_map_notify):
+	  Ignore a MapNotify when we ignore an UnmapNotify due to
+	  window reparenting.  Also ignore MapNotify:es sent because
+	  of compositing.
+
+	This will break ABI so be sure to recompile hildon-desktop
+	with the changed header.
+
 2009-03-17  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
 
 	* Revert Thomas' transient for handling change.

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-window-manager.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-window-manager.c	2009-03-18 12:41:02 UTC (rev 17727)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-window-manager.c	2009-03-18 12:41:20 UTC (rev 17728)
@@ -485,10 +485,8 @@
 
   MBWM_MARK();
 
-  /*
-   * Ignoring syntetic events, not even decrementing the skip_unmaps counter.
-   */
-  if (((XAnyEvent *)xev)->send_event) 
+  /* Ignoring syntetic events, not even decrementing the skip_unmaps counter. */
+  if (xev->send_event) 
     return True;
   
   /*
@@ -496,7 +494,7 @@
    * which is filtered out here. We will have an other event about the redirects
    * with the xany.window set to the parent window.
    */
-  if (xev->window == ((XEvent *)xev)->xany.window) 
+  if (xev->window == xev->event) 
     return True;
 
   client = mb_wm_managed_client_from_xwindow(wm, xev->window);
@@ -521,7 +519,9 @@
 	  MBWM_DBG ("skipping unmap for %p (skip count %d)\n",
 		    client, client->skip_unmaps);
 
+          /* When we skip an unmap, skip a map too. */
 	  client->skip_unmaps--;
+          client->skip_maps++;
 	}
       else
 	{
@@ -797,6 +797,10 @@
 
   g_debug ("%s: @@@@ Map Notify for %lx @@@@", __func__, xev->window);
 
+  /* For the same reason as in mb_wm_handle_unmap_notify(). */
+  if (xev->window == xev->event) 
+    return True;
+
   if (!wm_class->client_new)
     {
       MBWM_DBG("### No new client hook exists ###");
@@ -805,7 +809,9 @@
 
   if (mb_wm_is_my_window (wm, xev->window, &client))
     {
-      if (client)
+      if (client && client->skip_maps)
+        client->skip_maps--;
+      else if (client)
 	{
 	  /* If the client is undecorated or fullscreen use
            * client->window->xwindow as top, client->xwin_frame else */
@@ -1404,9 +1410,11 @@
 	       /*
 		* When we realize the client, we reparent the application
 		* window to the new frame, which generates an unmap event.
-		* We need to skip it.
+		* We need to skip it.  On the other hand, don't skip the
+                * accompanying MapNotify this time.
 		*/
 	       client->skip_unmaps++;
+               client->skip_maps--;
 
 #if ENABLE_COMPOSITE
 	       /*

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.h
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.h	2009-03-18 12:41:02 UTC (rev 17727)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client.h	2009-03-18 12:41:20 UTC (rev 17728)
@@ -184,6 +184,7 @@
   MBWMList                    *transients;
   MBWindowManagerClient       *transient_for;
 
+  int                          skip_maps;
   int                          skip_unmaps;
 
   /* ### Private ### */


More information about the maemo-commits mailing list