WINGs: fix XOpenDisplay with empty string failing for WPrefs

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.
This commit is contained in:
Window Maker 2026-05-25 17:27:48 +02:00
parent 03fe6771cc
commit 8700f9a955
1 changed files with 1 additions and 1 deletions

View File

@ -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;