shithub: drawterm

Download patch

ref: ed9cff5a4c39322744c4708699c9ae6651b7c9ab
parent: 4d9d7206934403303b15ef5e62041b4426cf374b
author: Jacob Moody <moody@posixcafe.org>
date: Fri Feb 24 17:39:08 EST 2023

gui-wl: make decoman optional

GNOME doesn't use it

--- a/gui-wl/wl-cb.c
+++ b/gui-wl/wl-cb.c
@@ -698,7 +698,7 @@
 	wl_display_roundtrip(wl->display);
 	wl->xkb_context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
 
-	if(wl->shm == nil || wl->compositor == nil || wl->xdg_wm_base == nil || wl->seat == nil || wl->decoman == nil || wl->primsel == nil)
+	if(wl->shm == nil || wl->compositor == nil || wl->xdg_wm_base == nil || wl->seat == nil || wl->primsel == nil)
 		sysfatal("registration fell short");
 
 	if(wl->vpmgr != nil)
@@ -709,8 +709,10 @@
 
 	xdg_surface = xdg_wm_base_get_xdg_surface(wl->xdg_wm_base, wl->surface);
 	wl->xdg_toplevel = xdg_surface_get_toplevel(xdg_surface);
-	deco = zxdg_decoration_manager_v1_get_toplevel_decoration(wl->decoman, wl->xdg_toplevel);
-	zxdg_toplevel_decoration_v1_set_mode(deco, ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
+	if(wl->decoman != nil){
+		deco = zxdg_decoration_manager_v1_get_toplevel_decoration(wl->decoman, wl->xdg_toplevel);
+		zxdg_toplevel_decoration_v1_set_mode(deco, ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
+	}
 	xdg_surface_add_listener(xdg_surface, &xdg_surface_listener, wl);
 	xdg_toplevel_add_listener(wl->xdg_toplevel, &xdg_toplevel_listener, wl);