diff options
| author | Po Lu | 2022-08-10 10:33:43 +0800 |
|---|---|---|
| committer | Po Lu | 2022-08-10 10:33:43 +0800 |
| commit | 5e07d1d0fc93bfd59983d5a832d08e771e5b6212 (patch) | |
| tree | ab0d7c823160d336de15511846361880828ccf5e /src | |
| parent | fcd2d14db1c42add0b6aa09ac8b99cd9229596ec (diff) | |
| download | emacs-5e07d1d0fc93bfd59983d5a832d08e771e5b6212.tar.gz emacs-5e07d1d0fc93bfd59983d5a832d08e771e5b6212.zip | |
Improve MPX interaction with xwidgets and drag-and-drop
* src/xterm.c (handle_one_xevent): Handle focus interaction in
more places.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/xterm.c b/src/xterm.c index ab43a8ec517..41537ade155 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -21333,6 +21333,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 21333 | } | 21333 | } |
| 21334 | #endif | 21334 | #endif |
| 21335 | 21335 | ||
| 21336 | if (f && device) | ||
| 21337 | xi_handle_interaction (dpyinfo, f, device, | ||
| 21338 | xev->time); | ||
| 21339 | |||
| 21336 | if (xev->evtype == XI_ButtonPress | 21340 | if (xev->evtype == XI_ButtonPress |
| 21337 | && x_dnd_last_seen_window != None) | 21341 | && x_dnd_last_seen_window != None) |
| 21338 | { | 21342 | { |
| @@ -21579,11 +21583,19 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 21579 | xev->send_event); | 21583 | xev->send_event); |
| 21580 | 21584 | ||
| 21581 | source = xi_device_from_id (dpyinfo, xev->sourceid); | 21585 | source = xi_device_from_id (dpyinfo, xev->sourceid); |
| 21586 | device = xi_device_from_id (dpyinfo, xev->deviceid); | ||
| 21582 | 21587 | ||
| 21583 | #ifdef HAVE_XWIDGETS | 21588 | #ifdef HAVE_XWIDGETS |
| 21584 | xvw = xwidget_view_from_window (xev->event); | 21589 | xvw = xwidget_view_from_window (xev->event); |
| 21585 | if (xvw) | 21590 | if (xvw) |
| 21586 | { | 21591 | { |
| 21592 | /* If the user interacts with a frame that's focused | ||
| 21593 | on another device, but not the current focus | ||
| 21594 | frame, make it the focus frame. */ | ||
| 21595 | if (device) | ||
| 21596 | xi_handle_interaction (dpyinfo, xvw->frame, | ||
| 21597 | device, xev->time); | ||
| 21598 | |||
| 21587 | xwidget_button (xvw, xev->evtype == XI_ButtonPress, | 21599 | xwidget_button (xvw, xev->evtype == XI_ButtonPress, |
| 21588 | lrint (xev->event_x), lrint (xev->event_y), | 21600 | lrint (xev->event_x), lrint (xev->event_y), |
| 21589 | xev->detail, xi_convert_event_state (xev), | 21601 | xev->detail, xi_convert_event_state (xev), |
| @@ -21603,8 +21615,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 21603 | } | 21615 | } |
| 21604 | #endif | 21616 | #endif |
| 21605 | 21617 | ||
| 21606 | device = xi_device_from_id (dpyinfo, xev->deviceid); | ||
| 21607 | |||
| 21608 | if (!device) | 21618 | if (!device) |
| 21609 | goto XI_OTHER; | 21619 | goto XI_OTHER; |
| 21610 | 21620 | ||