aboutsummaryrefslogtreecommitdiffstats
path: root/src/pgtkterm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pgtkterm.c')
-rw-r--r--src/pgtkterm.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 0155ae991d3..8073f51c610 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -153,10 +153,24 @@ static int
153evq_flush (struct input_event *hold_quit) 153evq_flush (struct input_event *hold_quit)
154{ 154{
155 struct event_queue_t *evq = &event_q; 155 struct event_queue_t *evq = &event_q;
156 int i, n = evq->nr; 156 int n = 0;
157 for (i = 0; i < n; i++) 157
158 kbd_buffer_store_buffered_event (&evq->q[i], hold_quit); 158 while (evq->nr > 0)
159 evq->nr = 0; 159 {
160 /* kbd_buffer_store_buffered_event may do longjmp, so
161 we need to shift event queue first and pass the event
162 to kbd_buffer_store_buffered_event so that events in
163 queue are not processed twice. Bug#52941 */
164 union buffered_input_event ev = evq->q[0];
165 int i;
166 for (i = 1; i < evq->nr; i++)
167 evq->q[i - 1] = evq->q[i];
168 evq->nr--;
169
170 kbd_buffer_store_buffered_event (&ev, hold_quit);
171 n++;
172 }
173
160 return n; 174 return n;
161} 175}
162 176
@@ -3720,6 +3734,9 @@ pgtk_flash (struct frame *f)
3720 block_input (); 3734 block_input ();
3721 3735
3722 { 3736 {
3737 if (!FRAME_CR_CONTEXT (f))
3738 return;
3739
3723 cairo_surface_t *surface_orig = FRAME_CR_SURFACE (f); 3740 cairo_surface_t *surface_orig = FRAME_CR_SURFACE (f);
3724 3741
3725 int width = FRAME_CR_SURFACE_DESIRED_WIDTH (f); 3742 int width = FRAME_CR_SURFACE_DESIRED_WIDTH (f);
@@ -7027,13 +7044,12 @@ If set to a non-float value, there will be no wait at all. */);
7027} 7044}
7028 7045
7029/* Cairo does not allow resizing a surface/context after it is 7046/* Cairo does not allow resizing a surface/context after it is
7030 * created, so we need to trash the old context, create a new context 7047 created, so we need to trash the old context, create a new context
7031 * on the next cr_clip_begin with the new dimensions and request a 7048 on the next cr_clip_begin with the new dimensions and request a
7032 * re-draw. 7049 re-draw.
7033 * 7050
7034 * This Will leave the active context available to present on screen 7051 This will leave the active context available to present on screen
7035 * until a redrawn frame is completed. 7052 until a redrawn frame is completed. */
7036 */
7037void 7053void
7038pgtk_cr_update_surface_desired_size (struct frame *f, int width, int height, bool force) 7054pgtk_cr_update_surface_desired_size (struct frame *f, int width, int height, bool force)
7039{ 7055{