diff options
| author | Jared Finder | 2020-11-14 23:44:26 -0800 |
|---|---|---|
| committer | Eli Zaretskii | 2020-11-21 10:20:05 +0200 |
| commit | 2c7687738d0b7da60014a7af05ab199936617d71 (patch) | |
| tree | b0f7eb78c6d7a833df2098d3002493992e89b8b5 /src | |
| parent | 932cb10761b9f249c87d7c19778873691f2a5d46 (diff) | |
| download | emacs-2c7687738d0b7da60014a7af05ab199936617d71.tar.gz emacs-2c7687738d0b7da60014a7af05ab199936617d71.zip | |
Migrate usage of GPM_CLICK_EVENT to MOUSE_CLICK_EVENT.
* src/termhooks.h (enum event_kind):
* src/term.c (term_mouse_click, handle_one_term_event):
* src/keyboard.c (discard_mouse_events, make_lispy_event): Migrate
usage of GPM_CLICK_EVENT to MOUSE_CLICK_EVENT.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 12 | ||||
| -rw-r--r-- | src/term.c | 8 | ||||
| -rw-r--r-- | src/termhooks.h | 4 |
3 files changed, 5 insertions, 19 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 1579c007ecf..49261fcc3e8 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -3736,9 +3736,6 @@ discard_mouse_events (void) | |||
| 3736 | if (sp->kind == MOUSE_CLICK_EVENT | 3736 | if (sp->kind == MOUSE_CLICK_EVENT |
| 3737 | || sp->kind == WHEEL_EVENT | 3737 | || sp->kind == WHEEL_EVENT |
| 3738 | || sp->kind == HORIZ_WHEEL_EVENT | 3738 | || sp->kind == HORIZ_WHEEL_EVENT |
| 3739 | #ifdef HAVE_GPM | ||
| 3740 | || sp->kind == GPM_CLICK_EVENT | ||
| 3741 | #endif | ||
| 3742 | || sp->kind == SCROLL_BAR_CLICK_EVENT | 3739 | || sp->kind == SCROLL_BAR_CLICK_EVENT |
| 3743 | || sp->kind == HORIZONTAL_SCROLL_BAR_CLICK_EVENT) | 3740 | || sp->kind == HORIZONTAL_SCROLL_BAR_CLICK_EVENT) |
| 3744 | { | 3741 | { |
| @@ -5542,9 +5539,6 @@ make_lispy_event (struct input_event *event) | |||
| 5542 | /* A mouse click. Figure out where it is, decide whether it's | 5539 | /* A mouse click. Figure out where it is, decide whether it's |
| 5543 | a press, click or drag, and build the appropriate structure. */ | 5540 | a press, click or drag, and build the appropriate structure. */ |
| 5544 | case MOUSE_CLICK_EVENT: | 5541 | case MOUSE_CLICK_EVENT: |
| 5545 | #ifdef HAVE_GPM | ||
| 5546 | case GPM_CLICK_EVENT: | ||
| 5547 | #endif | ||
| 5548 | #ifndef USE_TOOLKIT_SCROLL_BARS | 5542 | #ifndef USE_TOOLKIT_SCROLL_BARS |
| 5549 | case SCROLL_BAR_CLICK_EVENT: | 5543 | case SCROLL_BAR_CLICK_EVENT: |
| 5550 | case HORIZONTAL_SCROLL_BAR_CLICK_EVENT: | 5544 | case HORIZONTAL_SCROLL_BAR_CLICK_EVENT: |
| @@ -5559,11 +5553,7 @@ make_lispy_event (struct input_event *event) | |||
| 5559 | position = Qnil; | 5553 | position = Qnil; |
| 5560 | 5554 | ||
| 5561 | /* Build the position as appropriate for this mouse click. */ | 5555 | /* Build the position as appropriate for this mouse click. */ |
| 5562 | if (event->kind == MOUSE_CLICK_EVENT | 5556 | if (event->kind == MOUSE_CLICK_EVENT) |
| 5563 | #ifdef HAVE_GPM | ||
| 5564 | || event->kind == GPM_CLICK_EVENT | ||
| 5565 | #endif | ||
| 5566 | ) | ||
| 5567 | { | 5557 | { |
| 5568 | struct frame *f = XFRAME (event->frame_or_window); | 5558 | struct frame *f = XFRAME (event->frame_or_window); |
| 5569 | int row, column; | 5559 | int row, column; |
diff --git a/src/term.c b/src/term.c index a0738594bfc..fee3b555751 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -2481,7 +2481,7 @@ term_mouse_click (struct input_event *result, Gpm_Event *event, | |||
| 2481 | { | 2481 | { |
| 2482 | int i, j; | 2482 | int i, j; |
| 2483 | 2483 | ||
| 2484 | result->kind = GPM_CLICK_EVENT; | 2484 | result->kind = MOUSE_CLICK_EVENT; |
| 2485 | for (i = 0, j = GPM_B_LEFT; i < 3; i++, j >>= 1 ) | 2485 | for (i = 0, j = GPM_B_LEFT; i < 3; i++, j >>= 1 ) |
| 2486 | { | 2486 | { |
| 2487 | if (event->buttons & j) { | 2487 | if (event->buttons & j) { |
| @@ -2567,11 +2567,11 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event) | |||
| 2567 | { | 2567 | { |
| 2568 | f->mouse_moved = 0; | 2568 | f->mouse_moved = 0; |
| 2569 | term_mouse_click (&ie, event, f); | 2569 | term_mouse_click (&ie, event, f); |
| 2570 | /* eassert (ie.kind == GPM_CLICK_EVENT); */ | 2570 | /* eassert (ie.kind == MOUSE_CLICK_EVENT); */ |
| 2571 | if (tty_handle_tab_bar_click (f, event->x, event->y, | 2571 | if (tty_handle_tab_bar_click (f, event->x, event->y, |
| 2572 | (ie.modifiers & down_modifier) != 0, &ie)) | 2572 | (ie.modifiers & down_modifier) != 0, &ie)) |
| 2573 | { | 2573 | { |
| 2574 | /* eassert (ie.kind == GPM_CLICK_EVENT | 2574 | /* eassert (ie.kind == MOUSE_CLICK_EVENT |
| 2575 | * || ie.kind == TAB_BAR_EVENT); */ | 2575 | * || ie.kind == TAB_BAR_EVENT); */ |
| 2576 | /* tty_handle_tab_bar_click stores 2 events in the event | 2576 | /* tty_handle_tab_bar_click stores 2 events in the event |
| 2577 | queue, so we are done here. */ | 2577 | queue, so we are done here. */ |
| @@ -2581,7 +2581,7 @@ handle_one_term_event (struct tty_display_info *tty, Gpm_Event *event) | |||
| 2581 | count += 2; | 2581 | count += 2; |
| 2582 | return count; | 2582 | return count; |
| 2583 | } | 2583 | } |
| 2584 | /* eassert (ie.kind == GPM_CLICK_EVENT); */ | 2584 | /* eassert (ie.kind == MOUSE_CLICK_EVENT); */ |
| 2585 | kbd_buffer_store_event (&ie); | 2585 | kbd_buffer_store_event (&ie); |
| 2586 | count++; | 2586 | count++; |
| 2587 | } | 2587 | } |
diff --git a/src/termhooks.h b/src/termhooks.h index 6ab06ceff94..44ab14225fd 100644 --- a/src/termhooks.h +++ b/src/termhooks.h | |||
| @@ -220,10 +220,6 @@ enum event_kind | |||
| 220 | save yourself before shutdown. */ | 220 | save yourself before shutdown. */ |
| 221 | SAVE_SESSION_EVENT | 221 | SAVE_SESSION_EVENT |
| 222 | 222 | ||
| 223 | #ifdef HAVE_GPM | ||
| 224 | , GPM_CLICK_EVENT | ||
| 225 | #endif | ||
| 226 | |||
| 227 | #ifdef HAVE_DBUS | 223 | #ifdef HAVE_DBUS |
| 228 | , DBUS_EVENT | 224 | , DBUS_EVENT |
| 229 | #endif | 225 | #endif |