diff --git a/basis/x11/xinput2/xinput2.factor b/basis/x11/xinput2/xinput2.factor index 682c79fc43..80aaf95d63 100644 --- a/basis/x11/xinput2/xinput2.factor +++ b/basis/x11/xinput2/xinput2.factor @@ -1,4 +1,17 @@ ! Copyright (C) 2010 Niklas Waern. ! See http://factorcode.org/license.txt for BSD license. -USING: ; +USING: alien.c-types combinators kernel namespaces x11 +x11.constants x11.xinput2.ffi ; IN: x11.xinput2 + +: (xi2-available?) ( display -- ? ) + 2 0 [ ] bi@ + XIQueryVersion + { + { BadRequest [ f ] } + { Success [ t ] } + [ "Internal Xlib error." throw ] + } case ; + +: xi2-available? ( -- ? ) dpy get (xi2-available?) ; inline +