summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2004-11-12 08:28:57 +0000
committerJan Djärv <jan.h.d@swipnet.se>2004-11-12 08:28:57 +0000
commit141dbd2b161fb6aa97b935799cfd7edb7105f980 (patch)
tree060ef378b72be75f17c90afd49e24b760fa07b74
parent036cf769ad82564e8e18da37c0d9df65fe8f4752 (diff)
downloademacs-141dbd2b161fb6aa97b935799cfd7edb7105f980.tar.gz
* XMenu.h (XMenuActivateSetWaitFunction): New function.
* Activate.c (XMenuActivateSetWaitFunction): New function. (XMenuActivate): Call wait_func if set, before XNextEvent.
-rw-r--r--oldXMenu/Activate.c17
-rw-r--r--oldXMenu/ChangeLog7
-rw-r--r--oldXMenu/XMenu.h1
3 files changed, 25 insertions, 0 deletions
diff --git a/oldXMenu/Activate.c b/oldXMenu/Activate.c
index 840c423471b..363b225a355 100644
--- a/oldXMenu/Activate.c
+++ b/oldXMenu/Activate.c
@@ -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 @@ XMenuActivate(display, menu, p_num, s_num, x_pos, y_pos, event_mask, data,
* 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 @@ XMenuActivate(display, menu, p_num, s_num, x_pos, y_pos, event_mask, data,
free((char *)feq_tmp);
}
+ wait_func = 0;
+
/*
* Return successfully.
*/
diff --git a/oldXMenu/ChangeLog b/oldXMenu/ChangeLog
index 4bcd8120556..ab86c364736 100644
--- a/oldXMenu/ChangeLog
+++ b/oldXMenu/ChangeLog
@@ -1,3 +1,10 @@
+2004-11-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
+
+ * XMenu.h (XMenuActivateSetWaitFunction): New function.
+
+ * Activate.c (XMenuActivateSetWaitFunction): New function.
+ (XMenuActivate): Call wait_func if set, before XNextEvent.
+
2002-04-22 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* Activate.c: Add calls to GrabKeyboard to remove strange
diff --git a/oldXMenu/XMenu.h b/oldXMenu/XMenu.h
index fde2a954620..46e390d3b0a 100644
--- a/oldXMenu/XMenu.h
+++ b/oldXMenu/XMenu.h
@@ -251,6 +251,7 @@ int XMenuRecompute();
int XMenuEventHandler(); /* No value actually returned. */
int XMenuLocate();
int XMenuSetFreeze(); /* No value actually returned. */
+void XMenuActivateSetWaitFunction();
int XMenuActivate();
char *XMenuPost();
int XMenuDeletePane();