Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!sun!quintus!pds From: pds@quintus.UUCP (Peter Schachte) Newsgroups: comp.windows.x Subject: Re: managing pixmaps in the server? Message-ID: <1059@quintus.UUCP> Date: 18 May 89 17:09:43 GMT References: <8905161459.AA02423@hplcyy.HPL.HP.COM> Reply-To: pds@quintus.UUCP (Peter Schachte) Organization: Quintus Computer Systems, Inc. Lines: 23 In article <8905161459.AA02423@hplcyy.HPL.HP.COM> charles%hplcyy@HPLABS.HP.COM (Charles Young) writes: > Is there a way to assign a property to a Pixmap, such as its name, >and query the server for the pixmap given the name. You could always store the pixmap as a property of your root window. Your program could then get the appropriate property, and if it's not there, create the appropriate pixmap and store it there. > It would be really wonderful if ther server can keep track of how many >clients are using the pixmap and free the pixmap when all the clients are >gone. You could probably fake this by having an integer property to go with the pixmap property, and have each application that uses the pixmap increment it when it starts using the pixmap, and decrement it when it's through. You'll probably want to grab the server while you get the old count, increment it, and put it back, in order to avoid race conditions. This, of course, won't handle a client that increments the count and then dies without decrementing it. -- -Peter Schachte pds@quintus.uucp ...!sun!quintus!pds