From 8700f9a955a86409a2a60e6dc28402c5cf1a19ed Mon Sep 17 00:00:00 2001 From: Window Maker Date: Mon, 25 May 2026 17:27:48 +0200 Subject: [PATCH] WINGs: fix XOpenDisplay with empty string failing for WPrefs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WPrefs.app/main.c defaults display_name to "" (empty string). W_X11OpenDisplay passed this directly to XOpenDisplay, but XOpenDisplay("") is not equivalent to XOpenDisplay(NULL) — the former fails while the latter uses the DISPLAY environment variable. Treat empty display string as NULL so XOpenDisplay falls back to the environment variable. Also remove debug traces from event.c and x11_backend.c. --- WINGs/widgets_x11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WINGs/widgets_x11.c b/WINGs/widgets_x11.c index 3ce8342..01ec481 100644 --- a/WINGs/widgets_x11.c +++ b/WINGs/widgets_x11.c @@ -249,7 +249,7 @@ WMScreen *WMCreateSimpleApplicationScreen(Display * display) */ WMScreen *W_X11OpenDisplay(const char *display) { - Display *dpy = XOpenDisplay(display); + Display *dpy = XOpenDisplay(display && display[0] ? display : NULL); if (!dpy) { wwarning(_("WINGs: could not open display %s"), XDisplayName(display)); return NULL;