changeset 24110:fe2d4fc77b05

Fix handling mouse events with menus. The bug can cause seemingly unrelated crashes. Fixes #7071. Thanks to Mark (queueRAM) for testing the fix.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 13 Sep 2008 23:31:33 +0000
parents a5838e21ddf6
children a3ac735ae75b
files finch/libgnt/gntmenu.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gntmenu.c	Fri Sep 12 18:00:08 2008 +0000
+++ b/finch/libgnt/gntmenu.c	Sat Sep 13 23:31:33 2008 +0000
@@ -399,9 +399,11 @@
 static gboolean
 gnt_menu_clicked(GntWidget *widget, GntMouseEvent event, int x, int y)
 {
-	if (!org_clicked || !org_clicked(widget, event, x, y) ||
-			!GNT_MENU(widget)->type == GNT_MENU_TOPLEVEL)
-			return FALSE;
+	if (GNT_MENU(widget)->type != GNT_MENU_POPUP)
+		return FALSE;
+
+	if (org_clicked && org_clicked(widget, event, x, y))
+		return TRUE;
 	gnt_widget_activate(widget);
 	return TRUE;
 }