diff options
| author | Po Lu | 2022-10-21 19:19:33 +0800 |
|---|---|---|
| committer | Po Lu | 2022-10-21 19:19:48 +0800 |
| commit | ea70e545c90e0cbfe3ea33c31ba3ef4f3487c32c (patch) | |
| tree | 84597e41e5fecc497010b3ea76525e70d5c0991a | |
| parent | 4b40b790ae003032daa612807bc59e17f2c29dca (diff) | |
| download | emacs-ea70e545c90e0cbfe3ea33c31ba3ef4f3487c32c.tar.gz emacs-ea70e545c90e0cbfe3ea33c31ba3ef4f3487c32c.zip | |
Fix delivery of window manager ping events during menu
* oldXMenu/Activate.c (XMenuActivateSetExposeFunction)
(XMenuActivate):
* oldXMenu/XMenu.h: Remove expose functions.
* src/msdos.h (XMenuSetAEQ): Remove no longer used function.
* src/xmenu.c (x_menu_expose_event): Delete function.
(x_menu_dispatch_event): New function.
(x_menu_show): Set it as the XMenu event handler.
| -rw-r--r-- | oldXMenu/Activate.c | 10 | ||||
| -rw-r--r-- | oldXMenu/XMenu.h | 2 | ||||
| -rw-r--r-- | src/msdos.h | 1 | ||||
| -rw-r--r-- | src/xmenu.c | 14 |
4 files changed, 9 insertions, 18 deletions
diff --git a/oldXMenu/Activate.c b/oldXMenu/Activate.c index e679c2ffed6..781c05bd026 100644 --- a/oldXMenu/Activate.c +++ b/oldXMenu/Activate.c | |||
| @@ -122,7 +122,6 @@ int x_menu_grab_keyboard = 1; | |||
| 122 | static Wait_func wait_func; | 122 | static Wait_func wait_func; |
| 123 | static void* wait_data; | 123 | static void* wait_data; |
| 124 | static Translate_func translate_func = NULL; | 124 | static Translate_func translate_func = NULL; |
| 125 | static Expose_func expose_func = NULL; | ||
| 126 | 125 | ||
| 127 | void | 126 | void |
| 128 | XMenuActivateSetWaitFunction (Wait_func func, void *data) | 127 | XMenuActivateSetWaitFunction (Wait_func func, void *data) |
| @@ -137,12 +136,6 @@ XMenuActivateSetTranslateFunction (Translate_func func) | |||
| 137 | translate_func = func; | 136 | translate_func = func; |
| 138 | } | 137 | } |
| 139 | 138 | ||
| 140 | void | ||
| 141 | XMenuActivateSetExposeFunction (Expose_func func) | ||
| 142 | { | ||
| 143 | expose_func = func; | ||
| 144 | } | ||
| 145 | |||
| 146 | int | 139 | int |
| 147 | XMenuActivate( | 140 | XMenuActivate( |
| 148 | register Display *display, /* Display to put menu on. */ | 141 | register Display *display, /* Display to put menu on. */ |
| @@ -346,9 +339,6 @@ XMenuActivate( | |||
| 346 | feq = feq_tmp; | 339 | feq = feq_tmp; |
| 347 | } | 340 | } |
| 348 | else if (_XMEventHandler) (*_XMEventHandler)(&event); | 341 | else if (_XMEventHandler) (*_XMEventHandler)(&event); |
| 349 | |||
| 350 | if (expose_func) | ||
| 351 | expose_func (&event); | ||
| 352 | break; | 342 | break; |
| 353 | } | 343 | } |
| 354 | if (event_xmp->activated) { | 344 | if (event_xmp->activated) { |
diff --git a/oldXMenu/XMenu.h b/oldXMenu/XMenu.h index 54061235ae7..2eee18a3844 100644 --- a/oldXMenu/XMenu.h +++ b/oldXMenu/XMenu.h | |||
| @@ -259,7 +259,6 @@ typedef void (*Wait_func)(void*); | |||
| 259 | XPutBackEvent on an equivalent artificial core event on any | 259 | XPutBackEvent on an equivalent artificial core event on any |
| 260 | function it wants to translate. */ | 260 | function it wants to translate. */ |
| 261 | typedef void (*Translate_func)(XEvent *); | 261 | typedef void (*Translate_func)(XEvent *); |
| 262 | typedef void (*Expose_func)(XEvent *); | ||
| 263 | 262 | ||
| 264 | /* | 263 | /* |
| 265 | * XMenu library routine declarations. | 264 | * XMenu library routine declarations. |
| @@ -281,7 +280,6 @@ int XMenuLocate(Display *display, XMenu *menu, int p_num, int s_num, int x_pos, | |||
| 281 | void XMenuSetFreeze(XMenu *menu, int freeze); | 280 | void XMenuSetFreeze(XMenu *menu, int freeze); |
| 282 | void XMenuActivateSetWaitFunction(Wait_func func, void *data); | 281 | void XMenuActivateSetWaitFunction(Wait_func func, void *data); |
| 283 | void XMenuActivateSetTranslateFunction(Translate_func func); | 282 | void XMenuActivateSetTranslateFunction(Translate_func func); |
| 284 | void XMenuActivateSetExposeFunction(Expose_func func); | ||
| 285 | int XMenuActivate(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, unsigned int event_mask, char **data, void (*help_callback) (char const *, int, int)); | 283 | int XMenuActivate(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, unsigned int event_mask, char **data, void (*help_callback) (char const *, int, int)); |
| 286 | char *XMenuPost(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, int event_mask); | 284 | char *XMenuPost(Display *display, XMenu *menu, int *p_num, int *s_num, int x_pos, int y_pos, int event_mask); |
| 287 | int XMenuDeletePane(Display *display, XMenu *menu, int p_num); | 285 | int XMenuDeletePane(Display *display, XMenu *menu, int p_num); |
diff --git a/src/msdos.h b/src/msdos.h index 24697bcf24b..1b304cf02b9 100644 --- a/src/msdos.h +++ b/src/msdos.h | |||
| @@ -123,7 +123,6 @@ extern void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); | |||
| 123 | #define XGetGeometry(p1,p2,p3,p4,p5,p6,p7,p8,p9) | 123 | #define XGetGeometry(p1,p2,p3,p4,p5,p6,p7,p8,p9) |
| 124 | #define DisplayWidth(p1,p2) (SELECTED_FRAME()->text_cols) | 124 | #define DisplayWidth(p1,p2) (SELECTED_FRAME()->text_cols) |
| 125 | #define DisplayHeight(p1,p2) (SELECTED_FRAME()->text_lines) | 125 | #define DisplayHeight(p1,p2) (SELECTED_FRAME()->text_lines) |
| 126 | #define XMenuSetAEQ (void) | ||
| 127 | #define XMenuSetFreeze (void) | 126 | #define XMenuSetFreeze (void) |
| 128 | #define XMenuRecompute (void) | 127 | #define XMenuRecompute (void) |
| 129 | #define XM_FAILURE -1 | 128 | #define XM_FAILURE -1 |
diff --git a/src/xmenu.c b/src/xmenu.c index 9d35e3529fb..d9660a6910f 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -294,10 +294,13 @@ x_menu_translate_generic_event (XEvent *event) | |||
| 294 | #endif | 294 | #endif |
| 295 | 295 | ||
| 296 | #if !defined USE_X_TOOLKIT && !defined USE_GTK | 296 | #if !defined USE_X_TOOLKIT && !defined USE_GTK |
| 297 | static void | 297 | static int |
| 298 | x_menu_expose_event (XEvent *event) | 298 | x_menu_dispatch_event (XEvent *event) |
| 299 | { | 299 | { |
| 300 | x_dispatch_event (event, event->xexpose.display); | 300 | x_dispatch_event (event, event->xexpose.display); |
| 301 | |||
| 302 | /* The return doesn't really matter. */ | ||
| 303 | return 0; | ||
| 301 | } | 304 | } |
| 302 | #endif | 305 | #endif |
| 303 | #endif /* ! MSDOS */ | 306 | #endif /* ! MSDOS */ |
| @@ -2747,21 +2750,22 @@ x_menu_show (struct frame *f, int x, int y, int menuflags, | |||
| 2747 | y += 1.5 * height/ (maxlines + 2); | 2750 | y += 1.5 * height/ (maxlines + 2); |
| 2748 | } | 2751 | } |
| 2749 | 2752 | ||
| 2750 | XMenuSetAEQ (menu, true); | ||
| 2751 | XMenuSetFreeze (menu, true); | 2753 | XMenuSetFreeze (menu, true); |
| 2752 | pane = selidx = 0; | 2754 | pane = selidx = 0; |
| 2753 | 2755 | ||
| 2754 | #ifndef MSDOS | 2756 | #ifndef MSDOS |
| 2755 | DEFER_SELECTIONS; | 2757 | DEFER_SELECTIONS; |
| 2756 | 2758 | ||
| 2757 | XMenuActivateSetWaitFunction (x_menu_wait_for_event, FRAME_X_DISPLAY (f)); | 2759 | XMenuActivateSetWaitFunction (x_menu_wait_for_event, |
| 2760 | FRAME_X_DISPLAY (f)); | ||
| 2761 | XMenuEventHandler (x_menu_dispatch_event); | ||
| 2762 | |||
| 2758 | /* When the input extension is in use, the owner_events grab will | 2763 | /* When the input extension is in use, the owner_events grab will |
| 2759 | report extension events on frames, which the XMenu library does | 2764 | report extension events on frames, which the XMenu library does |
| 2760 | not normally understand. */ | 2765 | not normally understand. */ |
| 2761 | #ifdef HAVE_XINPUT2 | 2766 | #ifdef HAVE_XINPUT2 |
| 2762 | XMenuActivateSetTranslateFunction (x_menu_translate_generic_event); | 2767 | XMenuActivateSetTranslateFunction (x_menu_translate_generic_event); |
| 2763 | #endif | 2768 | #endif |
| 2764 | XMenuActivateSetExposeFunction (x_menu_expose_event); | ||
| 2765 | #endif | 2769 | #endif |
| 2766 | 2770 | ||
| 2767 | record_unwind_protect_ptr (pop_down_menu, | 2771 | record_unwind_protect_ptr (pop_down_menu, |