[Xfce4-commits] [xfce/xfwm4] 01/01: frame: Protect XShape requests

noreply at xfce.org noreply at xfce.org
Mon Apr 13 18:30:28 CEST 2020


This is an automated email from the git hooks/post-receive script.

o   l   i   v   i   e   r       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfwm4.

commit ad33f686d645a89b6894e2abd9f3c2b6edf67301
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Mon Apr 13 18:28:00 2020 +0200

    frame: Protect XShape requests
    
    Bug: 16383
    
    If the window has vanished, the XShape request will fail.
    
    Make sure all XShape requests are protected by error traps.
    
    Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
 src/frame.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/frame.c b/src/frame.c
index 843b732..4d18704 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -475,6 +475,8 @@ frameSetShape (Client * c, int state, FramePixmap * frame_pix, int button_x[BUTT
         return;
     }
 
+    myDisplayErrorTrapPush (display_info);
+
     if (screen_info->shape_win == None)
     {
         screen_info->shape_win = XCreateSimpleWindow (display_info->dpy, screen_info->xroot, 0, 0, frameWidth (c), frameHeight (c), 0, 0, 0);
@@ -701,6 +703,8 @@ frameSetShape (Client * c, int state, FramePixmap * frame_pix, int button_x[BUTT
     rect.height = frameHeight (c);
     XShapeCombineRectangles (display_info->dpy, screen_info->shape_win, ShapeBounding, 0, 0, &rect, 1, ShapeIntersect, Unsorted);
     XShapeCombineShape (display_info->dpy, c->frame, ShapeBounding, 0, 0, screen_info->shape_win, ShapeBounding, ShapeSet);
+
+    myDisplayErrorTrapPopIgnored (display_info);
 }
 
 static void
@@ -1392,6 +1396,8 @@ frameSetShapeInput (Client * c)
         return;
     }
 
+    myDisplayErrorTrapPush (display_info);
+
     if (screen_info->shape_win == None)
     {
         screen_info->shape_win = XCreateSimpleWindow (display_info->dpy, screen_info->xroot, 0, 0, frameWidth (c), frameHeight (c), 0, 0, 0);
@@ -1406,4 +1412,6 @@ frameSetShapeInput (Client * c)
     XShapeCombineShape(display_info->dpy, screen_info->shape_win, ShapeInput, frameLeft (c), frameTop (c), c->window, ShapeBounding, ShapeSubtract);
     XShapeCombineShape(display_info->dpy, screen_info->shape_win, ShapeInput, frameLeft (c), frameTop (c), c->window, ShapeInput, ShapeUnion);
     XShapeCombineShape(display_info->dpy, c->frame, ShapeInput, 0, 0, screen_info->shape_win, ShapeInput, ShapeSet);
+
+    myDisplayErrorTrapPopIgnored (display_info);
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list