aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-01-25 10:14:28 +0800
committerPo Lu2022-01-25 10:15:16 +0800
commitea953db0a06f1ca3e66fb2de6ec7500011d9b161 (patch)
treea89443fd9c0ddd6311d6bf173e5311c354c56814 /src
parenteb4edfa0c86c27d0f978bc2551ba4ebee9dda63f (diff)
downloademacs-ea953db0a06f1ca3e66fb2de6ec7500011d9b161.tar.gz
emacs-ea953db0a06f1ca3e66fb2de6ec7500011d9b161.zip
Fix invalid picture after toggling the tool bar or menu bar on GTK
* src/xterm.c (x_drop_xrender_surfaces): New function. (handle_one_xevent): Call x_drop_xrender_surfaces instead of just font_drop_xrender_surfaces.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/xterm.c b/src/xterm.c
index bf611db6bca..919c8b12ab2 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -358,6 +358,22 @@ x_flush (struct frame *f)
358 unblock_input (); 358 unblock_input ();
359} 359}
360 360
361static void
362x_drop_xrender_surfaces (struct frame *f)
363{
364 font_drop_xrender_surfaces (f);
365
366#ifdef HAVE_XRENDER
367 if (f && FRAME_X_DOUBLE_BUFFERED_P (f)
368 && FRAME_X_PICTURE (f) != None)
369 {
370 XRenderFreePicture (FRAME_X_DISPLAY (f),
371 FRAME_X_PICTURE (f));
372 FRAME_X_PICTURE (f) = None;
373 }
374#endif
375}
376
361#ifdef HAVE_XRENDER 377#ifdef HAVE_XRENDER
362MAYBE_UNUSED static void 378MAYBE_UNUSED static void
363x_xr_ensure_picture (struct frame *f) 379x_xr_ensure_picture (struct frame *f)
@@ -9061,7 +9077,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
9061 } 9077 }
9062 9078
9063 if (FRAME_X_DOUBLE_BUFFERED_P (f)) 9079 if (FRAME_X_DOUBLE_BUFFERED_P (f))
9064 font_drop_xrender_surfaces (f); 9080 x_drop_xrender_surfaces (f);
9065 f->output_data.x->has_been_visible = true; 9081 f->output_data.x->has_been_visible = true;
9066 SET_FRAME_GARBAGED (f); 9082 SET_FRAME_GARBAGED (f);
9067 unblock_input (); 9083 unblock_input ();
@@ -9885,23 +9901,14 @@ handle_one_xevent (struct x_display_info *dpyinfo,
9885 } 9901 }
9886 9902
9887 f = x_top_window_to_frame (dpyinfo, configureEvent.xconfigure.window); 9903 f = x_top_window_to_frame (dpyinfo, configureEvent.xconfigure.window);
9888 /* Unfortunately, we need to call font_drop_xrender_surfaces for 9904 /* Unfortunately, we need to call x_drop_xrender_surfaces for
9889 _all_ ConfigureNotify events, otherwise we miss some and 9905 _all_ ConfigureNotify events, otherwise we miss some and
9890 flicker. Don't try to optimize these calls by looking only 9906 flicker. Don't try to optimize these calls by looking only
9891 for size changes: that's not sufficient. We miss some 9907 for size changes: that's not sufficient. We miss some
9892 surface invalidations and flicker. */ 9908 surface invalidations and flicker. */
9893 block_input (); 9909 block_input ();
9894 if (f && FRAME_X_DOUBLE_BUFFERED_P (f)) 9910 if (f && FRAME_X_DOUBLE_BUFFERED_P (f))
9895 font_drop_xrender_surfaces (f); 9911 x_drop_xrender_surfaces (f);
9896#ifdef HAVE_XRENDER
9897 if (f && FRAME_X_DOUBLE_BUFFERED_P (f)
9898 && FRAME_X_PICTURE (f) != None)
9899 {
9900 XRenderFreePicture (FRAME_X_DISPLAY (f),
9901 FRAME_X_PICTURE (f));
9902 FRAME_X_PICTURE (f) = None;
9903 }
9904#endif
9905 unblock_input (); 9912 unblock_input ();
9906#if defined USE_CAIRO && !defined USE_GTK 9913#if defined USE_CAIRO && !defined USE_GTK
9907 if (f) 9914 if (f)
@@ -9931,7 +9938,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
9931 9938
9932 block_input (); 9939 block_input ();
9933 if (FRAME_X_DOUBLE_BUFFERED_P (f)) 9940 if (FRAME_X_DOUBLE_BUFFERED_P (f))
9934 font_drop_xrender_surfaces (f); 9941 x_drop_xrender_surfaces (f);
9935 unblock_input (); 9942 unblock_input ();
9936 xg_frame_resized (f, configureEvent.xconfigure.width, 9943 xg_frame_resized (f, configureEvent.xconfigure.width,
9937 configureEvent.xconfigure.height); 9944 configureEvent.xconfigure.height);