summaryrefslogtreecommitdiffstats
path: root/src/gui_x11.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-06-02 14:30:04 +0200
committerBram Moolenaar <Bram@vim.org>2016-06-02 14:30:04 +0200
commit4231da403e3c879dd6ac261e51f4ca60813935e3 (patch)
treed0c43a8b05ae0a727db41ac821ffc36df6d37880 /src/gui_x11.c
parentc4bc0e6542185b659d2a165b635f9561549071ea (diff)
patch 7.4.1873v7.4.1873
Problem: When a callback adds a timer the GUI doesn't use it until later. (Ramel Eshed) Solution: Return early if a callback adds a timer.
Diffstat (limited to 'src/gui_x11.c')
-rw-r--r--src/gui_x11.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/gui_x11.c b/src/gui_x11.c
index b525cf7a68..7d01e79dca 100644
--- a/src/gui_x11.c
+++ b/src/gui_x11.c
@@ -2368,7 +2368,7 @@ find_closest_color(Colormap colormap, XColor *colorPtr)
for (i = 0; i < cmap_size; i++)
colortable[i].pixel = (unsigned long)i;
- XQueryColors (gui.dpy, colormap, colortable, cmap_size);
+ XQueryColors(gui.dpy, colormap, colortable, cmap_size);
/*
* Find the color that best approximates the desired one, then
@@ -2792,7 +2792,8 @@ gui_mch_update(void)
int
gui_mch_wait_for_chars(long wtime)
{
- int focus;
+ int focus;
+ int retval = FAIL;
/*
* Make this static, in case gui_x11_timer_cb is called after leaving
@@ -2828,7 +2829,15 @@ gui_mch_wait_for_chars(long wtime)
}
#ifdef MESSAGE_QUEUE
+# ifdef FEAT_TIMERS
+ did_add_timer = FALSE;
+# endif
parse_queued_messages();
+# ifdef FEAT_TIMERS
+ if (did_add_timer)
+ /* Need to recompute the waiting time. */
+ break;
+# endif
#endif
/*
@@ -2843,12 +2852,15 @@ gui_mch_wait_for_chars(long wtime)
if (input_available())
{
- if (timer != (XtIntervalId)0 && !timed_out)
- XtRemoveTimeOut(timer);
- return OK;
+ retval = OK;
+ break;
}
}
- return FAIL;
+
+ if (timer != (XtIntervalId)0 && !timed_out)
+ XtRemoveTimeOut(timer);
+
+ return retval;
}
/*