Re: setxkbmap -query fails with RANDR/RRGetOutputInfo error

RVP <[email protected]> Mon, 30 Dec 2024 07:29:56 +0000 (UTC)
Newsgroups gmane.os.netbsd.devel.x11
Message-ID <[email protected]>
On Sun, 22 Dec 2024, S Cole wrote:

> I was trying to run
>  setxkbmap -query
> and am getting this error:
>
> X Error of failed request:  BadRROutput (invalid Output parameter)
>  Major opcode of failed request:  141 (RANDR)
>  Minor opcode of failed request:  9 (RRGetOutputInfo)
>  Serial number of failed request:  12
>  Current serial number in output stream:  12
>

This is a setxkbmap bug fixed in 1.3.4 which is in -HEAD. See:

https://github.com/NetBSD/xsrc/blob/trunk/external/mit/setxkbmap/dist/ChangeLog#L39

which says:

     Be more careful about querying randr

     Check for extension version and number of outputs:
     XRRGetScreenResourcesCurrent was added in v1.3.  Also, there's no
     guarantee it returns any outputs, and we don't want to die with a
     BadRROutput error.

The relevant fix is this line:

https://github.com/NetBSD/xsrc/blob/trunk/external/mit/setxkbmap/dist/setxkbmap.c#L1106

> But, if I start emacs or firefox before the setxkbmap command, it works
> fine.  This is on amd64/10.1/ctwm/startx with no custom .xsession or .xinitrc.
>

Yes. Also just running this: `xrandr >/dev/null' in ~/.xinitrc, but, the correct
fix is in setxkbmap-1.3.4.

> Any suggestions?
>

Compile the newer setxkbmap in -HEAD, or just extract the binary from the
xbase tarball. That works too.

> I'll submit a PR if it would be helpful.
>

Please do.

-RVP