diff --git a/contrib/x11/x.factor b/contrib/x11/x.factor index 9e63f83281..1396cdd149 100644 --- a/contrib/x11/x.factor +++ b/contrib/x11/x.factor @@ -1,5 +1,6 @@ +USING: namespaces kernel compiler math arrays strings alien sequences +xlib rectangle ; -USING: namespaces kernel math arrays strings alien sequences xlib rectangle ; IN: x SYMBOL: dpy @@ -238,6 +239,16 @@ dpy get "XEvent" dup >r XNextEvent drop r> ; : events-queued ( mode -- n ) >r dpy get r> XEventsQueued ; +! 11.8 - Handling Protocol Errors + +SYMBOL: error-handler-quot + +: error-handler-callback ( -- xt ) "void" { "Display*" "XErrorEvent*" } +[ error-handler-quot get call ] alien-callback ; compiled + +: set-error-handler ( quot -- ) +error-handler-quot set error-handler-callback XSetErrorHandler drop ; + ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! 12 - Input Device Functions ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!