[maemo-commits] [maemo-commits] r15462 - in projects/haf/trunk/gtk+: . gtk

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Apr 21 18:30:36 EEST 2008
Author: kris
Date: 2008-04-21 18:30:28 +0300 (Mon, 21 Apr 2008)
New Revision: 15462

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/gtk/gtkwindow.c
Log:
2008-04-21  Kristian Rietveld  <kris at imendio.com>

	Fixes NB79639: Display is freezed when file location combobox is
	tapped while opening a page:

	* gtk/gtkwindow.c (gtk_window_map): add explanatory comment,
	(gtk_window_close_other_temporaries): after sending the client
	message, iterate over all toplevels and send delete-events immediately
	to temporary windows that are currently mapped.



Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2008-04-17 16:21:30 UTC (rev 15461)
+++ projects/haf/trunk/gtk+/ChangeLog	2008-04-21 15:30:28 UTC (rev 15462)
@@ -1,3 +1,13 @@
+2008-04-21  Kristian Rietveld  <kris at imendio.com>
+
+	Fixes NB79639: Display is freezed when file location combobox is
+	tapped while opening a page:
+
+	* gtk/gtkwindow.c (gtk_window_map): add explanatory comment,
+	(gtk_window_close_other_temporaries): after sending the client
+	message, iterate over all toplevels and send delete-events immediately
+	to temporary windows that are currently mapped.
+
 2008-04-15  Michael Natterer  <mitch at imendio.com>
 
 	Fixes NB#80760: context sensitive menu disappears after stylus

Modified: projects/haf/trunk/gtk+/gtk/gtkwindow.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtkwindow.c	2008-04-17 16:21:30 UTC (rev 15461)
+++ projects/haf/trunk/gtk+/gtk/gtkwindow.c	2008-04-21 15:30:28 UTC (rev 15462)
@@ -4169,6 +4169,11 @@
   GdkWindow *toplevel;
 
 #if defined(MAEMO_CHANGES)
+  /* This call should be before we set the MAPPED flag on the
+   * window, because gtk_window_close_other_temporaries() uses
+   * this to ignore this window when sending delete-events
+   * internally.
+   */
   if (! gtk_window_get_is_temporary (window))
     gtk_window_close_other_temporaries (window);
 #endif
@@ -8062,6 +8067,7 @@
 void
 gtk_window_close_other_temporaries (GtkWindow *window)
 {
+  GList *toplevels;
   GdkEventClient client;
   XID xid = GDK_WINDOW_XID (GTK_WIDGET (window)->window);
 
@@ -8070,6 +8076,32 @@
   client.data_format = 8;
   memcpy (((XID*)(&client.data.b[12])),&xid, sizeof(XID));
   gdk_event_send_clientmessage_toall ((GdkEvent*)&client);
+
+  /* The client messages are sent out of process and won't be
+   * delivered before this function returns.  If the caller is
+   * a modal dialog and thus grabs, the delete events for this
+   * process could get ignored.
+   */
+  toplevels = gtk_window_list_toplevels ();
+  g_list_foreach (toplevels, (GFunc)g_object_ref, NULL);
+
+  while (toplevels)
+    {
+      GtkWindow *toplevel = toplevels->data;
+      toplevels = g_list_delete_link (toplevels, toplevels);
+
+      /* We check for MAPPED here instead of comparing to the
+       * window argument, because there can be unmapped toplevels
+       * that are != window.
+       */
+      if (GTK_WIDGET_MAPPED (toplevel)
+          && gtk_window_get_is_temporary (toplevel))
+        delete_if_temporary (GTK_WIDGET (toplevel), &client);
+
+      g_object_unref (toplevel);
+    }
+
+  g_list_free (toplevels);
 }
 #endif /* MAEMO_CHANGES && GDK_WINDOWING_X11 */
 


More information about the maemo-commits mailing list