r192 - trunk/src/target/OM-2007/libraries/mokoui

mickey at gta01.hmw-consulting.de mickey at gta01.hmw-consulting.de
Sun Nov 5 00:40:47 CET 2006


Author: mickey
Date: 2006-11-04 23:40:46 +0000 (Sat, 04 Nov 2006)
New Revision: 192

Modified:
   trunk/src/target/OM-2007/libraries/mokoui/moko-menubox.c
Log:
mokoui: fix (hopefully) last menu forwarder bug


Modified: trunk/src/target/OM-2007/libraries/mokoui/moko-menubox.c
===================================================================
--- trunk/src/target/OM-2007/libraries/mokoui/moko-menubox.c	2006-11-04 23:14:50 UTC (rev 191)
+++ trunk/src/target/OM-2007/libraries/mokoui/moko-menubox.c	2006-11-04 23:40:46 UTC (rev 192)
@@ -86,8 +86,6 @@
             NULL,
             g_cclosure_marshal_VOID__STRING,
             G_TYPE_NONE, 1, G_TYPE_STRING );
-
-    g_debug( "filter-signal-changed ID = %d", moko_menu_box_signals[FILTER_CHANGED] );
 }
 
 static void moko_menu_box_init (MokoMenuBox *self) /* Instance Construction */
@@ -112,6 +110,8 @@
 
 static gboolean cb_button_release(GtkWidget *widget, GdkEventButton *event, GtkMenu* menu)
 {
+    MokoMenuBoxPriv* priv = MOKO_MENU_BOX_GET_PRIVATE( MOKO_MENU_BOX(widget->parent) );
+
     g_debug( "menu open forwarder: clicked on %f, %f", event->x, event->y );
     g_debug( "menu open forwarder: clicked on window %p, whereas our window is %p", event->window, widget->window );
 
@@ -120,9 +120,13 @@
     if ( !GTK_WIDGET_VISIBLE(menu) )
     {
         g_debug( "menu open forwarder: not yet open -- popping up" );
-        gtk_menu_shell_select_first( GTK_MENU_SHELL(widget), FALSE );
+        /* this is kind of funny, if you don't add the grab manually,
+           then Gtk+ won't recognize the next click (selection) */
+        gtk_grab_add(GTK_WIDGET(widget) );
+        gtk_menu_shell_select_first( GTK_MENU_SHELL(widget), TRUE );
         return TRUE;
     }
+    else
     {
         g_debug( "menu open forwarder: already open -- ignoring" );
         gtk_menu_popdown( menu );





More information about the commitlog mailing list