summaryrefslogtreecommitdiff
path: root/xset.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-04-29 13:57:47 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-05-01 09:15:19 -0700
commit8ce473c45da07eb82537509a4d14ccb50262bfa7 (patch)
treec8bbc5532cd36ab9b46f68a59af3311f03dfac43 /xset.c
parent30833b82734fb2d77657b4672eaf622c30990471 (diff)
Avoid warning from "xset r rate" when XF86Misc extension is not present
- Since XF86Misc is only used if XKB is not present, don't check for XF86Misc unless XKB is not present - If we do check for XF86Misc, use QueryExtension instead of QueryVersion to avoid Xlib printing missing extension warning message when it's not found (such as in Xorg 1.6 and later). Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
Diffstat (limited to 'xset.c')
-rw-r--r--xset.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/xset.c b/xset.c
index bfdb6e7..ae1d818 100644
--- a/xset.c
+++ b/xset.c
@@ -195,18 +195,13 @@ main(int argc, char *argv[])
Display *dpy;
Bool hasargs = False;
-#ifdef XF86MISC
- int miscpresent = 1;
- int major, minor;
-#else
int miscpresent = 0;
-#endif
+ int xkbpresent = 0;
+
#ifdef XKB
- int xkbpresent = 1;
int xkbmajor = XkbMajorVersion, xkbminor = XkbMinorVersion;
int xkbopcode, xkbevent, xkberror;
#else
- int xkbpresent = 0;
#endif
#ifdef FONTCACHE
long himark, lowmark, balance;
@@ -731,22 +726,28 @@ main(int argc, char *argv[])
#ifdef XF86MISC
int rate_set = 0;
-
- if (XF86MiscQueryVersion(dpy, &major, &minor)) {
- delay = KBDDELAY_DEFAULT, rate = KBDRATE_DEFAULT;
- } else {
- miscpresent = 0;
- }
#endif
+
#ifdef XKB
if (XkbQueryExtension(dpy, &xkbopcode, &xkbevent,
&xkberror, &xkbmajor, &xkbminor)) {
- delay = XKBDDELAY_DEFAULT, rate = XKBDRATE_DEFAULT;
- } else {
- xkbpresent = 0;
+ delay = XKBDDELAY_DEFAULT;
+ rate = XKBDRATE_DEFAULT;
+ xkbpresent = 1;
+ }
+#endif
+#ifdef XF86MISC
+ if (!xkbpresent) {
+ int dummy;
+
+ if (XF86MiscQueryExtension(dpy, &dummy, &dummy)) {
+ delay = KBDDELAY_DEFAULT;
+ rate = KBDRATE_DEFAULT;
+ miscpresent = 1;
+ }
}
#endif
- if (!miscpresent && !xkbpresent)
+ if (!xkbpresent && !miscpresent)
fprintf(stderr,
"server does not have extension for \"r rate\" option\n");
i++;