diff options
| author | Po Lu | 2022-06-08 15:08:09 +0800 |
|---|---|---|
| committer | Po Lu | 2022-06-08 15:08:27 +0800 |
| commit | 22d3f0e95a5602b2bde763cff185f5b4fed6e53e (patch) | |
| tree | 1a20706bfe3ad7228209ad2ed783753534caac5e /src/xselect.c | |
| parent | 90f3da0ccdb4c58265e9f8c3d9465198d8a2092a (diff) | |
| download | emacs-22d3f0e95a5602b2bde763cff185f5b4fed6e53e.tar.gz emacs-22d3f0e95a5602b2bde763cff185f5b4fed6e53e.zip | |
Make responding to selection requests work inside popups
* src/xfns.c (Fx_file_dialog):
* src/xmenu.c (x_menu_wait_for_event, create_and_show_popup_menu)
(create_and_show_dialog, x_menu_show): Defer selection requests.
* src/xselect.c (x_get_foreign_selection)
(x_handle_selection_notify): Add some more info to selection
trace.
* src/xterm.c (x_defer_selection_requests): Make non-static.
(x_release_selection_requests_and_flush): New function.
(x_dnd_begin_drag_and_drop): Use DEFER_SELECTIONS instead.
(x_wait_for_cell_change): Fix initial value of rc for pushed
back events.
(handle_one_xevent): Allow GTK to respond to selections in its
windows too.
* src/xterm.h (DEFER_SELECTIONS): New slug of code.
Diffstat (limited to 'src/xselect.c')
| -rw-r--r-- | src/xselect.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/xselect.c b/src/xselect.c index d184489cbd8..40b6571e0ad 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -1252,7 +1252,11 @@ x_get_foreign_selection (Lisp_Object selection_symbol, Lisp_Object target_type, | |||
| 1252 | else | 1252 | else |
| 1253 | x_wait_for_cell_change (reading_selection_reply, | 1253 | x_wait_for_cell_change (reading_selection_reply, |
| 1254 | make_timespec (secs, nsecs)); | 1254 | make_timespec (secs, nsecs)); |
| 1255 | TRACE1 (" Got event = %d", !NILP (XCAR (reading_selection_reply))); | 1255 | TRACE1 (" Got event = %s", (!NILP (XCAR (reading_selection_reply)) |
| 1256 | ? (SYMBOLP (XCAR (reading_selection_reply)) | ||
| 1257 | ? SSDATA (SYMBOL_NAME (XCAR (reading_selection_reply))) | ||
| 1258 | : "YES") | ||
| 1259 | : "NO")); | ||
| 1256 | 1260 | ||
| 1257 | if (NILP (XCAR (reading_selection_reply))) | 1261 | if (NILP (XCAR (reading_selection_reply))) |
| 1258 | error ("Timed out waiting for reply from selection owner"); | 1262 | error ("Timed out waiting for reply from selection owner"); |
| @@ -1947,7 +1951,7 @@ x_handle_selection_notify (const XSelectionEvent *event) | |||
| 1947 | if (event->selection != reading_which_selection) | 1951 | if (event->selection != reading_which_selection) |
| 1948 | return; | 1952 | return; |
| 1949 | 1953 | ||
| 1950 | TRACE0 ("Received SelectionNotify"); | 1954 | TRACE1 ("Received SelectionNotify: %d", (int) event->property); |
| 1951 | XSETCAR (reading_selection_reply, | 1955 | XSETCAR (reading_selection_reply, |
| 1952 | (event->property != 0 ? Qt : Qlambda)); | 1956 | (event->property != 0 ? Qt : Qlambda)); |
| 1953 | } | 1957 | } |