diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/keyboard.c | 58 |
2 files changed, 16 insertions, 50 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 53b9188dba9..b973b5b8d04 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2013-10-18 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * keyboard.c (make_lispy_event): Remove GPM-specific code that | ||
| 4 | handles mouse clicks. Instead, let GPM use the same code as all | ||
| 5 | the other mice use. See the discussion starting at | ||
| 6 | http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00521.html | ||
| 7 | for the details of the problem with the menu bar this fixes. | ||
| 8 | |||
| 1 | 2013-10-18 Dmitry Antipov <dmantipov@yandex.ru> | 9 | 2013-10-18 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 10 | ||
| 3 | Remove port-specific display name lists to avoid extra | 11 | Remove port-specific display name lists to avoid extra |
diff --git a/src/keyboard.c b/src/keyboard.c index 6b39dfe1019..0ff4cda034a 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -5547,6 +5547,9 @@ make_lispy_event (struct input_event *event) | |||
| 5547 | /* A mouse click. Figure out where it is, decide whether it's | 5547 | /* A mouse click. Figure out where it is, decide whether it's |
| 5548 | a press, click or drag, and build the appropriate structure. */ | 5548 | a press, click or drag, and build the appropriate structure. */ |
| 5549 | case MOUSE_CLICK_EVENT: | 5549 | case MOUSE_CLICK_EVENT: |
| 5550 | #ifdef HAVE_GPM | ||
| 5551 | case GPM_CLICK_EVENT: | ||
| 5552 | #endif | ||
| 5550 | #ifndef USE_TOOLKIT_SCROLL_BARS | 5553 | #ifndef USE_TOOLKIT_SCROLL_BARS |
| 5551 | case SCROLL_BAR_CLICK_EVENT: | 5554 | case SCROLL_BAR_CLICK_EVENT: |
| 5552 | #endif | 5555 | #endif |
| @@ -5560,7 +5563,11 @@ make_lispy_event (struct input_event *event) | |||
| 5560 | position = Qnil; | 5563 | position = Qnil; |
| 5561 | 5564 | ||
| 5562 | /* Build the position as appropriate for this mouse click. */ | 5565 | /* Build the position as appropriate for this mouse click. */ |
| 5563 | if (event->kind == MOUSE_CLICK_EVENT) | 5566 | if (event->kind == MOUSE_CLICK_EVENT |
| 5567 | #ifdef HAVE_GPM | ||
| 5568 | || event->kind == GPM_CLICK_EVENT | ||
| 5569 | #endif | ||
| 5570 | ) | ||
| 5564 | { | 5571 | { |
| 5565 | struct frame *f = XFRAME (event->frame_or_window); | 5572 | struct frame *f = XFRAME (event->frame_or_window); |
| 5566 | int row, column; | 5573 | int row, column; |
| @@ -6025,55 +6032,6 @@ make_lispy_event (struct input_event *event) | |||
| 6025 | case CONFIG_CHANGED_EVENT: | 6032 | case CONFIG_CHANGED_EVENT: |
| 6026 | return list3 (Qconfig_changed_event, | 6033 | return list3 (Qconfig_changed_event, |
| 6027 | event->arg, event->frame_or_window); | 6034 | event->arg, event->frame_or_window); |
| 6028 | #ifdef HAVE_GPM | ||
| 6029 | case GPM_CLICK_EVENT: | ||
| 6030 | { | ||
| 6031 | struct frame *f = XFRAME (event->frame_or_window); | ||
| 6032 | Lisp_Object head, position; | ||
| 6033 | Lisp_Object *start_pos_ptr; | ||
| 6034 | Lisp_Object start_pos; | ||
| 6035 | int button = event->code; | ||
| 6036 | |||
| 6037 | if (button >= ASIZE (button_down_location)) | ||
| 6038 | { | ||
| 6039 | ptrdiff_t incr = button - ASIZE (button_down_location) + 1; | ||
| 6040 | button_down_location = larger_vector (button_down_location, | ||
| 6041 | incr, -1); | ||
| 6042 | mouse_syms = larger_vector (mouse_syms, incr, -1); | ||
| 6043 | } | ||
| 6044 | |||
| 6045 | start_pos_ptr = aref_addr (button_down_location, button); | ||
| 6046 | start_pos = *start_pos_ptr; | ||
| 6047 | |||
| 6048 | position = make_lispy_position (f, event->x, event->y, | ||
| 6049 | event->timestamp); | ||
| 6050 | |||
| 6051 | if (event->modifiers & down_modifier) | ||
| 6052 | *start_pos_ptr = Fcopy_alist (position); | ||
| 6053 | else if (event->modifiers & (up_modifier | drag_modifier)) | ||
| 6054 | { | ||
| 6055 | if (!CONSP (start_pos)) | ||
| 6056 | return Qnil; | ||
| 6057 | event->modifiers &= ~up_modifier; | ||
| 6058 | } | ||
| 6059 | |||
| 6060 | head = modify_event_symbol (button, | ||
| 6061 | event->modifiers, | ||
| 6062 | Qmouse_click, Vlispy_mouse_stem, | ||
| 6063 | NULL, | ||
| 6064 | &mouse_syms, | ||
| 6065 | ASIZE (mouse_syms)); | ||
| 6066 | |||
| 6067 | if (event->modifiers & drag_modifier) | ||
| 6068 | return list3 (head, start_pos, position); | ||
| 6069 | else if (event->modifiers & double_modifier) | ||
| 6070 | return list3 (head, position, make_number (2)); | ||
| 6071 | else if (event->modifiers & triple_modifier) | ||
| 6072 | return list3 (head, position, make_number (3)); | ||
| 6073 | else | ||
| 6074 | return list2 (head, position); | ||
| 6075 | } | ||
| 6076 | #endif /* HAVE_GPM */ | ||
| 6077 | 6035 | ||
| 6078 | /* The 'kind' field of the event is something we don't recognize. */ | 6036 | /* The 'kind' field of the event is something we don't recognize. */ |
| 6079 | default: | 6037 | default: |