diff options
| author | Richard M. Stallman | 1994-02-22 00:45:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-02-22 00:45:38 +0000 |
| commit | 0aafc97556697d98ef32520a10c1143be688f87a (patch) | |
| tree | 2c715f671d1c680d9a1f1760ab3c17e70ccaec78 /src | |
| parent | c8dba2407ce5cfa9088a5a67bee9bd03951b32e5 (diff) | |
| download | emacs-0aafc97556697d98ef32520a10c1143be688f87a.tar.gz emacs-0aafc97556697d98ef32520a10c1143be688f87a.zip | |
(make_lispy_event): For menu bar event in USE_X_TOOLKIT
case, convert x position to glyphs after map_event_to_object.
Call window_from_coordinates later on.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 0c8092b5682..bd8788f1501 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2492,9 +2492,7 @@ make_lispy_event (event) | |||
| 2492 | { | 2492 | { |
| 2493 | int part; | 2493 | int part; |
| 2494 | FRAME_PTR f = XFRAME (event->frame_or_window); | 2494 | FRAME_PTR f = XFRAME (event->frame_or_window); |
| 2495 | Lisp_Object window | 2495 | Lisp_Object window; |
| 2496 | = window_from_coordinates (f, XINT (event->x), XINT (event->y), | ||
| 2497 | &part); | ||
| 2498 | Lisp_Object posn; | 2496 | Lisp_Object posn; |
| 2499 | 2497 | ||
| 2500 | #ifdef USE_X_TOOLKIT | 2498 | #ifdef USE_X_TOOLKIT |
| @@ -2503,14 +2501,22 @@ make_lispy_event (event) | |||
| 2503 | if (XINT (event->y) < FRAME_MENU_BAR_LINES (f)) | 2501 | if (XINT (event->y) < FRAME_MENU_BAR_LINES (f)) |
| 2504 | #endif | 2502 | #endif |
| 2505 | { | 2503 | { |
| 2504 | Lisp_Object items; | ||
| 2505 | |||
| 2506 | #ifdef USE_X_TOOLKIT | 2506 | #ifdef USE_X_TOOLKIT |
| 2507 | /* The click happened in the menubar. | 2507 | /* The click happened in the menubar. |
| 2508 | Look for the menu item selected. */ | 2508 | Look for the menu item selected. */ |
| 2509 | Lisp_Object items = map_event_to_object (event, f); | 2509 | int row, column; |
| 2510 | |||
| 2511 | items = map_event_to_object (event, f); | ||
| 2512 | |||
| 2513 | pixel_to_glyph_coords (f, XINT (event->x), XINT (event->y), | ||
| 2514 | &column, &row, 0, 0); | ||
| 2515 | XFASTINT (event->x) = column; | ||
| 2510 | XFASTINT (event->y) = 1; | 2516 | XFASTINT (event->y) = 1; |
| 2511 | #else /* not USE_X_TOOLKIT */ | 2517 | #else /* not USE_X_TOOLKIT */ |
| 2512 | int hpos; | 2518 | int hpos; |
| 2513 | Lisp_Object items; | 2519 | |
| 2514 | items = FRAME_MENU_BAR_ITEMS (f); | 2520 | items = FRAME_MENU_BAR_ITEMS (f); |
| 2515 | for (; CONSP (items); items = XCONS (items)->cdr) | 2521 | for (; CONSP (items); items = XCONS (items)->cdr) |
| 2516 | { | 2522 | { |
| @@ -2535,7 +2541,11 @@ make_lispy_event (event) | |||
| 2535 | else | 2541 | else |
| 2536 | return Fcons (Qnil, Fcons (position, Qnil)); | 2542 | return Fcons (Qnil, Fcons (position, Qnil)); |
| 2537 | } | 2543 | } |
| 2538 | else if (XTYPE (window) != Lisp_Window) | 2544 | |
| 2545 | window = window_from_coordinates (f, XINT (event->x), | ||
| 2546 | XINT (event->y), &part); | ||
| 2547 | |||
| 2548 | if (XTYPE (window) != Lisp_Window) | ||
| 2539 | posn = Qnil; | 2549 | posn = Qnil; |
| 2540 | else | 2550 | else |
| 2541 | { | 2551 | { |