diff options
Diffstat (limited to 'oldXMenu/Activate.c')
-rw-r--r-- | oldXMenu/Activate.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/oldXMenu/Activate.c b/oldXMenu/Activate.c index 646631df84b..e679c2ffed6 100644 --- a/oldXMenu/Activate.c +++ b/oldXMenu/Activate.c @@ -121,6 +121,8 @@ int x_menu_grab_keyboard = 1; static Wait_func wait_func; static void* wait_data; +static Translate_func translate_func = NULL; +static Expose_func expose_func = NULL; void XMenuActivateSetWaitFunction (Wait_func func, void *data) @@ -129,6 +131,18 @@ XMenuActivateSetWaitFunction (Wait_func func, void *data) wait_data = data; } +void +XMenuActivateSetTranslateFunction (Translate_func func) +{ + translate_func = func; +} + +void +XMenuActivateSetExposeFunction (Expose_func func) +{ + expose_func = func; +} + int XMenuActivate( register Display *display, /* Display to put menu on. */ @@ -332,6 +346,9 @@ XMenuActivate( feq = feq_tmp; } else if (_XMEventHandler) (*_XMEventHandler)(&event); + + if (expose_func) + expose_func (&event); break; } if (event_xmp->activated) { @@ -449,6 +466,9 @@ XMenuActivate( * If the current selection was activated then * deactivate it. */ + /* Emacs specific, HELP_STRING cannot be validly NULL + * in the real XMenu library. */ + help_callback (NULL, cur_p->serial, cur_s->serial); if (cur_s->activated) { cur_s->activated = False; _XMRefreshSelection(display, menu, cur_s); @@ -515,6 +535,12 @@ XMenuActivate( feq = feq_tmp; } else if (_XMEventHandler) (*_XMEventHandler)(&event); + break; +#ifdef HAVE_XINPUT2 + case GenericEvent: + if (translate_func) + translate_func (&event); +#endif } /* * If a selection has been made, break out of the event loop. |