Odd XBell(3) inconsistancy

Alan Coopersmith alan.coopersmith at oracle.com
Thu Sep 5 15:42:33 PDT 2013


On 09/ 5/13 02:44 PM, James Cloos wrote:
> But I cannot replicate that in any other X11 client, including a simple:
>
> #include <stdlib.h>
> #include <X11/Xlib.h>
>
> int main (int argc, char *argv[])
> {
>    int vol = 100;
>    char *disp = NULL;
>    Display *display;
>
>    if (argc > 1)
>      vol = atoi(argv[1]);
>
>    if (display = XOpenDisplay(NULL)
>      XBell(display, vol);
> }

You need an XSync() after the XBell() so that actually gets sent to the server
and not just buffered, then immediately discarded on program exit.

> I did find two places in the server src where linux' KDMKTONE ioctl is
> called.  hw/dmx/input/lnx-keyboard.c uses:
>
>   ioctl(priv->fd, KDMKTONE, ((1193190 / pitch) & 0xffff)|(duration << 16));
>
> whereas hw/xfree86/os-support/linux/lnx_bell.c uses:
>
>   ioctl(xf86Info.consoleFd, KDMKTONE, ((1193190 / pitch) & 0xffff)|((duration * loudness / 50) << 16));
>
> might the wm hit the first and everything else the latter?

Nope - those go into two different servers.   The first is only if you're
running Xdmx, the second is if you're running Xorg.


-- 
	-Alan Coopersmith-              alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - http://blogs.oracle.com/alanc


More information about the xorg-devel mailing list