[maemo-commits] [maemo-commits] r12173 - in projects/haf/trunk/hildon-1: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Jun 7 14:22:50 EEST 2007
Author: tko
Date: 2007-06-07 14:22:48 +0300 (Thu, 07 Jun 2007)
New Revision: 12173

Modified:
   projects/haf/trunk/hildon-1/ChangeLog
   projects/haf/trunk/hildon-1/src/hildon-window.c
Log:
Stop the escape timeout on focus-out-event

2007-06-07  Tommi Komulainen  <tommi.komulainen at nokia.com>

	* src/hildon-window.c (hildon_window_window_state_event,
	hildon_window_is_topmost_notify, hildon_window_class_init): Stop the
	escape timeout on focus-out-event rather than notify::is-topmost; the
	latter doesn't get called when menus pop up. Fixes: NB#52946, MB#1101


Modified: projects/haf/trunk/hildon-1/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-1/ChangeLog	2007-06-07 10:48:39 UTC (rev 12172)
+++ projects/haf/trunk/hildon-1/ChangeLog	2007-06-07 11:22:48 UTC (rev 12173)
@@ -1,3 +1,10 @@
+2007-06-07  Tommi Komulainen  <tommi.komulainen at nokia.com>
+
+	* src/hildon-window.c (hildon_window_window_state_event,
+	hildon_window_is_topmost_notify, hildon_window_class_init): Stop the
+	escape timeout on focus-out-event rather than notify::is-topmost; the
+	latter doesn't get called when menus pop up. Fixes: NB#52946, MB#1101
+
 2007-06-07  Michael Dominic Kostrzewa  <michael.kostrzewa at nokia.com> 
 
 	* src/hildon-window.c: Adding a patch from Tommi Komulainen to pass the

Modified: projects/haf/trunk/hildon-1/src/hildon-window.c
===================================================================
--- projects/haf/trunk/hildon-1/src/hildon-window.c	2007-06-07 10:48:39 UTC (rev 12172)
+++ projects/haf/trunk/hildon-1/src/hildon-window.c	2007-06-07 11:22:48 UTC (rev 12173)
@@ -185,6 +185,9 @@
 static gboolean
 hildon_window_window_state_event                (GtkWidget *widget, 
                                                  GdkEventWindowState *event);
+static gboolean
+hildon_window_focus_out_event                   (GtkWidget *widget, 
+                                                 GdkEventFocus *event);
 
 static void
 hildon_window_notify                            (GObject *gobject, 
@@ -290,6 +293,7 @@
     widget_class->key_press_event       = hildon_window_key_press_event;
     widget_class->key_release_event     = hildon_window_key_release_event;
     widget_class->window_state_event    = hildon_window_window_state_event;
+    widget_class->focus_out_event       = hildon_window_focus_out_event;
 
     /* now the object stuff */
     object_class->finalize              = hildon_window_finalize;
@@ -1219,6 +1223,25 @@
 }
 
 /*
+ * If the window lost focus while the user started to press the ESC key, we
+ * won't get the release event. We need to stop the timeout.
+ */
+static gboolean
+hildon_window_focus_out_event                   (GtkWidget *widget, 
+                                                 GdkEventFocus *event)
+{
+  HildonWindowPrivate *priv = HILDON_WINDOW_GET_PRIVATE (widget);
+
+  if (priv->escape_timeout)
+  {
+      g_source_remove (priv->escape_timeout);
+      priv->escape_timeout = 0;
+  }
+
+  return GTK_WIDGET_CLASS (parent_class)->focus_out_event (widget, event);
+}
+
+/*
  * The menu popuping needs a menu popup-function
  */
 static void
@@ -1274,18 +1297,6 @@
     {
         hildon_window_take_common_toolbar (window);
     }
-
-    else
-    {
-        /* If the window lost focus while the user started to press
-         * the ESC key, we won't get the release event. We need to
-         * stop the timeout*/
-        if (priv->escape_timeout)
-        {
-            g_source_remove (priv->escape_timeout);
-            priv->escape_timeout = 0;
-        }
-    }
 }
 
 /*


More information about the maemo-commits mailing list