Subject: Re: bug#46990: 28.0.50; popup menu not navigable via arrow keys on lucid build

From: Po Lu <[email-masked]>
Date: Mon, 20 Jun 2022 18:17:47 +0800

Lars Ingebrigtsen <[email-masked]> writes:

> I guess that makes sense on some level -- -Q doesn't control what Gtk
> does with the toolbar, for instance.  It's still somewhat odd-looking
> for Lucid -- is there any way we can stop it from consulting the X
> resources, or is that completely out of our hands?

It can, but I'd rather not go down the rabbit hole of modifying the
behavior of xrdb.c based on the value of `inhibit-x-resources'.

Different versions of Xlib have different bugs in that area, just look
at this mess in xterm.c:

      /* Whether or not XCloseDisplay destroys the associated resource
	 database depends on the version of libX11.  To avoid both
	 crash and memory leak, we dissociate the database from the
	 display and then destroy dpyinfo->rdb ourselves.

	 Unfortunately, the above strategy does not work in some
	 situations due to a bug in newer versions of libX11: because
	 XrmSetDatabase doesn't clear the flag XlibDisplayDfltRMDB if
	 dpy->db is NULL, XCloseDisplay destroys the associated
	 database whereas it has not been created by XGetDefault
	 (Bug#21974 in freedesktop.org Bugzilla).  As a workaround, we
	 don't destroy the database here in order to avoid the crash
	 in the above situations for now, though that may cause memory
	 leaks in other situations.  */
#if false
#ifdef HAVE_XRMSETDATABASE
      XrmSetDatabase (dpyinfo->display, NULL);
#else
      dpyinfo->display->db = NULL;
#endif
      /* We used to call XrmDestroyDatabase from x_delete_display, but
	 some older versions of libX11 crash if we call it after
	 closing all the displays.  */
      XrmDestroyDatabase (dpyinfo->rdb);
#endif

Besides, it would be slightly more annoying to debug the Lucid toolkit
that way.