XEvent next_event;
int finish;
#endif
+#ifdef HAVE_X_I18N
+ XIC ic = FRAME_XIC (f);
+#endif
+
struct input_event hold_quit;
char *atom_name;
Lisp_Object action, ltimestamp;
current_count = 0;
#endif
+ block_input ();
+#ifdef HAVE_X_I18N
+ /* Make sure no events get filtered when XInput 2 is enabled.
+ Otherwise, the ibus XIM server gets very confused. */
+ FRAME_XIC (f) = NULL;
+#endif
while (x_dnd_in_progress)
{
hold_quit.kind = NO_EVENT;
current_hold_quit = &hold_quit;
#endif
- block_input ();
#ifndef USE_GTK
XNextEvent (FRAME_X_DISPLAY (f), &next_event);
#else
gtk_main_iteration ();
#endif
- unblock_input ();
if (hold_quit.kind != NO_EVENT)
{
if (x_dnd_in_progress)
{
- block_input ();
if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1)
x_dnd_send_leave (f, x_dnd_last_seen_window);
- unblock_input ();
x_dnd_in_progress = false;
x_dnd_frame = NULL;
#ifdef USE_GTK
current_hold_quit = NULL;
#endif
+#ifdef HAVE_X_I18N
+ FRAME_XIC (f) = ic;
+#endif
+ unblock_input ();
quit ();
}
}
-
+#ifdef HAVE_X_I18N
+ FRAME_XIC (f) = ic;
+#endif
x_set_dnd_targets (NULL, 0);
#ifdef USE_GTK
current_hold_quit = NULL;
#endif
+ unblock_input ();
+
if (x_dnd_return_frame == 3)
{
x_dnd_return_frame_object->mouse_moved = true;
f1 = x_any_window_to_frame (dpyinfo,
event->xclient.window);
+ if (x_dnd_in_progress)
+ return 0;
+
#ifdef USE_GTK
if (!x_gtk_use_native_input
&& !dpyinfo->prefer_native_input)
struct xim_inst_t *xim_inst = (struct xim_inst_t *) client_data;
struct x_display_info *dpyinfo = xim_inst->dpyinfo;
+ if (x_dnd_in_progress)
+ return;
+
/* We don't support multiple XIM connections. */
if (dpyinfo->xim)
return;