[maemo-commits] [maemo-commits] r13805 - in projects/haf/trunk/hildon-desktop: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Sep 13 17:20:24 EEST 2007
Author: lucasr
Date: 2007-09-13 17:20:21 +0300 (Thu, 13 Sep 2007)
New Revision: 13805

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/src/hn-app-button.c
   projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c
Log:
2007-09-13  Lucas Rocha  <lucas.rocha at nokia.com>

	* src/hn-app-button.c (hn_app_button_release_event): restore previous
	state in case the release event occurs outside button boundaries.
	Fixes: NB#69245


Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-09-13 14:00:01 UTC (rev 13804)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-09-13 14:20:21 UTC (rev 13805)
@@ -1,3 +1,9 @@
+2007-09-13  Lucas Rocha  <lucas.rocha at nokia.com>
+
+	* src/hn-app-button.c (hn_app_button_release_event): restore previous
+	state in case the release event occurs outside button boundaries.
+	Fixes: NB#69245
+
 2007-09-13 Johan Bilien  <johan.bilien at nokia.com>
 
 	* libhildondesktop/hildon-desktop-toggle-button.c: add support

Modified: projects/haf/trunk/hildon-desktop/src/hn-app-button.c
===================================================================
--- projects/haf/trunk/hildon-desktop/src/hn-app-button.c	2007-09-13 14:00:01 UTC (rev 13804)
+++ projects/haf/trunk/hildon-desktop/src/hn-app-button.c	2007-09-13 14:20:21 UTC (rev 13805)
@@ -776,6 +776,7 @@
 
   gtk_widget_get_pointer(widget, &x, &y);
 
+#ifdef DEBUG
   g_debug ("pointer [%d,%d],\n"
           "allocation [%d, %d, %d, %d]",
           x, y,
@@ -783,7 +784,8 @@
           widget->allocation.y,
           widget->allocation.width,
           widget->allocation.height);
-
+#endif
+  
   if(x > widget->allocation.width  || x < 0 ||
      y > widget->allocation.height || y < 0)
     {
@@ -799,7 +801,18 @@
           gtk_toggle_button_set_active (priv->prev_button, TRUE);
           gtk_toggle_button_toggled (priv->prev_button);
         }
-  
+      else
+	{
+          /* Restore the previous state */
+          gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (widget), 
+			  		      !hd_wm_entry_info_is_active (app_button->priv->info));
+	  
+          gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), 
+			  		hd_wm_entry_info_is_active (app_button->priv->info));
+
+          gtk_toggle_button_toggled (GTK_TOGGLE_BUTTON (widget));
+	}
+
       /* click canceled -- we are done */
       goto out;
     }

Modified: projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c
===================================================================
--- projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c	2007-09-13 14:00:01 UTC (rev 13804)
+++ projects/haf/trunk/hildon-desktop/src/hn-app-switcher.c	2007-09-13 14:20:21 UTC (rev 13805)
@@ -266,7 +266,7 @@
   gboolean is_active = gtk_toggle_button_get_active (toggle);
   gboolean is_inconsistent = gtk_toggle_button_get_inconsistent (toggle);
   gchar *name,*name_pressed;
-  
+
   name =
    g_strdup_printf (AS_BUTTON_NAME,pos+1);
 


More information about the maemo-commits mailing list