[Top][All Lists]

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

Motif menu popups not working in CVS

From: Jan D.
Subject: Motif menu popups not working in CVS
Date: Sat, 4 Jan 2003 16:53:08 +0100 (CET)


I just noticed that the Motif popup menus aren't working.  That is,
they pop up and down OK, but invoking a menu item has no effect.
The introduction of popup_get_selection_unwind seems to be the cause:

2002-12-21  Richard M. Stallman  <address@hidden>

        * xmenu.c (popup_get_selection): Now static.  New arg DO_TIMERS.
        If it is non-nil, run timers.  Use an unwind-protect to requeue
        the events that were read ahead.
        (popup_get_selection_unwind): New subroutine.
        (popup_get_selection_queue): File-scope variable now holds that queue.
        (xmenu_show): Pass 0 for DO_TIMERS to popup_get_selection.
        (xdialog_show): Pass 1 for DO_TIMERS to popup_get_selection.
        Use an unwind-protect to pop down the dialog box.
        (xdialog_show_unwind): New subroutine implements that.

It is some sort of race condition here, it seems that
popup_get_selection exits and removes the popup before Motif has
had a chance to invoke its callback for the menu item.  Lucid
menus work OK.

I have a patch for this, but I have a question.  In popup_get_selection
events that are not acted upon immediately are saved in a queue.  Later
when the menu pops down, these events are reinserted into the X event
queue to be re-read by Emacs "normal" event handling.

I don't think this is needed.  Removing this and running shows no
ill effects, in fact, no difference between saving and not saving
can be seen for dialogs or popup menus.

The only events that do get saved are EnterNotify, LeaveNotify,
FocusOut, FocusIn and MotionNotify.  Loosing these is no big deal, since
the menu has the pointer and keyboard grabbed anyway.  What kind of
problem is saving these events supposed to solve?  If we can remove
the saving of events, the popup_get_selection_unwind can be removed also.

        Jan D.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]