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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Jan 10 16:48:18 EET 2007
Author: tko
Date: 2007-01-10 16:48:16 +0200 (Wed, 10 Jan 2007)
New Revision: 9039

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/gtk/gtkcombobox.c
Log:
NB#49859: When the popup window gets fully obscured, pop it down

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

	* gtk/gtkcombobox.c (gtk_combo_box_popdown, gtk_combo_box_popup,
	gtk_combo_box_popup_window_visibility_notify_event): When the popup
	window gets fully obscured, pop down the window to release grabs and
	allow keyboard lock to activate. NB#49859


Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2007-01-10 14:42:00 UTC (rev 9038)
+++ projects/haf/trunk/gtk+/ChangeLog	2007-01-10 14:48:16 UTC (rev 9039)
@@ -1,3 +1,10 @@
+2007-01-10  Tommi Komulainen  <tommi.komulainen at nokia.com>
+
+	* gtk/gtkcombobox.c (gtk_combo_box_popdown, gtk_combo_box_popup,
+	gtk_combo_box_popup_window_visibility_notify_event): When the popup
+	window gets fully obscured, pop down the window to release grabs and
+	allow keyboard lock to activate. NB#49859
+
 2006-11-28  Tommi Komulainen  <tommi.komulainen at nokia.com>
 
 	* gdk/x11/gdkinput-x11.c (_gdk_input_common_other_event): Call

Modified: projects/haf/trunk/gtk+/gtk/gtkcombobox.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtkcombobox.c	2007-01-10 14:42:00 UTC (rev 9038)
+++ projects/haf/trunk/gtk+/gtk/gtkcombobox.c	2007-01-10 14:48:16 UTC (rev 9039)
@@ -2020,6 +2020,19 @@
 		  button, activate_time);
 }
 
+/* Hildon: When the popup window gets fully obscured, pop it down to release
+ * grabs and allow keyboard lock to activate.
+ */
+static gboolean
+gtk_combo_box_popup_window_visibility_notify_event (GtkWidget          *popup_window,
+                                                    GdkEventVisibility *event,
+                                                    GtkComboBox        *combo_box)
+{
+  if (event->state == GDK_VISIBILITY_FULLY_OBSCURED)
+    gtk_combo_box_popdown (combo_box);
+  return FALSE;
+}
+
 /**
  * gtk_combo_box_popup:
  * @combo_box: a #GtkComboBox
@@ -2078,6 +2091,11 @@
   /* popup */
   gtk_widget_show (combo_box->priv->popup_window);
 
+  /* Hildon: when the popup window gets fully obscured, pop it down */
+  gtk_widget_add_events (combo_box->priv->popup_window, GDK_VISIBILITY_NOTIFY_MASK);
+  g_signal_connect (combo_box->priv->popup_window, "visibility-notify-event",
+		    G_CALLBACK (gtk_combo_box_popup_window_visibility_notify_event), combo_box);
+
   if (path)
     {
       gtk_tree_view_set_cursor (GTK_TREE_VIEW (combo_box->priv->tree_view),
@@ -2129,6 +2147,11 @@
   if (!GTK_WIDGET_REALIZED (GTK_WIDGET (combo_box)))
     return;
 
+  /* Hildon: */
+  g_signal_handlers_disconnect_by_func (combo_box->priv->popup_window,
+                                        gtk_combo_box_popup_window_visibility_notify_event,
+                                        combo_box);
+
   gtk_combo_box_list_remove_grabs (combo_box);
 
   gtk_widget_hide_all (combo_box->priv->popup_window);


More information about the maemo-commits mailing list