aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Teterin <mi@FreeBSD.org>2022-03-30 08:33:57 +0000
committerGuido Falsi <madpilot@FreeBSD.org>2022-03-30 08:39:04 +0000
commit8eb564bc5a6be8cb06ea69f883397176d595933f (patch)
treeb300ecfc58c8165b6ed8ce5ebcf2587c6edc7cfe
parentc04feb8937175d5d066a40b3d33957bef0123cd1 (diff)
downloadports-8eb564bc5a6be8cb06ea69f883397176d595933f.tar.gz
ports-8eb564bc5a6be8cb06ea69f883397176d595933f.zip
x11-wm/xfce4-wm: Import upsstream patch fixing crashs
xfce4-wm could crash if a broken client tries to usse a nonexistent icon. Importing upstream patch that avoids the crash. PR: 262908 Obtained from: https://gitlab.xfce.org/xfce/xfwm4/-/commit/a7971823de40a17dcba940fcef56d781626826d3 MFH: 2022Q1 (cherry picked from commit 45e9c8923b1f38f856b2df9b7385cabbff95d82c)
-rw-r--r--x11-wm/xfce4-wm/Makefile1
-rw-r--r--x11-wm/xfce4-wm/files/patch-src_icons.c46
2 files changed, 47 insertions, 0 deletions
diff --git a/x11-wm/xfce4-wm/Makefile b/x11-wm/xfce4-wm/Makefile
index dcbb0d370cfd..e61018553c3d 100644
--- a/x11-wm/xfce4-wm/Makefile
+++ b/x11-wm/xfce4-wm/Makefile
@@ -2,6 +2,7 @@
PORTNAME= xfce4-wm
PORTVERSION= 4.16.1
+PORTREVISION= 1
CATEGORIES= x11-wm xfce
MASTER_SITES= XFCE
DISTNAME= xfwm4-${DISTVERSIONFULL}
diff --git a/x11-wm/xfce4-wm/files/patch-src_icons.c b/x11-wm/xfce4-wm/files/patch-src_icons.c
new file mode 100644
index 000000000000..564d90fd25fd
--- /dev/null
+++ b/x11-wm/xfce4-wm/files/patch-src_icons.c
@@ -0,0 +1,46 @@
+--- src/icons.c.orig 2021-01-05 08:18:20 UTC
++++ src/icons.c
+@@ -295,16 +295,26 @@ static void
+ }
+
+ static void
+-get_pixmap_geometry (Display *dpy, Pixmap pixmap, guint *out_width, guint *out_height, guint *out_depth)
++get_pixmap_geometry (ScreenInfo *screen_info, Pixmap pixmap, guint *out_width, guint *out_height, guint *out_depth)
+ {
+ Window root;
+ guint border_width;
+ gint x, y;
+ guint width, height;
+ guint depth;
++ Status rc;
++ int result;
+
+- XGetGeometry (dpy, pixmap, &root, &x, &y, &width, &height, &border_width, &depth);
++ myDisplayErrorTrapPush (screen_info->display_info);
++ rc = XGetGeometry (myScreenGetXDisplay(screen_info), pixmap, &root,
++ &x, &y, &width, &height, &border_width, &depth);
++ result = myDisplayErrorTrapPop (screen_info->display_info);
+
++ if ((rc != Success) || (result != Success))
++ {
++ return;
++ }
++
+ if (out_width != NULL)
+ {
+ *out_width = width;
+@@ -371,12 +381,12 @@ try_pixmap_and_mask (ScreenInfo *screen_info, Pixmap s
+ return NULL;
+ }
+
+- get_pixmap_geometry (myScreenGetXDisplay(screen_info), src_pixmap, &w, &h, &depth);
++ get_pixmap_geometry (screen_info, src_pixmap, &w, &h, &depth);
+ surface = get_surface_from_pixmap (screen_info, src_pixmap, w, h, depth);
+
+ if (surface && src_mask != None)
+ {
+- get_pixmap_geometry (myScreenGetXDisplay(screen_info), src_mask, &w, &h, &depth);
++ get_pixmap_geometry (screen_info, src_mask, &w, &h, &depth);
+ mask_surface = get_surface_from_pixmap (screen_info, src_mask, w, h, depth);
+ }
+ else