Mercurial > emacs
diff oldXMenu/Activate.c @ 58167:9351060ba546
* XMenu.h (XMenuActivateSetWaitFunction): New function.
* Activate.c (XMenuActivateSetWaitFunction): New function.
(XMenuActivate): Call wait_func if set, before XNextEvent.
author | Jan Djärv <jan.h.d@swipnet.se> |
---|---|
date | Fri, 12 Nov 2004 08:28:57 +0000 |
parents | e8824c4f5f7e |
children | 8aef5660523e 3ec251523b3e b637c617432f |
line wrap: on
line diff
--- a/oldXMenu/Activate.c Fri Nov 12 04:06:13 2004 +0000 +++ b/oldXMenu/Activate.c Fri Nov 12 08:28:57 2004 +0000 @@ -85,6 +85,20 @@ /* For debug, set this to 0 to not grab the keyboard on menu popup */ int x_menu_grab_keyboard = 1; +typedef void (*Wait_func)(); + +static Wait_func wait_func; +static void* wait_data; + +void +XMenuActivateSetWaitFunction (func, data) + Wait_func func; + void *data; +{ + wait_func = func; + wait_data = data; +} + int XMenuActivate(display, menu, p_num, s_num, x_pos, y_pos, event_mask, data, help_callback) @@ -266,6 +280,7 @@ * Begin event processing loop. */ while (1) { + if (wait_func) (*wait_func) (wait_data); XNextEvent(display, &event); /* Get next event. */ switch (event.type) { /* Dispatch on the event type. */ case Expose: @@ -557,6 +572,8 @@ free((char *)feq_tmp); } + wait_func = 0; + /* * Return successfully. */