aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-03-21 09:32:54 +0800
committerPo Lu2022-03-21 09:34:21 +0800
commit2af8b18b2a53c11d33813ff407384f5eb53d92b2 (patch)
treebe2217f1d202de112bae3b7614c4a7d07e694f49 /src
parentf0e8f4a4ca34c6510d87266951948f527b289631 (diff)
downloademacs-2af8b18b2a53c11d33813ff407384f5eb53d92b2.tar.gz
emacs-2af8b18b2a53c11d33813ff407384f5eb53d92b2.zip
Make quitting work while DND is waitng for finish
* src/xterm.c (x_dnd_cleanup_drag_and_drop): (x_dnd_begin_drag_and_drop, handle_one_xevent) (x_free_frame_resources): Clear waiting for finish flag. (x_filter_event): Don't filter if waiting for DND finish as well.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 7928f4fafb5..ec5a65b3bb1 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1174,6 +1174,8 @@ x_dnd_cleanup_drag_and_drop (void *frame)
1174 x_set_dnd_targets (NULL, 0); 1174 x_set_dnd_targets (NULL, 0);
1175 } 1175 }
1176 1176
1177 x_dnd_waiting_for_finish = false;
1178
1177 FRAME_DISPLAY_INFO (f)->grabbed = 0; 1179 FRAME_DISPLAY_INFO (f)->grabbed = 0;
1178#ifdef USE_GTK 1180#ifdef USE_GTK
1179 current_hold_quit = NULL; 1181 current_hold_quit = NULL;
@@ -1213,7 +1215,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
1213 if (!FRAME_VISIBLE_P (f)) 1215 if (!FRAME_VISIBLE_P (f))
1214 error ("Frame is invisible"); 1216 error ("Frame is invisible");
1215 1217
1216 if (x_dnd_in_progress) 1218 if (x_dnd_in_progress || x_dnd_waiting_for_finish)
1217 error ("A drag-and-drop session is already in progress"); 1219 error ("A drag-and-drop session is already in progress");
1218 1220
1219 ltimestamp = x_timestamp_for_selection (FRAME_DISPLAY_INFO (f), 1221 ltimestamp = x_timestamp_for_selection (FRAME_DISPLAY_INFO (f),
@@ -1306,6 +1308,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
1306 x_dnd_in_progress = false; 1308 x_dnd_in_progress = false;
1307 x_dnd_frame = NULL; 1309 x_dnd_frame = NULL;
1308 x_set_dnd_targets (NULL, 0); 1310 x_set_dnd_targets (NULL, 0);
1311 x_dnd_waiting_for_finish = false;
1309 } 1312 }
1310 1313
1311 FRAME_DISPLAY_INFO (f)->grabbed = 0; 1314 FRAME_DISPLAY_INFO (f)->grabbed = 0;
@@ -1327,6 +1330,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction,
1327 FRAME_XIC (f) = ic; 1330 FRAME_XIC (f) = ic;
1328#endif 1331#endif
1329 x_set_dnd_targets (NULL, 0); 1332 x_set_dnd_targets (NULL, 0);
1333 x_dnd_waiting_for_finish = false;
1330 1334
1331#ifdef USE_GTK 1335#ifdef USE_GTK
1332 current_hold_quit = NULL; 1336 current_hold_quit = NULL;
@@ -10432,7 +10436,7 @@ x_filter_event (struct x_display_info *dpyinfo, XEvent *event)
10432 f1 = x_any_window_to_frame (dpyinfo, 10436 f1 = x_any_window_to_frame (dpyinfo,
10433 event->xclient.window); 10437 event->xclient.window);
10434 10438
10435 if (x_dnd_in_progress) 10439 if (x_dnd_in_progress || x_dnd_waiting_for_finish)
10436 return 0; 10440 return 0;
10437 10441
10438#ifdef USE_GTK 10442#ifdef USE_GTK
@@ -17563,6 +17567,7 @@ x_free_frame_resources (struct frame *f)
17563 x_dnd_send_leave (f, x_dnd_last_seen_window); 17567 x_dnd_send_leave (f, x_dnd_last_seen_window);
17564 17568
17565 x_dnd_in_progress = false; 17569 x_dnd_in_progress = false;
17570 x_dnd_waiting_for_finish = false;
17566 x_dnd_frame = NULL; 17571 x_dnd_frame = NULL;
17567 } 17572 }
17568 17573