emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 5672ee5663: Fix crash when the visible bell is rung but there is


From: Po Lu
Subject: master 5672ee5663: Fix crash when the visible bell is rung but there is no cairo surface
Date: Fri, 21 Jan 2022 20:13:42 -0500 (EST)

branch: master
commit 5672ee5663c6891c5a858e4b2f50246b6898eb1b
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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.
---
 src/pgtkterm.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 4c38ff5a59..8073f51c61 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -3734,6 +3734,9 @@ pgtk_flash (struct frame *f)
   block_input ();
 
   {
+    if (!FRAME_CR_CONTEXT (f))
+      return;
+
     cairo_surface_t *surface_orig = FRAME_CR_SURFACE (f);
 
     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.  */);
 }
 
 /* Cairo does not allow resizing a surface/context after it is
- * created, so we need to trash the old context, create a new context
- * on the next cr_clip_begin with the new dimensions and request a
- * re-draw.
- *
- * This Will leave the active context available to present on screen
- * until a redrawn frame is completed.
- */
+   created, so we need to trash the old context, create a new context
+   on the next cr_clip_begin with the new dimensions and request a
+   re-draw.
+
+   This will leave the active context available to present on screen
+   until a redrawn frame is completed.  */
 void
 pgtk_cr_update_surface_desired_size (struct frame *f, int width, int height, 
bool force)
 {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]