summaryrefslogtreecommitdiffstats
path: root/source/xfce/xfwm4/0001-compositor-Ignore-XError-when-changing-background-pi.patch
blob: 200432b31b0457a9c6071ba340085afe2e5b036e (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 56d273ee48fffc7fed67ec7b22afd8e4b1c23c6e Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <fourdan@xfce.org>
Date: Fri, 25 Dec 2020 18:39:52 +0100
Subject: [PATCH] compositor: Ignore XError when changing background picture

If xfwm4 is compiled with support for the root pixmap in the compositor,
changing the background image may cause an XError if the external pixmap
is already freed.

Guard against such XError.

Signed-off-by: Olivier Fourdan <fourdan@xfce.org>
Closes: https://gitlab.xfce.org/xfce/xfwm4/-/issues/476
---
 src/compositor.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/compositor.c b/src/compositor.c
index 9c5ceb454..8ff0dad42 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -3774,8 +3774,11 @@ compositorHandlePropertyNotify (DisplayInfo *display_info, XPropertyEvent *ev)
             ScreenInfo *screen_info = myDisplayGetScreenFromRoot (display_info, ev->window);
             if ((screen_info) && (screen_info->compositor_active) && (screen_info->rootTile))
             {
+                myDisplayErrorTrapPush (display_info);
                 XClearArea (display_info->dpy, screen_info->output, 0, 0, 0, 0, TRUE);
                 XRenderFreePicture (display_info->dpy, screen_info->rootTile);
+                myDisplayErrorTrapPopIgnored (display_info);
+
                 screen_info->rootTile = None;
                 damage_screen (screen_info);
 
-- 
2.29.2