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:
parent
03fe6771cc
commit
8700f9a955
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue