summaryrefslogtreecommitdiffstats
path: root/src/gui.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2007-09-05 19:47:23 +0000
committerBram Moolenaar <Bram@vim.org>2007-09-05 19:47:23 +0000
commit9c8791fde0dc9f8821db48a7ccf373fe90d506d9 (patch)
tree1a109da6e3f4caa4fb16c0d9ba18610842a4f09d /src/gui.c
parent102e3a6164717521e3718b7afcd72820e8bae1fc (diff)
updated for version 7.1-095v7.1.095
Diffstat (limited to 'src/gui.c')
-rw-r--r--src/gui.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gui.c b/src/gui.c
index dcd81df492..b2b8e8499d 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -4519,7 +4519,18 @@ gui_focus_change(in_focus)
xim_set_focus(in_focus);
# endif
- ui_focus_change(in_focus);
+ /* Put events in the input queue only when allowed.
+ * ui_focus_change() isn't called directly, because it invokes
+ * autocommands and that must not happen asynchronously. */
+ if (!hold_gui_events)
+ {
+ char_u bytes[3];
+
+ bytes[0] = CSI;
+ bytes[1] = KS_EXTRA;
+ bytes[2] = in_focus ? (int)KE_FOCUSGAINED : (int)KE_FOCUSLOST;
+ add_to_input_buf(bytes, 3);
+ }
#endif
}