diff options
| author | Fred Pierresteguy | 1994-01-27 11:01:59 +0000 |
|---|---|---|
| committer | Fred Pierresteguy | 1994-01-27 11:01:59 +0000 |
| commit | bb936752e942fb1f00f75cb4ecec4a6f9eeaad6e (patch) | |
| tree | ec775d66013561b98e4668d4425434c6eb0ed189 /src | |
| parent | 4466efa5538dd20997a358c5e8aa4b93e78d3182 (diff) | |
| download | emacs-bb936752e942fb1f00f75cb4ecec4a6f9eeaad6e.tar.gz emacs-bb936752e942fb1f00f75cb4ecec4a6f9eeaad6e.zip | |
* keyboard.c (make_lispy_event): Add USE_X_TOOLKIT conditional and
test FRAME_EXTERNAL_MENU_BAR.
(map_event_to_object) [USE_X_TOOLKIT]: Declare and use it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 7213b20b6f0..e53dbda540e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2386,6 +2386,10 @@ Lisp_Object Vdouble_click_time; | |||
| 2386 | 2386 | ||
| 2387 | int double_click_count; | 2387 | int double_click_count; |
| 2388 | 2388 | ||
| 2389 | #ifdef USE_X_TOOLKIT | ||
| 2390 | extern Lisp_Object map_event_to_object (); | ||
| 2391 | #endif /* USE_X_TOOLKIT */ | ||
| 2392 | |||
| 2389 | /* Given a struct input_event, build the lisp event which represents | 2393 | /* Given a struct input_event, build the lisp event which represents |
| 2390 | it. If EVENT is 0, build a mouse movement event from the mouse | 2394 | it. If EVENT is 0, build a mouse movement event from the mouse |
| 2391 | movement buffer, which should have a movement event in it. | 2395 | movement buffer, which should have a movement event in it. |
| @@ -2484,6 +2488,14 @@ make_lispy_event (event) | |||
| 2484 | &part); | 2488 | &part); |
| 2485 | Lisp_Object posn; | 2489 | Lisp_Object posn; |
| 2486 | 2490 | ||
| 2491 | #ifdef USE_X_TOOLKIT | ||
| 2492 | if (FRAME_EXTERNAL_MENU_BAR (f) && XINT (event->y) == -1) | ||
| 2493 | { | ||
| 2494 | /* The click happened in the menubar. | ||
| 2495 | Look for the menu item selected. */ | ||
| 2496 | Lisp_Object items = map_event_to_object(event, f); | ||
| 2497 | XFASTINT (event->y) = 1; | ||
| 2498 | #else /* not USE_X_TOOLKIT */ | ||
| 2487 | if (XINT (event->y) < FRAME_MENU_BAR_LINES (f)) | 2499 | if (XINT (event->y) < FRAME_MENU_BAR_LINES (f)) |
| 2488 | { | 2500 | { |
| 2489 | int hpos; | 2501 | int hpos; |
| @@ -2498,6 +2510,7 @@ make_lispy_event (event) | |||
| 2498 | && XINT (event->x) < XINT (pos) + XSTRING (string)->size) | 2510 | && XINT (event->x) < XINT (pos) + XSTRING (string)->size) |
| 2499 | break; | 2511 | break; |
| 2500 | } | 2512 | } |
| 2513 | #endif /* not USE_X_TOOLKIT */ | ||
| 2501 | position | 2514 | position |
| 2502 | = Fcons (event->frame_or_window, | 2515 | = Fcons (event->frame_or_window, |
| 2503 | Fcons (Qmenu_bar, | 2516 | Fcons (Qmenu_bar, |