summaryrefslogtreecommitdiff
path: root/samples/nv-control-targets.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/nv-control-targets.c')
-rw-r--r--samples/nv-control-targets.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/samples/nv-control-targets.c b/samples/nv-control-targets.c
index 1d6c993..bc78462 100644
--- a/samples/nv-control-targets.c
+++ b/samples/nv-control-targets.c
@@ -37,6 +37,7 @@
#include "NVCtrl.h"
#include "NVCtrlLib.h"
+#include "nv-control-screen.h"
@@ -107,16 +108,8 @@ int main(int argc, char *argv[])
fprintf(stderr, "Cannot open display '%s'.\n", XDisplayName(NULL));
return 1;
}
-
- /* XXX Maybe check all screens for the NV-CONTROL X extension? */
-
- screen = DefaultScreen(dpy);
- if (!XNVCTRLIsNvScreen(dpy, screen)) {
- fprintf(stderr, "The NV-CONTROL X not available on screen "
- "%d of '%s'.\n", screen, XDisplayName(NULL));
- return 1;
- }
+ screen = GetNvXScreen(dpy);
ret = XNVCTRLQueryVersion(dpy, &major, &minor);
if (ret != True) {