<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel about="http://blog.gmane.org/gmane.lisp.mcclim.devel">
    <title>gmane.lisp.mcclim.devel</title>
    <link>http://blog.gmane.org/gmane.lisp.mcclim.devel</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1714"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1713"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1712"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1711"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1710"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1709"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1708"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1707"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1706"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1705"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1704"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1703"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1702"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1701"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1700"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1699"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1698"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1697"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1696"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1695"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1714">
    <title>Re: Strange black borders around my application paneinside scrolling</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1714</link>
    <description>This is a known bug in mcclim.

You can try loading this as a workaround:
http://vintage-digital.com/hefner/mcclim/update-mirror-geometry.lisp
</description>
    <dc:creator>Andy Hefner</dc:creator>
    <dc:date>2008-09-21T07:44:17</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1713">
    <title>Strange black borders around my application paneinside scrolling</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1713</link>
    <description>Hi list,

I have a small clim application with an application pane inside a
scrolling macro. The code looks like this:


  (:panes (app :application
               :width 800
               :height 600
               :scroll-bars nil
               :borders nil
               :text-style (make-text-style :sans-serif
                                            :roman 
                                            :normal)
               :display-function 'display-app)
          (int :interactor
               :width 800
               :height 100
               :maxheight 100))
  (:layouts (default (vertically ()
                       (scrolling (:scroll-bars :vertical) app)
                       int))))

Now I get strange black borders around the pane like there:
http://home.in.tum.de/~demmeln/screenshot.jpg

Notice the big black border at the bottom which actually swallows
content aswell.

Does anyone know how to get rid of tose borders?

Best regards,
Nikolaus Demmel

</description>
    <dc:creator>Nikolaus Demmel</dc:creator>
    <dc:date>2008-09-18T11:54:22</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1712">
    <title>Re: [bug] Asynchronous ID-CHOICE-ERROR -- CLX orMcCLIM?</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1712</link>
    <description> (defmethod port-deallocate-pixmap ((port clx-port) pixmap)
+  (let ((medium (climi::pixmap-medium pixmap)))
+    (when medium
+      (with-slots (gc) medium
+        (when gc
+          (xlib:free-gcontext gc)))))
   (when (port-lookup-mirror port pixmap)
     (destroy-mirror port pixmap)))

Would it be more appropriate to move the subform starting with
(with-slots (gc) ..) to deallocate-medium (or possibly
degraft-medium), and one of those instead? Not a big deal, given
virtually nothing else in mcclim calls these when it probably should.
</description>
    <dc:creator>Andy Hefner</dc:creator>
    <dc:date>2008-08-23T16:05:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1711">
    <title>Re: [bug] Asynchronous ID-CHOICE-ERROR -- CLX orMcCLIM?</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1711</link>
    <description>

