diff options
| author | Po Lu | 2023-07-20 09:23:06 +0800 |
|---|---|---|
| committer | Po Lu | 2023-07-20 09:23:06 +0800 |
| commit | 4d3442ebad5cb1e1005cd5eca7e91c95e767ed65 (patch) | |
| tree | 671b1d9fad4fe987ea5052417c6d29cb76e5dfce /src | |
| parent | 882e1d659fec8062e96cfb614e73954840c6ecfe (diff) | |
| parent | e2cc16fbd0d16e6c0ff59221af49e3d4113500cd (diff) | |
| download | emacs-4d3442ebad5cb1e1005cd5eca7e91c95e767ed65.tar.gz emacs-4d3442ebad5cb1e1005cd5eca7e91c95e767ed65.zip | |
Merge remote-tracking branch 'origin/master' into feature/android
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 4 | ||||
| -rw-r--r-- | src/xterm.c | 95 |
2 files changed, 81 insertions, 18 deletions
diff --git a/src/fileio.c b/src/fileio.c index 67a34d8415d..d24f25c2e06 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2644,7 +2644,7 @@ internal_delete_file (Lisp_Object filename) | |||
| 2644 | #endif | 2644 | #endif |
| 2645 | 2645 | ||
| 2646 | /* Return -1 if FILE is a case-insensitive file name, 0 if not, | 2646 | /* Return -1 if FILE is a case-insensitive file name, 0 if not, |
| 2647 | and a positive errno value if the result cannot be determined. */ | 2647 | and 1 if the result cannot be determined. */ |
| 2648 | 2648 | ||
| 2649 | static int | 2649 | static int |
| 2650 | file_name_case_insensitive_err (Lisp_Object file) | 2650 | file_name_case_insensitive_err (Lisp_Object file) |
| @@ -2678,7 +2678,7 @@ file_name_case_insensitive_err (Lisp_Object file) | |||
| 2678 | return - (res == 0); | 2678 | return - (res == 0); |
| 2679 | # endif | 2679 | # endif |
| 2680 | if (errno != EINVAL) | 2680 | if (errno != EINVAL) |
| 2681 | return errno; | 2681 | return 1; |
| 2682 | #endif | 2682 | #endif |
| 2683 | 2683 | ||
| 2684 | #if defined CYGWIN || defined DOS_NT | 2684 | #if defined CYGWIN || defined DOS_NT |
diff --git a/src/xterm.c b/src/xterm.c index 1865324d87a..f454733c659 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -5497,12 +5497,24 @@ xi_populate_device_from_info (struct x_display_info *dpyinfo, | |||
| 5497 | no input. | 5497 | no input. |
| 5498 | 5498 | ||
| 5499 | The device attachment is a device ID whose meaning varies | 5499 | The device attachment is a device ID whose meaning varies |
| 5500 | depending on the device use. If the device is a master device, | 5500 | depending on the device's use. If a device is a master device, |
| 5501 | then the attachment is the device ID of the other device in its | 5501 | then its attachment is the device ID of the other device in its |
| 5502 | seat (the master keyboard for master pointer devices, and vice | 5502 | seat (the master keyboard for master pointer devices and vice |
| 5503 | versa). Otherwise, it is the ID of the master device the slave | 5503 | versa.) Otherwise, it is the ID of the master device the slave |
| 5504 | device is attached to. For slave devices not attached to any | 5504 | device is attached to. For slave devices not attached to any |
| 5505 | seat, its value is undefined. */ | 5505 | seat, its value is undefined. |
| 5506 | |||
| 5507 | Emacs receives ordinary pointer and keyboard events from the | ||
| 5508 | master devices associated with each seat, discarding events from | ||
| 5509 | slave devices. However, multiplexing events from touch devices | ||
| 5510 | onto a master device poses problems: if both dependent and direct | ||
| 5511 | touch devices are attached to the same master pointer device, the | ||
| 5512 | coordinate space of touch events sent from that seat becomes | ||
| 5513 | ambiguous. In addition, the X server does not send TouchEnd | ||
| 5514 | events to cancel ongoing touch sequences if the slave device that | ||
| 5515 | is their source is detached. As a result of these ambiguities, | ||
| 5516 | touch events are processed from and recorded onto their slave | ||
| 5517 | devices instead. */ | ||
| 5506 | 5518 | ||
| 5507 | xi_device->device_id = device->deviceid; | 5519 | xi_device->device_id = device->deviceid; |
| 5508 | xi_device->grab = 0; | 5520 | xi_device->grab = 0; |
| @@ -5516,7 +5528,7 @@ xi_populate_device_from_info (struct x_display_info *dpyinfo, | |||
| 5516 | #ifdef HAVE_XINPUT2_2 | 5528 | #ifdef HAVE_XINPUT2_2 |
| 5517 | xi_device->touchpoints = NULL; | 5529 | xi_device->touchpoints = NULL; |
| 5518 | xi_device->direct_p = false; | 5530 | xi_device->direct_p = false; |
| 5519 | #endif | 5531 | #endif /* HAVE_XINPUT2_1 */ |
| 5520 | 5532 | ||
| 5521 | #ifdef HAVE_XINPUT2_1 | 5533 | #ifdef HAVE_XINPUT2_1 |
| 5522 | if (!dpyinfo->xi2_version) | 5534 | if (!dpyinfo->xi2_version) |
| @@ -5582,9 +5594,34 @@ xi_populate_device_from_info (struct x_display_info *dpyinfo, | |||
| 5582 | case XITouchClass: | 5594 | case XITouchClass: |
| 5583 | { | 5595 | { |
| 5584 | touch_info = (XITouchClassInfo *) device->classes[c]; | 5596 | touch_info = (XITouchClassInfo *) device->classes[c]; |
| 5585 | xi_device->direct_p = touch_info->mode == XIDirectTouch; | 5597 | |
| 5598 | /* touch_info->mode indicates the coordinate space that | ||
| 5599 | this device reports in its touch events. | ||
| 5600 | |||
| 5601 | DirectTouch means that the device uses a coordinate | ||
| 5602 | space that corresponds to locations on the screen. It | ||
| 5603 | is set by touch screen devices which are overlaid | ||
| 5604 | over the raster itself. | ||
| 5605 | |||
| 5606 | The other value (DependentTouch) means that the device | ||
| 5607 | uses a separate abstract coordinate space corresponding | ||
| 5608 | to its own surface. Emacs ignores events from these | ||
| 5609 | devices because it does not support recognizing touch | ||
| 5610 | gestures from surfaces other than the screen. | ||
| 5611 | |||
| 5612 | Master devices may report multiple touch classes for | ||
| 5613 | attached slave devices, leaving the nature of touch | ||
| 5614 | events they send ambiguous. The problem of | ||
| 5615 | discriminating between these events is bypassed | ||
| 5616 | entirely through only processing touch events from the | ||
| 5617 | slave devices where they originate. */ | ||
| 5618 | |||
| 5619 | if (touch_info->mode == XIDirectTouch) | ||
| 5620 | xi_device->direct_p = true; | ||
| 5621 | else | ||
| 5622 | xi_device->direct_p = false; | ||
| 5586 | } | 5623 | } |
| 5587 | #endif | 5624 | #endif /* HAVE_XINPUT2_2 */ |
| 5588 | default: | 5625 | default: |
| 5589 | break; | 5626 | break; |
| 5590 | } | 5627 | } |
| @@ -5611,7 +5648,7 @@ xi_populate_device_from_info (struct x_display_info *dpyinfo, | |||
| 5611 | } | 5648 | } |
| 5612 | 5649 | ||
| 5613 | SAFE_FREE (); | 5650 | SAFE_FREE (); |
| 5614 | #endif | 5651 | #endif /* HAVE_XINPUT2_1 */ |
| 5615 | } | 5652 | } |
| 5616 | 5653 | ||
| 5617 | /* Populate our client-side record of all devices, which includes | 5654 | /* Populate our client-side record of all devices, which includes |
| @@ -13443,7 +13480,7 @@ xi_handle_new_classes (struct x_display_info *dpyinfo, struct xi_device_t *devic | |||
| 13443 | device->scroll_valuator_count = 0; | 13480 | device->scroll_valuator_count = 0; |
| 13444 | #ifdef HAVE_XINPUT2_2 | 13481 | #ifdef HAVE_XINPUT2_2 |
| 13445 | device->direct_p = false; | 13482 | device->direct_p = false; |
| 13446 | #endif | 13483 | #endif /* HAVE_XINPUT2_2 */ |
| 13447 | 13484 | ||
| 13448 | for (i = 0; i < num_classes; ++i) | 13485 | for (i = 0; i < num_classes; ++i) |
| 13449 | { | 13486 | { |
| @@ -13461,10 +13498,34 @@ xi_handle_new_classes (struct x_display_info *dpyinfo, struct xi_device_t *devic | |||
| 13461 | case XITouchClass: | 13498 | case XITouchClass: |
| 13462 | touch = (XITouchClassInfo *) classes[i]; | 13499 | touch = (XITouchClassInfo *) classes[i]; |
| 13463 | 13500 | ||
| 13501 | /* touch_info->mode indicates the coordinate space that this | ||
| 13502 | device reports in its touch events. | ||
| 13503 | |||
| 13504 | DirectTouch means that the device uses a coordinate space | ||
| 13505 | that corresponds to locations on the screen. It is set | ||
| 13506 | by touch screen devices which are overlaid over the | ||
| 13507 | raster itself. | ||
| 13508 | |||
| 13509 | The other value (DependentTouch) means that the device | ||
| 13510 | uses a separate abstract coordinate space corresponding | ||
| 13511 | to its own surface. Emacs ignores events from these | ||
| 13512 | devices because it does not support recognizing touch | ||
| 13513 | gestures from surfaces other than the screen. | ||
| 13514 | |||
| 13515 | Master devices may report multiple touch classes for | ||
| 13516 | attached slave devices, leaving the nature of touch | ||
| 13517 | events they send ambiguous. The problem of | ||
| 13518 | discriminating between these events is bypassed entirely | ||
| 13519 | through only processing touch events from the slave | ||
| 13520 | devices where they originate. */ | ||
| 13521 | |||
| 13464 | if (touch->mode == XIDirectTouch) | 13522 | if (touch->mode == XIDirectTouch) |
| 13465 | device->direct_p = true; | 13523 | device->direct_p = true; |
| 13524 | else | ||
| 13525 | device->direct_p = false; | ||
| 13526 | |||
| 13466 | break; | 13527 | break; |
| 13467 | #endif | 13528 | #endif /* HAVE_XINPUT2_2 */ |
| 13468 | } | 13529 | } |
| 13469 | } | 13530 | } |
| 13470 | 13531 | ||
| @@ -13502,7 +13563,7 @@ xi_handle_new_classes (struct x_display_info *dpyinfo, struct xi_device_t *devic | |||
| 13502 | } | 13563 | } |
| 13503 | } | 13564 | } |
| 13504 | 13565 | ||
| 13505 | #endif | 13566 | #endif /* HAVE_XINPUT2_1 */ |
| 13506 | 13567 | ||
| 13507 | /* Handle EVENT, a DeviceChanged event. Look up the device that | 13568 | /* Handle EVENT, a DeviceChanged event. Look up the device that |
| 13508 | changed, and update its information with the data in EVENT. */ | 13569 | changed, and update its information with the data in EVENT. */ |
| @@ -32250,10 +32311,12 @@ reported as iconified. */); | |||
| 32250 | 32311 | ||
| 32251 | DEFVAR_BOOL ("x-input-grab-touch-events", x_input_grab_touch_events, | 32312 | DEFVAR_BOOL ("x-input-grab-touch-events", x_input_grab_touch_events, |
| 32252 | doc: /* Non-nil means to actively grab touch events. | 32313 | doc: /* Non-nil means to actively grab touch events. |
| 32253 | This means touch sequences that started on an Emacs frame will | 32314 | This means touch sequences that are obtained through a passive grab on |
| 32254 | reliably continue to receive updates even if the finger moves off the | 32315 | an Emacs frame (or a parent window of such a frame) will reliably |
| 32255 | frame, but may cause crashes with some window managers and/or external | 32316 | continue to receive updates, but may cause crashes with some window |
| 32256 | programs. */); | 32317 | managers and/or external programs. Changing this option is only |
| 32318 | useful when other programs are making their own X requests pertaining | ||
| 32319 | to the window hierarchy of an Emacs frame. */); | ||
| 32257 | x_input_grab_touch_events = true; | 32320 | x_input_grab_touch_events = true; |
| 32258 | 32321 | ||
| 32259 | DEFVAR_BOOL ("x-dnd-fix-motif-leave", x_dnd_fix_motif_leave, | 32322 | DEFVAR_BOOL ("x-dnd-fix-motif-leave", x_dnd_fix_motif_leave, |