Mercurial > emacs
changeset 37525:3ae3b09f76a1
(x_window_to_menu_bar) [USE_LUCID]: New function.
(XTread_socket) [USE_LUCID] <Expose>: Handle events for
windows that are components of a Lucid menu bar.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 30 Apr 2001 14:37:47 +0000 |
parents | f0a59a792f7d |
children | 0e76050e1b4b |
files | src/xterm.c |
diffstat | 1 files changed, 39 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xterm.c Mon Apr 30 14:34:54 2001 +0000 +++ b/src/xterm.c Mon Apr 30 14:37:47 2001 +0000 @@ -8037,6 +8037,33 @@ } +#if defined USE_X_TOOLKIT && defined USE_LUCID + +/* Return the Lucid menu bar WINDOW is part of. Return null + if WINDOW is not part of a menu bar. */ + +static Widget +x_window_to_menu_bar (window) + Window window; +{ + Lisp_Object tail; + + for (tail = Vframe_list; + XGCTYPE (tail) == Lisp_Cons; + tail = XCDR (tail)) + { + Lisp_Object frame = XCAR (tail); + Widget menu_bar = XFRAME (frame)->output_data.x->menubar_widget; + + if (menu_bar && xlwmenu_window_p (menu_bar, window)) + return menu_bar; + } + + return NULL; +} + +#endif /* USE_X_TOOLKIT && USE_LUCID */ + /************************************************************************ Toolkit scroll bars @@ -9990,6 +10017,18 @@ } else { +#if defined USE_X_TOOLKIT && defined USE_LUCID + /* Submenus of the Lucid menu bar aren't widgets + themselves, so there's no way to dispatch events + to them. Recognize this case separately. */ + { + Widget widget + = x_window_to_menu_bar (event.xexpose.window); + if (widget) + xlwmenu_redisplay (widget); + } +#endif /* USE_X_TOOLKIT && USE_LUCID */ + #ifdef USE_TOOLKIT_SCROLL_BARS /* Dispatch event to the widget. */ goto OTHER;