2009-01-23 Alberto Garcia <agarcia@igalia.com>
authorAlberto Garcia <agarcia@igalia.com>
Fri, 23 Jan 2009 12:24:43 +0000 (12:24 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Fri, 23 Jan 2009 12:24:43 +0000 (12:24 +0000)
* src/hildon-program.c (hildon_program_update_top_most): Update
'is-topmost' property also when wm_hints is not set.

Fixes: NB#98383 (is-topmost signal is not emitted when task
switcher is clicked.)

ChangeLog
src/hildon-program.c

index 539d5cb..4628356 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-01-23  Alberto Garcia  <agarcia@igalia.com>
+
+       * src/hildon-program.c (hildon_program_update_top_most): Update
+       'is-topmost' property also when wm_hints is not set.
+
+       Fixes: NB#98383 (is-topmost signal is not emitted when task
+       switcher is clicked.)
+
 2009-01-23  Alejandro G. Castro  <alex@igalia.com>
 
        Patch contributed by: Artem Egorkine <ext-artem.egorkine@nokia.com>
index ad15381..5913f5b 100644 (file)
@@ -347,6 +347,7 @@ hildon_program_update_top_most                  (HildonProgram *program)
     if (active_window)
     {
       gint xerror;
+      gboolean is_topmost = FALSE;
       
       gdk_error_trap_push ();
       wm_hints = XGetWMHints (GDK_DISPLAY (), active_window);
@@ -356,22 +357,16 @@ hildon_program_update_top_most                  (HildonProgram *program)
 
       if (wm_hints)
       {
+        is_topmost = (wm_hints->window_group == priv->window_group);
+        XFree (wm_hints);
+      }
 
-          if (wm_hints->window_group == priv->window_group)
-          {
-              if (!priv->is_topmost)
-              {
-                  priv->is_topmost = TRUE;
-                  g_object_notify (G_OBJECT (program), "is-topmost");
-              }
-          }
-          else if (priv->is_topmost)
-          {
-            priv->is_topmost = FALSE;
-            g_object_notify (G_OBJECT (program), "is-topmost");
-          }
+      /* Send notification if is_topmost has changed */
+      if (!priv->is_topmost != !is_topmost)
+      {
+        priv->is_topmost = is_topmost;
+        g_object_notify (G_OBJECT (program), "is-topmost");
       }
-      XFree (wm_hints);
     }
 
     /* Check each window if it was is_topmost */