|
From: James P. <ja...@mo...> - 2018-04-04 13:06:12
|
Jason Gerecke wrote: > > Thanks for checking up on this -- I don't think anyone has > re-evaluated the state of nVidia xrandr support since that code was > written way back in 2011. > > The "we depend on RandR 1.3" comment definitely appears to be inaccurate. > > As for the version check, I believe the problem is that > XRRQueryVersion returns the version supported by the server, but > there's no way to know if the driver actually supports it or not (see > https://bugzilla.freedesktop.org/show_bug.cgi?id=16741). An old driver > on a new server wouldn't work as expected. Do you know if the oldest > still-supported version of the binary nVidia drivers can use the RandR > codepath successfully? If so, then we can probably just get rid of the > check entirely. Otherwise, we'd probably have to find a way to get the > nVidia driver version to see if the RandR codepath can be used or not. I have no idea what version of the Nvidia driver first supported what xsetwacom needs ... not my area of knowledge :-) I guess it would be easier to remove the "NV-CONTROL" check - but still allow the use of the 'HEAD-X' syntax by swapping the set_output_xinerama()/set_output_xrandr() order in set_output() i.e. if the real 'monitor name' is given and the Nvidia driver version doesn't support its use, then the code will still fail - but just in a different place. But if the Nvidia driver version does support it, then all is OK ... I think the following patch may work Thanks James Pearson --- ./tools/xsetwacom.c.dist 2016-08-08 01:06:24.000000000 +0100 +++ ./tools/xsetwacom.c 2018-04-04 11:05:25.289785549 +0100 @@ -2171,11 +2171,9 @@ static Bool need_xinerama(Display *dpy) int maj, min; if (!XQueryExtension(dpy, "RANDR", &opcode, &event, &error) || - !XRRQueryVersion(dpy, &maj, &min) || (maj * 1000 + min) < 1002 || - XQueryExtension(dpy, "NV-CONTROL", &opcode, &event, &error)) + !XRRQueryVersion(dpy, &maj, &min) || (maj * 1000 + min) < 1002) { - TRACE("RandR extension not found, too old, or NV-CONTROL " - "extension is also present.\n"); + TRACE("RandR extension not found or too old.\n"); return True; } @@ -2555,10 +2553,10 @@ static void set_output(Display *dpy, XDe set_output_next(dpy, dev); else if (strcasecmp(argv[0], "desktop") == 0) set_output_desktop(dpy, dev); - else if (!need_xinerama(dpy)) - set_output_xrandr(dpy, dev, argv[0]); else if (convert_value_from_user(param, argv[0], &head_no)) set_output_xinerama(dpy, dev, head_no); + else if (!need_xinerama(dpy)) + set_output_xrandr(dpy, dev, argv[0]); else fprintf(stderr, "Unable to find an output '%s'.\n", argv[0]); } |