I attach a patch for consideration against mcclim (yeah, I know, I
have commit access, but I'm rusty) which seems to fix the leaky
gcontext problem in the CLX backend.  There may well be an analogous
problem in other backends (except the Null backend :-); I haven't
investigated.


I've also got something like Andy's resourcealloc patch in my clx (not
pushed yet), along with a fix for Shawn's resource ID issue.  Wow,
it's almost like being up to date...

Best,

Christophe
</description>
    <dc:creator>Christophe Rhodes</dc:creator>
    <dc:date>2008-08-23T13:31:54</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1710">
    <title>Re: [bug] Asynchronous ID-CHOICE-ERROR -- CLX orMcCLIM?</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1710</link>
    <description>I think there are two bugs at play here - first, that CLX makes no
attempt to avoid reusing IDs that are still in use once the count
wraps around, and second that in this instance mcclim creates millions
of gcontexts without freeing them.

I've hacked resourcealloc in CLX to check against the id cache,
skipping IDs which are still in use, but this runs into the problem
that not all types (in particular, graphics contexts) are stored in
the cache. There's some comment about this not being useful and
wasting space in depdefs.lisp next to defconstant +clx-cached-types+,
and without considering the performance implications I've worked
around it by setting the hash table entry to T at the point the ID is
allocated, so that (I hope) every allocated resource is now there. To
do this correctly also requirse that the deallocate-resource-id be
changed to unconditionally invoke deallocate-resource-id-internal
(thereby making the macro useless), which I've neglected to do. With
that in mind, here's a version of resourcealloc with the changes
described:

(defun resourcealloc (display)
  ;; Allocate a resource-id for in DISPLAY
  (declare (type display display))
  (declare (clx-values resource-id))

  (loop for next-count upfrom (1+ (display-resource-id-count display))
        repeat (1+ (display-resource-id-mask display))
        as id = (dpb next-count
                     (display-resource-id-byte display)
                     (display-resource-id-base display))
        do
        (when (nth-value 1 (gethash id (display-resource-id-map display)))
          #+NIL
          (format *trace-output* "~&amp;Skipping ~X (~A)~%" id (gethash id
(display-resource-id-map display))))
        (when (zerop (random 10000)) (format *trace-output* "~&amp;~X~%" id))
        (unless (nth-value 1 (gethash id (display-resource-id-map display)))
          (setf (display-resource-id-count display) next-count)
          #+NIL
          (format *trace-output* "~&amp;Allocating ~X (~A IDs in use)~%"
                  id
                  (hash-table-count (display-resource-id-map display)))
          (setf (gethash id (display-resource-id-map display)) t)
          (when (= id #x2A00027) (break "Hi there."))
          (return-from resourcealloc id)))
  (assert (= (hash-table-count (display-resource-id-map display))
             (1+ (display-resource-id-mask display))))
  (error "Available X resource IDs have been exhausted."))

Fixing this allocation issue doesn't solve the underlying problem that
this test causes mcclim to exhaust the available space of resource-ids
by never freeing these gcontexts.
</description>
    <dc:creator>Andy Hefner</dc:creator>
    <dc:date>2008-08-22T17:40:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1709">
    <title>Re: [bug] Asynchronous ID-CHOICE-ERROR -- CLX orMcCLIM?</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1709</link>
    <description>
I did not, but here are the results from a new run:

Received CLX ID-CHOICE-ERROR in process NIL

debugger invoked on a XLIB:ID-CHOICE-ERROR:
  Asynchronous ID-CHOICE-ERROR in request 10247 (last request was
10248)  Code 55.0 [CreateGC] ID #x800002

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE ] Ignore
  1: [TRY-AGAIN] Try executing the command COM-STRESS again
  2: [ABORT    ] Return to application command loop
  3:             Exit debugger, returning to top level.

(XLIB::X-CERROR "Ignore" XLIB:ID-CHOICE-ERROR)[:EXTERNAL]
0] (let ((display (xlib:open-default-display)))
     (values (xlib:display-resource-id-mask display)
             (xlib:display-resource-id-base display)))

2097151
10485760
0]

I'm keeping the session alive, so let me know if you need anything else.

Cheers,

 -- Nikodemus
</description>
    <dc:creator>Nikodemus Siivola</dc:creator>
    <dc:date>2008-08-22T16:32:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1708">
    <title>Re: [bug] Asynchronous ID-CHOICE-ERROR -- CLX orMcCLIM?</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1708</link>
    <description>

Please tell me you saved the exact error message and can now add that
piece of information... in particular, I'm interested in the hex
number that is reported as part of the id-choice error.

C.
</description>
    <dc:creator>Christophe Rhodes</dc:creator>
    <dc:date>2008-08-22T15:30:52</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1707">
    <title>Re: [bug] Asynchronous ID-CHOICE-ERROR -- CLX orMcCLIM?</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1707</link>
    <description>
Was able to reproduce here, though it took something like 30 minutes.


In the image where I had just duplicated the error, while in the debugger:

2097151
10485760

In a clean image with just CLX loaded:

2097151
8388608

Cheers,

 -- Nikodemus
</description>
    <dc:creator>Nikodemus Siivola</dc:creator>
    <dc:date>2008-08-22T12:50:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1706">
    <title>Re: [bug] Asynchronous ID-CHOICE-ERROR -- CLX orMcCLIM?</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1706</link>
    <description>

It's still going here, about 4 hours later.  Can you run

(let ((display (xlib:open-default-display)))
  (values (xlib::display-resource-id-mask display)
          (xlib::display-resource-id-base display)))

against your X server?

Thanks,

Christophe
</description>
    <dc:creator>Christophe Rhodes</dc:creator>
    <dc:date>2008-08-22T12:20:25</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1705">
    <title>Re: [bug] Asynchronous ID-CHOICE-ERROR -- CLX orMcCLIM?</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1705</link>
    <description>

IIRC it used to break in less then five minutes. I'll try to reproduce
again before updating CLX.

Cheers,

 -- Nikodemus
</description>
    <dc:creator>Nikodemus Siivola</dc:creator>
    <dc:date>2008-08-22T12:09:55</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1704">
    <title>Re: [bug] Asynchronous ID-CHOICE-ERROR -- CLX orMcCLIM?</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1704</link>
    <description>

