Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!ucbvax!ZERMATT.LCS.MIT.EDU!RWS From: RWS@ZERMATT.LCS.MIT.EDU (Robert Scheifler) Newsgroups: comp.windows.x Subject: Why can't I inquire about borders? Message-ID: <871030091519.3.RWS@KILLINGTON.LCS.MIT.EDU> Date: Fri, 30-Oct-87 09:15:00 EST Article-I.D.: KILLINGT.871030091519.3.RWS Posted: Fri Oct 30 09:15:00 1987 Date-Received: Wed, 4-Nov-87 21:29:44 EST References: <2771538053-221473@Sierra> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 23 One of those perennial questions, I suppose. Consider the following: (let ((pixmap (xlib:create-pixmap :drawable w :width 10 :height 10 :depth (xlib:drawable-depth w)))) (setf (xlib:window-border some-window) pixmap) (xlib:free-pixmap pixmap)) For those who can't read it, suppose you create a pixmap, store it as a border pixmap, and then free the pixmap. [Doesn't it irk you when people speak in foreign tongues?] This is legal according to the protocol (and, if you have no further need to reference the pixmap, is a fine idea, since the server may be cleverer than you at finding alternate implementations of what you ask for). When you free certain resources, like pixmaps and cursors, what is freed is the association between the resource id and the object; the object itself is not freed until all internal references within the server are gone (reference counting is typically employed in the absence of automatic garbage collection). So, when you free the pixmap, the border of the window remains unchanged, but there is no longer an external name to be handed out to clients that might ask for it. Since resource-id allocation is controlled by clients, there is no particularly good way for the server to create one on the fly.