[maemo-commits] [maemo-commits] r13586 - in projects/haf/trunk/hildon-desktop: . libhildondesktop

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Sep 4 17:51:19 EEST 2007
Author: lucasr
Date: 2007-09-04 17:51:18 +0300 (Tue, 04 Sep 2007)
New Revision: 13586

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-popup-menu.c
Log:
2007-09-04  Lucas Rocha  <lucas.rocha at nokia.com>

	* libhildondesktop/hildon-desktop-popup-menu.c
	(hildon_desktop_popup_menu_release_event,
	hildon_desktop_popup_menu_press_event): handle selection on button
	press and menu item activation on release in order to explicitly 
	show the selection before activation. Fixes: NB#61740.


Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-09-04 14:00:46 UTC (rev 13585)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-09-04 14:51:18 UTC (rev 13586)
@@ -1,3 +1,11 @@
+2007-09-04  Lucas Rocha  <lucas.rocha at nokia.com>
+
+	* libhildondesktop/hildon-desktop-popup-menu.c
+	(hildon_desktop_popup_menu_release_event,
+	hildon_desktop_popup_menu_press_event): handle selection on button
+	press and menu item activation on release in order to explicitly 
+	show the selection before activation. Fixes: NB#61740.
+
 2007-09-04 Johan Bilien  <johan.bilien at nokia.com>
 
 	* libhildondesktop/hildon-desktop-panel-window-composite.c.

Modified: projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-popup-menu.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-popup-menu.c	2007-09-04 14:00:46 UTC (rev 13585)
+++ projects/haf/trunk/hildon-desktop/libhildondesktop/hildon-desktop-popup-menu.c	2007-09-04 14:51:18 UTC (rev 13586)
@@ -629,6 +629,22 @@
 hildon_desktop_popup_menu_release_event (GtkWidget      *widget,
                                          GdkEventButton *event)
 {
+  HildonDesktopPopupMenu *menu = HILDON_DESKTOP_POPUP_MENU (widget);
+  gint w,h,x,y;
+
+  if (!menu->priv->selected_item)
+    return TRUE;
+  
+  gtk_widget_get_pointer (GTK_WIDGET (menu->priv->selected_item), &x, &y);
+
+  w = GTK_WIDGET (menu->priv->selected_item)->allocation.width;
+  h = GTK_WIDGET (menu->priv->selected_item)->allocation.height;
+
+  if ((x >= 0) && (x <= w) && (y >= 0) && (y <= h))
+  {
+    gtk_menu_item_activate (menu->priv->selected_item);
+  }
+
   return TRUE;
 } 
 	
@@ -660,8 +676,7 @@
           gtk_item_select (GTK_ITEM (l->data));
           menu->priv->selected_item = GTK_MENU_ITEM (l->data);
         }
-        
-	gtk_menu_item_activate (GTK_MENU_ITEM (l->data));
+
         break;
       }
     }


More information about the maemo-commits mailing list