I don't think this is related, but I have been investigating that one
this morning anyway, while waiting for your test case to break.  (It's
been about an hour so far; is that normal?  I can suggest diagnostics
to run on your system if not.)  Because your resource ID was
suspicious (had a large number of 0s in it: #x600002 or so) I would
tend to suspect either a bug in the resource ID logic in clx, or a bug
in the X server (this is Apple, after all...)

I think that the fix to Shawn's problem is to teach clx to cache only
its own client resource IDs, and not anyone else's.  Before installing
that fix, I want to read xlib or xcb sources, and possibly a window
manager's, to check that that's sane.  (If someone else wants to read
xlib/xcb sources instead, please be my guest!)

Best,

Christophe
</description>
    <dc:creator>Christophe Rhodes</dc:creator>
    <dc:date>2008-08-22T10:16:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1703">
    <title>Re: [bug] Asynchronous ID-CHOICE-ERROR -- CLX orMcCLIM?</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1703</link>
    <description>
I don't remember offhand for sure, but I think that was actually on a
single-threaded SBCL -- so there would perforce be only one thread in
Lisp Land.

Since it seems to be in danger of falling through the cracks, here is
a (possibly related) report from sbcl-devel.

Cheers,

 -- Nikodemus

---------- Forwarded message ----------
From: Shawn &lt;sabetts&lt; at &gt;gmail.com&gt;
Date: Sat, Jul 12, 2008 at 5:27 AM
Subject: Re: [Sbcl-devel] breaking the clx xid cache
To: sbcl-devel&lt; at &gt;lists.sf.net


Hi folks,

It looks like the portable-clx mailing list is down so I'm sending this here.

In stumpwm I've been getting more and more error reports where the
:window slot for events is a pixmap instead of a window. I've tracked
it to a problem with the xid cache in clx. X appears to be recycling
XIDs which confuses clx. Here's a function that exposes the bug:

(defun break-display-xid-cache ()
 (labels ((make-win (dpy)
            (xlib:create-window :parent (xlib:screen-root (first
(xlib:display-roots dpy))) :x 0 :y 0 :width 50 :height 50))
          (make-pixmap (window)
            (xlib:create-pixmap :width (random 100) :height (random
100) :depth 8 :drawable window))
          (first-pass (dpy)
            ;; Open a fresh connection. Create a window and a pixmap.
            (let* ((dpy2 (xlib:open-default-display))
                   (window (make-win dpy2))
                   (pixmap (make-pixmap window)))
              ;; make the pixmap the window's icon pixmap hint.
              (setf (xlib:wm-hints window) (xlib:make-wm-hints
:icon-pixmap pixmap))
              (format t "Window ID: ~s pixmap ID: ~s~%"
(xlib:window-id window) (xlib:pixmap-id pixmap))
              (xlib:display-finish-output dpy2)
              ;; On the old connection, list the root window children
              ;; and the icon pixmap hint to cache their XIDs.
              (loop for w in (xlib:query-tree (xlib:screen-root (first
(xlib:display-roots dpy))))
                 for hints = (xlib:wm-hints w)
                 when hints
                 do (format t "top level window id: ~s | icon pixmap
hint: ~s~%" (xlib:window-id w) (xlib:wm-hints-icon-pixmap hints)))
              (xlib:close-display dpy2)))
          (second-pass (dpy)
            ;; Open a fresh connection and create 2 windows.
            (let* ((dpy2 (xlib:open-default-display))
                   (window1 (make-win dpy2))
                   (window2 (make-win dpy2)))
              (format t "Window#1 ID: ~s Window#2 ID: ~s~%"
(xlib:window-id window1) (xlib:window-id window2))
              (xlib:display-finish-output dpy2)
              ;; On the old connection, list the root window children
              ;; and note the second window is erroneously a pixmap
              ;; due to too agressive caching in clx.
              (loop for w in (xlib:query-tree (xlib:screen-root (first
(xlib:display-roots dpy))))
                 do (format t "window: ~s~%" w))
              (xlib:close-display dpy2))))
   (let ((dpy (xlib:open-default-display)))
     (first-pass dpy)
     (second-pass dpy)
     (xlib:close-display dpy))))

Note that the last window in the window list printed at the end is a
pixmap and not a window! Here's the relevant output when i run it:


* (break-display-xid-cache)
Window ID: 14680065 pixmap ID: 14680066
top level window id: 14680065 | icon pixmap hint: #&lt;XLIB:PIXMAP :0 E00002&gt;
Window#1 ID: 14680065 Window#2 ID: 14680066
window: #&lt;XLIB:WINDOW :0 E00001&gt;
window: #&lt;XLIB:PIXMAP :0 E00002&gt;
NIL
*

I propose the following patch. Since a cache error isn't the sign of a
bug, I don't think checking the type should depend +type-check?+
constant. In the event of a lookup error, I've added two restarts for
invalidating the cache and creating fresh XID cache entries. This is
how it has been addressed in new-clx.

--- display.lisp        2005-08-26 03:13:28.000000000 -0700
+++ display.lisp        2008-07-11 17:22:39.000000000 -0700
&lt; at &gt;&lt; at &gt; -199,17 +199,21 &lt; at &gt;&lt; at &gt;
                                                     :display display :id id))
                                        (save-id display id ,type))
                                       ;; Found.  Check the type
