VendorString() doesn't work, it's always Sun Microsystems, even if it is Xorg built for Solaris.
It's possibly a little hacky, but if you look at the list of extensions returned from Xsun and Xorg you should see that Xorg has a few extra XFree86-derived extensions.
xdpyinfo
can be used to list the extensions via the command-line to check for differences; programmatically you can use XListExtensions()
or XQueryExtension()
.
(I haven't got a Xsun X Server to hand but I'm pretty sure when I've looked in the past they have differed quite abit).
$ xdpyinfo | grep vendor vendor string: The X.Org Foundation vendor release number: 10601901
This is xorg-server 1.6.1 on Linux. Hopefully XOrg and XSun on Solaris will differ here.
To output these two fields, xdpyinfo
calls the ServerVendor
macro to determine the vendor, then parses the return of the VendorRelease
macro differently depending on what ServerVendor
was.
By the way, what's VendorString()
? I don't have a function or macro by that name...
Thank you! Oops, VendorRelease() string it is. Anyway, unfortunately we cannot bet on this string. It changes often enough to have a trouble, for Xsun as well as for Xorg. I have found a solution working (hopefully) for them and for various other (derived) servers like Xvfb, Xnest etc.
Xsun does use a third value in an array of the keysyms for KP_ (numpad) keycodes. Xorg uses 1-st or 2-nd. A sniffer should first, obtain a keycode for a KP_ keysym, for instance XK_KP_7, second, sniff what is in the XKeycodeToKeysym(d,keycode, [0-3]). Our XK_KP_7 will be on the index 2 for Xsun.