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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Jan 29 09:52:21 EET 2009
Author: kihamala
Date: 2009-01-29 09:52:20 +0200 (Thu, 29 Jan 2009)
New Revision: 17317

Modified:
   projects/haf/trunk/libmatchbox2/ChangeLog
   projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-base.c
Log:
apply patch from Laszlo


Modified: projects/haf/trunk/libmatchbox2/ChangeLog
===================================================================
--- projects/haf/trunk/libmatchbox2/ChangeLog	2009-01-29 07:24:10 UTC (rev 17316)
+++ projects/haf/trunk/libmatchbox2/ChangeLog	2009-01-29 07:52:20 UTC (rev 17317)
@@ -1,3 +1,11 @@
+2009-01-29  Kimmo Hämäläinen  <kimmo.hamalainen at nokia.com>
+
+	* matchbox/core/mb-wm-client-base.c
+	(mb_wm_client_move_to_top_recursive): New function.
+	(mb_wm_client_base_stack): Handle transient chain correctly, so that
+	the whole stackable window stack is raised when one of the windows is
+	raised. Patch from Laszlo Pere.
+
 2009-01-28  Gordon Williams  <gordon.williams at collabora.co.uk>
 
 	* matchbox/comp-mgr/mb-wm-comp-mgr-clutter.c:

Modified: projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-base.c
===================================================================
--- projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-base.c	2009-01-29 07:24:10 UTC (rev 17316)
+++ projects/haf/trunk/libmatchbox2/matchbox/core/mb-wm-client-base.c	2009-01-29 07:52:20 UTC (rev 17317)
@@ -276,20 +276,51 @@
 	       PropertyChangeMask);
 }
 
+/*
+ * This window will move the client to the top of the stack with its transients.
+ */
 static void
+mb_wm_client_move_to_top_recursive (
+		MBWindowManagerClient   *client)
+{
+	MBWMList *transients;
+
+	/*
+	 * TODO: change this to a (yet to implement) function that uses the
+	 * stacking layer properly.
+	 */
+	mb_wm_stack_move_top (client);
+
+	transients = client->transients;
+	while (transients) {
+		mb_wm_client_move_to_top_recursive (
+				(MBWindowManagerClient *) transients->data);
+		transients = mb_wm_util_list_next (transients);
+	}
+}
+
+static void
 mb_wm_client_base_stack (MBWindowManagerClient *client,
 			 int                    flags)
 {
-  /* Stack to highest/lowest possible possition in stack */
-  MBWMList * t = mb_wm_client_get_transients (client);
-  MBWMList * li;
+  MBWindowManagerClient *transient_for = client->transient_for;
 
-  mb_wm_stack_move_top(client);
+  /*
+   * If this is a transient we have to find the very first element of the
+   * transient chain.
+   */
+  while (transient_for && transient_for->transient_for)
+	  transient_for = transient_for->transient_for;
+  /*
+   * And then we are going to use the parent.
+   */
+  if (transient_for) 
+	  client = transient_for;
 
-  mb_wm_util_list_foreach (t, (MBWMListForEachCB)mb_wm_client_stack,
-			   (void*)flags);
-
-  mb_wm_util_list_free (t);
+  /*
+   * Move the window to the top with its transients.
+   */
+  mb_wm_client_move_to_top_recursive (client);
 }
 
 static void


More information about the maemo-commits mailing list