-                                       ,(cond ((null +type-check?+)
-                                               `(t ,type))
-                                              ((member type '(window pixmap))
-                                               `((type? ,type
'drawable) ,type))
-                                              (t `((type? ,type
',type) ,type)))
-                                       ,&lt; at &gt;(when +type-check?+
-                                           `((t (x-error 'lookup-error
-                                                         :id id
-                                                         :display display
-                                                         :type ',type
-                                                         :object ,type))))))
+                                        ((type? ,type ',type) ,type)
+                                        (t
+                                         (restart-case
+                                             (x-error 'lookup-error
+                                                      :id id
+                                                      :display display
+                                                      :type ',type
+                                                      :object ,type)
+                                           (one ()
+                                             :report "Invalidate this
cache entry"
+                                             (save-id display id
(,(xintern 'make- type) :display display :id id)))
+                                           (all ()
+                                             :report "Invalidate all
display cache"
+                                             (clrhash
(display-resource-id-map display))
+                                             (save-id display id
(,(xintern 'make- type) :display display :id id)))))))
                              ;; Not being cached.  Create a new one each time.
                              `(,(xintern 'make- type)
                                :display display :id id))))



-Shawn
</description>
    <dc:creator>Nikodemus Siivola</dc:creator>
    <dc:date>2008-08-22T09:15:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1702">
    <title>Re: [bug] Asynchronous ID-CHOICE-ERROR -- CLX orMcCLIM?</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1702</link>
    <description>

Thanks, pushed.

Best,

Christophe
</description>
    <dc:creator>Christophe Rhodes</dc:creator>
    <dc:date>2008-08-22T06:02:29</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1701">
    <title>Re: [bug] Asynchronous ID-CHOICE-ERROR -- CLX orMcCLIM?</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1701</link>
    <description>I just encountered the "Asynchronous ID-CHOICE-ERROR" myself tonight,
in my case when multiple mcclim applications (in multiple threads) on
one screen race to repaint. I don't know if it's related to Nikodemus'
test case, which doesn't make any use of threads (excluding the
omnipresent CLX event dispatching thread), but at least it's the same
error.

Attached is a patch to CLX intending to address a race condition when
multiple threads attempt to allocate a resource ID -
DISPLAY-RESOURCE-ID-COUNT is incremented, but there is no locking to
protect the slot, resulting in intermittent duplicate IDs and
subsequent ID-CHOICE-ERROR. I've wrapped the allocation in a
with-display, and done the same to the nearby
deallocate-resource-id-internal for good measure. This should protect
the incf in resourcealloc, the (setf gethash) in save-id, and the
remhash in deallocate-resource-id-internal.

--- old-clx/display.lisp        2008-08-21 23:27:35.000000000 -0400
+++ new-clx/display.lisp        2008-08-21 23:27:35.000000000 -0400
&lt; at &gt;&lt; at &gt; -155,11 +155,12 &lt; at &gt;&lt; at &gt;

 (defmacro allocate-resource-id (display object type)
   ;; Allocate a resource-id for OBJECT in DISPLAY
-  (if (member (eval type) +clx-cached-types+)
-      `(let ((id (funcall (display-xid ,display) ,display)))
-        (save-id ,display id ,object)
-        id)
-    `(funcall (display-xid ,display) ,display)))
+  `(with-display (,display)
+     ,(if (member (eval type) +clx-cached-types+)
+          `(let ((id (funcall (display-xid ,display) ,display)))
+             (save-id ,display id ,object)
+             id)
+          `(funcall (display-xid ,display) ,display))))

 (defmacro deallocate-resource-id (display id type)
   ;; Deallocate a resource-id for OBJECT in DISPLAY
&lt; at &gt;&lt; at &gt; -167,7 +168,8 &lt; at &gt;&lt; at &gt;
     `(deallocate-resource-id-internal ,display ,id)))

 (defun deallocate-resource-id-internal (display id)
-  (remhash id (display-resource-id-map display)))
+  (with-display (display)
+    (remhash id (display-resource-id-map display))))

 (defun lookup-resource-id (display id)
   ;; Find the object associated with resource ID
</description>
    <dc:creator>Andy Hefner</dc:creator>
    <dc:date>2008-08-22T03:06:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1700">
    <title>Re: Crude multilingual input: CLX meets XKB's bodyparts.</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1700</link>
    <description>From: Christophe Rhodes &lt;csr21&lt; at &gt;cantab.net&gt;

Ok, I've done the conditional bit by generalising it somewhat, and
factoring in BIG-REQUESTS. The only changes are against CLX.

Perhaps "auto-init-fn" is a stupid name for that keyword parameter,
but I couldn't come up with anything better.

regards, Samium Gromoff


diff --git a/big-requests.lisp b/big-requests.lisp
--- a/big-requests.lisp
+++ b/big-requests.lisp
&lt; at &gt;&lt; at &gt; -19,7 +19,8 &lt; at &gt;&lt; at &gt;
 ;;;
 ;;; The name of this extension is "BIG-REQUESTS" (Big Requests
 ;;; Extension, section 4)
-(define-extension "BIG-REQUESTS")
+(define-extension "BIG-REQUESTS"
+    :auto-init-fn enable-big-requests)
 
 (defun enable-big-requests (display)
   (declare (type display display))
diff --git a/clx.asd b/clx.asd
--- a/clx.asd
+++ b/clx.asd
&lt; at &gt;&lt; at &gt; -70,6 +70,7 &lt; at &gt;&lt; at &gt;
       ((:file "shape")
        (:file "big-requests")
        (:file "xvidmode")
+       (:file "xkeyboard")
        (:xrender-source-file "xrender")
                (:file "glx")
                (:file "gl" :depends-on ("glx"))
diff --git a/display.lisp b/display.lisp
--- a/display.lisp
+++ b/display.lisp
&lt; at &gt;&lt; at &gt; -392,9 +392,10 &lt; at &gt;&lt; at &gt; gethostname(3) - is used instead."
   (initialize-resource-allocator disp)
   (initialize-predefined-atoms disp)
   (initialize-extensions disp)
-  (when (assoc "BIG-REQUESTS" (display-extension-alist disp)
-       :test #'string=)
-    (enable-big-requests disp))
+          (loop :for (name event-list errors auto-init-fn) :in *extensions* :do
+             (when (and (assoc (symbol-name name) (display-extension-alist disp) :test #'string=)
+                        auto-init-fn)
+               (funcall auto-init-fn disp)))
   (setq ok-p t))
       (unless ok-p (close-display disp :abort t)))
     disp))
diff --git a/input.lisp b/input.lisp
--- a/input.lisp
+++ b/input.lisp
&lt; at &gt;&lt; at &gt; -83,7 +83,7 &lt; at &gt;&lt; at &gt;
 
 (defvar *extensions* nil) ;; alist of (extension-name-symbol events errors)
 
-(defmacro define-extension (name &amp;key events errors)
+(defmacro define-extension (name &amp;key events errors auto-init-fn)
   ;; Define extension NAME with EVENTS and ERRORS.
   ;; Note: The case of NAME is important.
   ;; To define the request, Use:
&lt; at &gt;&lt; at &gt; -96,7 +96,7 &lt; at &gt;&lt; at &gt;
   (let ((name-symbol (kintern name)) ;; Intern name in the keyword package
 (event-list (mapcar #'canonicalize-event-name events)))
     `(eval-when (:compile-toplevel :load-toplevel :execute)
-       (setq *extensions* (cons (list ',name-symbol ',event-list ',errors)
+       (setq *extensions* (cons (list ',name-symbol ',event-list ',errors ',auto-init-fn)
 (delete ',name-symbol *extensions* :key #'car))))))
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
diff --git a/keysyms.lisp b/keysyms.lisp
--- a/keysyms.lisp
+++ b/keysyms.lisp
&lt; at &gt;&lt; at &gt; -157,6 +157,100 &lt; at &gt;&lt; at &gt;
 (define-keysym #\} 125)
 (define-keysym #\~ 126)
 
+;; (define-keysym #\SERBIAN_dje (keysym 6 #xa1))
+;; (define-keysym #\MACEDONIA_gje (keysym 6 #xa2))
+(define-keysym #\CYRILLIC_small_letter_io (keysym 6 #xa3))
+;; (define-keysym #\UKRAINIAN_ie (keysym 6 #xa4))
+;; (define-keysym #\MACEDONIA_dse (keysym 6 #xa5))
+;; (define-keysym #\UKRAINIAN_i (keysym 6 #xa6))
+;; (define-keysym #\UKRAINIAN_yi (keysym 6 #xa7))
+(define-keysym #\CYRILLIC_small_letter_je (keysym 6 #xa8))
+(define-keysym #\CYRILLIC_small_letter_lje (keysym 6 #xa9))
+(define-keysym #\CYRILLIC_small_letter_nje (keysym 6 #xaa))
+;; (define-keysym #\SERBIAN_tshe (keysym 6 #xab))
+;; (define-keysym #\MACEDONIA_kje (keysym 6 #xac))
+;; (define-keysym #\BYELORUSSIAN_shortu (keysym 6 #xae))
+(define-keysym #\CYRILLIC_small_letter_dzhe (keysym 6 #xaf))
+;; (define-keysym #\NUMEROSIGN (keysym 6 #xb0))
+;; (define-keysym #\SERBIAN_DJE (keysym 6 #xb1))
+;; (define-keysym #\MACEDONIA_GJE (keysym 6 #xb2))
+(define-keysym #\CYRILLIC_CAPITAL_LETTER_IO (keysym 6 #xb3))
+;; (define-keysym #\UKRAINIAN_IE (keysym 6 #xb4))
+;; (define-keysym #\MACEDONIA_DSE (keysym 6 #xb5))
+;; (define-keysym #\UKRAINIAN_I (keysym 6 #xb6))
+;; (define-keysym #\UKRAINIAN_YI (keysym 6 #xb7))
+(define-keysym #\CYRILLIC_CAPITAL_LETTER_JE (keysym 6 #xb8))
+(define-keysym #\CYRILLIC_CAPITAL_LETTER_LJE (keysym 6 #xb9))
+(define-keysym #\CYRILLIC_CAPITAL_LETTER_NJE (keysym 6 #xba))
+;; (define-keysym #\SERBIAN_TSHE (keysym 6 #xbb))
+;; (define-keysym #\MACEDONIA_KJE (keysym 6 #xbc))
+;; (define-keysym #\BYELORUSSIAN_SHORTU (keysym 6 #xbe))
+(define-keysym #\CYRILLIC_CAPITAL_LETTER_DZHE (keysym 6 #xbf))
+(define-keysym #\CYRILLIC_small_letter_yu (keysym 6 #xc0))
+(define-keysym #\CYRILLIC_small_letter_a (keysym 6 #xc1))
+(define-keysym #\CYRILLIC_small_letter_be (keysym 6 #xc2))
+(define-keysym #\CYRILLIC_small_letter_tse (keysym 6 #xc3))
+(define-keysym #\CYRILLIC_small_letter_de (keysym 6 #xc4))
+(define-keysym #\CYRILLIC_small_letter_ie (keysym 6 #xc5))
+(define-keysym #\CYRILLIC_small_letter_ef (keysym 6 #xc6))
+(define-keysym #\CYRILLIC_small_letter_ghe (keysym 6 #xc7))
+(define-keysym #\CYRILLIC_small_letter_ha (keysym 6 #xc8))
+(define-keysym #\CYRILLIC_small_letter_i (keysym 6 #xc9))
+(define-keysym #\CYRILLIC_small_letter_short_i (keysym 6 #xca))
+(define-keysym #\CYRILLIC_small_letter_ka (keysym 6 #xcb))
+(define-keysym #\CYRILLIC_small_letter_el (keysym 6 #xcc))
+(define-keysym #\CYRILLIC_small_letter_em (keysym 6 #xcd))
+(define-keysym #\CYRILLIC_small_letter_en (keysym 6 #xce))
+(define-keysym #\CYRILLIC_small_letter_o (keysym 6 #xcf))
+(define-keysym #\CYRILLIC_small_letter_pe (keysym 6 #xd0))
+(define-keysym #\CYRILLIC_small_letter_ya (keysym 6 #xd1))
+(define-keysym #\CYRILLIC_small_letter_er (keysym 6 #xd2))
+(define-keysym #\CYRILLIC_small_letter_es (keysym 6 #xd3))
+(define-keysym #\CYRILLIC_small_letter_te (keysym 6 #xd4))
+(define-keysym #\CYRILLIC_small_letter_u (keysym 6 #xd5))
+(define-keysym #\CYRILLIC_small_letter_zhe (keysym 6 #xd6))
+(define-keysym #\CYRILLIC_small_letter_ve (keysym 6 #xd7))
+(define-keysym #\CYRILLIC_small_letter_soft_sign (keysym 6 #xd8))
+(define-keysym #\CYRILLIC_small_letter_yeru (keysym 6 #xd9))
+(define-keysym #\CYRILLIC_small_letter_ze (keysym 6 #xda))
+(define-keysym #\CYRILLIC_small_letter_sha (keysym 6 #xdb))
+(define-keysym #\CYRILLIC_small_letter_e (keysym 6 #xdc))
+(define-keysym #\CYRILLIC_small_letter_shcha (keysym 6 #xdd))
+(define-keysym #\CYRILLIC_small_letter_che (keysym 6 #xde))
+(define-keysym #\CYRILLIC_small_letter_hard_sign (keysym 6 #xdf))
+(define-keysym #\CYRILLIC_capital_letter_YU (keysym 6 #xe0))
+(define-keysym #\CYRILLIC_capital_letter_A (keysym 6 #xe1))
+(define-keysym #\CYRILLIC_capital_letter_BE (keysym 6 #xe2))
+(define-keysym #\CYRILLIC_capital_letter_TSE (keysym 6 #xe3))
+(define-keysym #\CYRILLIC_capital_letter_DE (keysym 6 #xe4))
+(define-keysym #\CYRILLIC_capital_letter_IE (keysym 6 #xe5))
+(define-keysym #\CYRILLIC_capital_letter_EF (keysym 6 #xe6))
+(define-keysym #\CYRILLIC_capital_letter_GHE (keysym 6 #xe7))
+(define-keysym #\CYRILLIC_capital_letter_HA (keysym 6 #xe8))
+(define-keysym #\CYRILLIC_capital_letter_I (keysym 6 #xe9))
+(define-keysym #\CYRILLIC_capital_letter_SHORT_I (keysym 6 #xea))
+(define-keysym #\CYRILLIC_capital_letter_KA (keysym 6 #xeb))
+(define-keysym #\CYRILLIC_capital_letter_EL (keysym 6 #xec))
+(define-keysym #\CYRILLIC_capital_letter_EM (keysym 6 #xed))
+(define-keysym #\CYRILLIC_capital_letter_EN (keysym 6 #xee))
+(define-keysym #\CYRILLIC_capital_letter_O (keysym 6 #xef))
+(define-keysym #\CYRILLIC_capital_letter_PE (keysym 6 #xf0))
+(define-keysym #\CYRILLIC_capital_letter_YA (keysym 6 #xf1))
+(define-keysym #\CYRILLIC_capital_letter_ER (keysym 6 #xf2))
+(define-keysym #\CYRILLIC_capital_letter_ES (keysym 6 #xf3))
+(define-keysym #\CYRILLIC_capital_letter_TE (keysym 6 #xf4))
+(define-keysym #\CYRILLIC_capital_letter_U (keysym 6 #xf5))
+(define-keysym #\CYRILLIC_capital_letter_ZHE (keysym 6 #xf6))
+(define-keysym #\CYRILLIC_capital_letter_VE (keysym 6 #xf7))
+(define-keysym #\CYRILLIC_capital_letter_SOFT_SIGN (keysym 6 #xf8))
+(define-keysym #\CYRILLIC_capital_letter_YERU (keysym 6 #xf9))
+(define-keysym #\CYRILLIC_capital_letter_ZE (keysym 6 #xfa))
+(define-keysym #\CYRILLIC_capital_letter_SHA (keysym 6 #xfb))
+(define-keysym #\CYRILLIC_capital_letter_E (keysym 6 #xfc))
+(define-keysym #\CYRILLIC_capital_letter_SHCHA (keysym 6 #xfd))
+(define-keysym #\CYRILLIC_capital_letter_CHE (keysym 6 #xfe))
+(define-keysym #\CYRILLIC_capital_letter_HARD_SIGN (keysym 6 #xff))
+
 (progn   ;; Semi-standard characters
   (define-keysym #\rubout (keysym 255 255)); :tty
   (define-keysym #\tab (keysym 255 009)); :tty
diff --git a/translate.lisp b/translate.lisp
--- a/translate.lisp
+++ b/translate.lisp
&lt; at &gt;&lt; at &gt; -290,11 +290,11 &lt; at &gt;&lt; at &gt;
     ;; entry for keysym-index zero set to the uppercase keysym
     ;; (this is normally where the lowercase keysym goes), and the
     ;; entry for keysym-index one is zero.
-    (cond ((zerop keysym-index); Lowercase alphabetic keysyms
-   (keysym-downcase keysym))
-  ((and (zerop keysym) (plusp keysym-index)) ; Get the uppercase keysym
-   (aref mapping keycode 0))
-  (t keysym))))
+    (cond ((zerop keysym-index)         ; Lowercase alphabetic keysyms
+           (keysym-downcase keysym))
+          ((and (zerop keysym) (plusp keysym-index)) ; Get the uppercase keysym
+           (aref mapping keycode 0))
+          (t keysym))))
 
 (defun keysym-&gt;character (display keysym &amp;optional (state 0))
   ;; Find the character associated with a keysym.
diff --git a/xkeyboard.lisp b/xkeyboard.lisp
--- /dev/null
+++ b/xkeyboard.lisp
&lt; at &gt;&lt; at &gt; -0,0 +1,20 &lt; at &gt;&lt; at &gt;
+(in-package :xlib)
+
+(define-extension "XKEYBOARD"
+  :events () 
+  :errors (xf86-xkeyboard-keyboard)
+  :auto-init-fn xkb-enable)
+
+(define-condition xf86-xkeyboard-keyboard (request-error) ())
+
+(define-error xf86-xkeyboard-keyboard decode-core-error)
+
+(defconstant +xkb-enable+ 0)
+
+(defun xkb-enable (display)
+  (declare (type display display))
+  (with-buffer-request-and-reply (display (extension-opcode display "XKEYBOARD") nil :sizes (8 16))
+    ((data +xkb-enable+)
+     (card16 1)
+     (card16 0))
+    (values (boolean-get 8))))
</description>
    <dc:creator>Samium Gromoff</dc:creator>
    <dc:date>2008-08-21T15:02:38</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1699">
    <title>Re: Crude multilingual input: CLX meets XKB's bodyparts.</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1699</link>
    <description>From: Kalyanov Dmitry &lt;kalyanov.dmitry&lt; at &gt;gmail.com&gt;

Not by me -- despite the obvious part of it being trivial, I've had,
and am continuing to have, an extremely busy period in my life. It's not
that this guarantees no work being done on my part, just the uncertainty
of when it happens.

Nice to have a reminder, though, I've had it preempted out of my head..


regards, Samium Gromoff
</description>
    <dc:creator>Samium Gromoff</dc:creator>
    <dc:date>2008-08-13T05:59:18</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1698">
    <title>Re: Crude multilingual input: CLX meets XKB's bodyparts.</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1698</link>
    <description/>
    <dc:creator>Kalyanov Dmitry</dc:creator>
    <dc:date>2008-08-13T08:45:54</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1697">
    <title>Re: Re: Redisplay and pixmaps</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1697</link>
    <description/>
    <dc:creator>Sascha Wilde</dc:creator>
    <dc:date>2008-08-12T11:08:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1696">
    <title>Re: Re: Redisplay and pixmaps</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1696</link>
    <description/>
    <dc:creator>Кальянов Дмитрий</dc:creator>
    <dc:date>2008-08-11T15:48:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1695">
    <title>Re: Redisplay and pixmaps</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1695</link>
    <description>
Sorry, send the last message to early per accident, here are the missing
questions: 


1. What do I have to do, so that the display-function is called _every
   time_ a redisplay is needed?

2. Is there a better way to ensure that the picture is redisplayed
   whenever needed, maybe even that magical es done with the text?

   I know that this happens with graphics directly drawn to the pane,
   but as I want to draw rendered images, which basically consist of
   hundreds of thousands of draw-point operations this is way to
   slow...

cheers
sascha
</description>
    <dc:creator>Sascha Wilde</dc:creator>
    <dc:date>2008-08-11T09:24:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.lisp.mcclim.devel/1694">
    <title>Redisplay and pixmaps</title>
    <link>http://permalink.gmane.org/gmane.lisp.mcclim.devel/1694</link>
    <description>Hi *,

I'm new to CLIM and currently looking for a good (and simple) way to
redisplay a rendered picture (my toy program is an mandelbrot
generator).

My problem is, that the :display-function which in my case simply copies
a pixmap to the application pane is less often called than actual
redisplay is needed.

Given the following simple example code:

--8&lt;---------------cut here---------------start-------------&gt;8---
(in-package :common-lisp-user)

(defpackage "APP"
  (:use :clim :clim-lisp)
  (:export "APP-MAIN"))

(in-package :app)

(define-application-frame superapp ()
  ((gfx :initform nil :accessor gfx)
   (redisplay-counter :initform 0 :accessor redisplaynr))
  (:pointer-documentation t)
  (:panes
   (app :application :display-function #'redraw-gfx
   :height 400 :width 600)
   (int :interactor :height 400 :width 600))
  (:layouts
   (default (vertically () app int))))

(define-superapp-command (com-draw :name t) ()
  (setf (gfx *application-frame*)
  (allocate-pixmap (frame-standard-output *application-frame*)
                                           600 400))
  (draw-line* (gfx *application-frame*) 0 0 599 399 :ink +red+))

(defun redraw-gfx (frame pane)
  (if (gfx frame)
      (progn (copy-from-pixmap (gfx frame) 0 0 600 400 pane 10 10)
           (format pane "Redisplay #~a" (incf (redisplaynr frame))))
      (format pane "No pic yet...")))

(defun app-main ()
  (run-frame-top-level (make-application-frame 'superapp)))
--8&lt;---------------cut here---------------end---------------&gt;8---

Run and issue the command "Draw", ok now the pixmap is displayed.  But
when a part of the frame is obscured by another window after getting the
CLIM frame back to front the redisplay function is _not_ called.  (Can
be seen, both, by not refreshing the pixmap and not incrementing the
redisplay-counter).

BUT: The string "Redisplay #1" _is_ redrawn, so some more low level part
of CLIM knows that a redraw is needed and does that for the text send to
the standard output stream.

So two questions:
1. What do I have to do, so that the 
</description>
    <dc:creator>Sascha Wilde</dc:creator>
    <dc:date>2008-08-11T09:19:43</dc:date>
  </item>
  <textinput about="http://search.gmane.org/?group=$group=gmane.lisp.mcclim.devel">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.lisp.mcclim.devel</link>
  </textinput>
</rdf:RDF>
