Re: Scrolling menus take 3



On 26 Oct 2000, Owen Taylor wrote:

> 
> Alexander Larsson <alla lysator liu se> writes:
> 
> > On Mon, 23 Oct 2000, Alexander Larsson wrote:
> > > 
> > > There is still a bug, and I really need some help fixing it. When you pop
> > > up a menu from a GtkOptionMenu the first time after having changed the
> > > option everything works, but each time after that (until selecting
> > > another menu item) the GtkMenuItem placed over the GtkOptionMenu doesn't
> > > get any enter_notify. This means the current menu item isn't selected
> > > until you mouse out of the item and in again.
> > > 
> > > I've tried pretty hard to understand why this happens, but I just can't
> > > figure out it, and I don't know how to continue debugging it.
> > 
> > Doesn't anyone have any idea about this. I can't think of a good way to
> > debug this.
> 
> My guess would be it has something to do with the ignore_enter
> flag; I think the appropriate debugging methology would be
> to find out why it _is_ selected the first time. It may not
> be how you expect.

No it doesn't seem to be realated to the ignore_enter. The reason that it
gets called the first time seems to be that the menuitem get a
enter_notify, and GtkItem::enter_notify calls 
 gtk_widget_event (widget->parent, (GdkEvent*) event);

Looking at the stacktrace for gtk_item_enter() shows:
#0  gtk_item_enter (widget=0x81b1880, event=0x8145760) at gtkitem.c:219
#1  0x40255593 in gtk_marshal_BOOL__POINTER (object=0x81b1880,
    func=0x4024572c <gtk_item_enter>, func_data=0x0, args=0xbffff670)
    at gtkmarshal.c:28
#2  0x40289412 in gtk_signal_real_emit (object=0x81b1880, signal_id=30,
    params=0xbffff670) at gtksignal.c:1497
#3  0x40287650 in gtk_signal_emit (object=0x81b1880, signal_id=30)
    at gtksignal.c:557
#4  0x402e7f38 in gtk_widget_event (widget=0x81b1880, event=0x8145760)
    at gtkwidget.c:2385
#5  0x4025480e in gtk_main_do_event (event=0x8145760) at gtkmain.c:853
#6  0x40372b51 in gdk_event_dispatch (source_data=0x0,
    current_time=0xbffff9f0, user_data=0x0) at gdkevents-x11.c:1368
#7  0x40134bc4 in g_main_dispatch (dispatch_time=0xbffff9f0) at gmain.c:677
#8  0x40135408 in g_main_iterate (block=1, dispatch=1) at gmain.c:898
#9  0x40135604 in g_main_run (loop=0x807bba0) at gmain.c:956
#10 0x40254133 in gtk_main () at gtkmain.c:579

Which seems to indicate that it is due to an X event.

Why this event is not sent on the second gtk_menu_popup() is a mystery to
me.

/ Alex






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]