aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-01-22 09:11:33 +0800
committerPo Lu2022-01-22 09:11:33 +0800
commit5672ee5663c6891c5a858e4b2f50246b6898eb1b (patch)
tree3cf0fa42ae69ae254d8e8931e0f6fb09dbec793a /src
parentfac8d0ac2f4cbdbd5828a57ddc90adf6601d956b (diff)
downloademacs-5672ee5663c6891c5a858e4b2f50246b6898eb1b.tar.gz
emacs-5672ee5663c6891c5a858e4b2f50246b6898eb1b.zip
Fix crash when the visible bell is rung but there is no cairo surface
* src/pgtkterm.c (pgtk_flash): Return if the cairo surface is not present. (bug#53420) (pgtk_cr_update_surface_desired_size): Reformat comment.
Diffstat (limited to 'src')
-rw-r--r--src/pgtkterm.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 4c38ff5a597..8073f51c610 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -3734,6 +3734,9 @@ pgtk_flash (struct frame *f)
3734 block_input (); 3734 block_input ();
3735 3735
3736 { 3736 {
3737 if (!FRAME_CR_CONTEXT (f))
3738 return;
3739
3737 cairo_surface_t *surface_orig = FRAME_CR_SURFACE (f); 3740 cairo_surface_t *surface_orig = FRAME_CR_SURFACE (f);
3738 3741
3739 int width = FRAME_CR_SURFACE_DESIRED_WIDTH (f); 3742 int width = FRAME_CR_SURFACE_DESIRED_WIDTH (f);
@@ -7041,13 +7044,12 @@ If set to a non-float value, there will be no wait at all. */);
7041} 7044}
7042 7045
7043/* Cairo does not allow resizing a surface/context after it is 7046/* Cairo does not allow resizing a surface/context after it is
7044 * 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
7045 * 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
7046 * re-draw. 7049 re-draw.
7047 * 7050
7048 * This Will leave the active context available to present on screen 7051 This will leave the active context available to present on screen
7049 * until a redrawn frame is completed. 7052 until a redrawn frame is completed. */
7050 */
7051void 7053void
7052pgtk_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)
7053{ 7055{