git: c48fee7e6ade - main - x11-wm/hikari: Patch to prevent crashing with GTK4 apps

From: Ashish SHUKLA <ashish_at_FreeBSD.org>
Date: Mon, 11 Jul 2022 03:31:12 UTC
The branch main has been updated by ashish:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c48fee7e6adef8939a7fbbb031e308cbbc809cd4

commit c48fee7e6adef8939a7fbbb031e308cbbc809cd4
Author:     Ashish SHUKLA <ashish@FreeBSD.org>
AuthorDate: 2022-07-10 13:53:29 +0000
Commit:     Ashish SHUKLA <ashish@FreeBSD.org>
CommitDate: 2022-07-11 03:26:46 +0000

    x11-wm/hikari: Patch to prevent crashing with GTK4 apps
    
    PR:             265110
    Reported by:    Ahmad Raniri <ahmadraniri1994 at gmail dot com>
    Tested by:      Ahmad Raniri <ahmadraniri1994 at gmail dot com>
    Obtained from:  alex at xanderio dot de
    MFH:            2022Q3 (bug fix)
---
 x11-wm/hikari/Makefile                 |  1 +
 x11-wm/hikari/files/patch-src_server.c | 12 ++++++++++++
 2 files changed, 13 insertions(+)

diff --git a/x11-wm/hikari/Makefile b/x11-wm/hikari/Makefile
index 78980a5b7d3f..a010359d57ab 100644
--- a/x11-wm/hikari/Makefile
+++ b/x11-wm/hikari/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	hikari
 DISTVERSION=	2.3.3
+PORTREVISION=	1
 CATEGORIES=	x11-wm wayland
 MASTER_SITES=	https://hikari.acmelabs.space/releases/
 
diff --git a/x11-wm/hikari/files/patch-src_server.c b/x11-wm/hikari/files/patch-src_server.c
new file mode 100644
index 000000000000..ee05cc2228a1
--- /dev/null
+++ b/x11-wm/hikari/files/patch-src_server.c
@@ -0,0 +1,12 @@
+--- src/server.c.orig	2022-01-13 09:15:55 UTC
++++ src/server.c
+@@ -523,6 +523,9 @@ static void
+ server_decoration_handler(struct wl_listener *listener, void *data)
+ {
+   struct wlr_server_decoration *wlr_decoration = data;
++  if (wlr_decoration->surface->role == NULL) {
++    return;
++  }
+   struct hikari_view *view =
+       wl_container_of(wlr_decoration->surface, view, surface);
+   struct wlr_xdg_surface *xdg_surface =