Newsgroups: comp.windows.x
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!dont-send-mail-to-path-lines
From: doug@genmri.UUCP (Doug Becker)
Subject: Re: XInternAtom
Message-ID: <9104160036.AA24738@genmri.sane.COM>
Sender: daemon@athena.mit.edu (Mr Background)
Organization: The Internet
References: <MALBERT.91Apr15111334@jeeves.shearson.com>
Date: 16 Apr 91 00:36:16 GMT
Lines: 31

    I create an
    atom on the root window (through an application), 
    delete it using xprop and confirm that it is gone (using xprop).
    When I re-run the application it thinks the property is still there.
    
    The call to XInternAtom(display, PROP_NAME, True) returns the 
    value of the previous instance of the atom instead of None.
    
I think you're confused about the difference between an atom, which is a
global server identifier, and a property, which is the value associated
with an atom on a given window.

Once an atom is created, it remains defined until the last connection to
the X server closes (see Xlib sections 4.2 [XInternAtom] and 2.6
[Connection Close Operations]).  This explains why your call to XInternAtom
succeeds.  (Note that XInternAtom doesn't take a window argument.)
XDeleteProperty deletes the property on a given window, but doesn't delete
the atom identifier that was associated with the property.

After you delete the property for the given window, intern the atom and
call XGetWindowProperty.  If XGetWindowProperty succeeds (i.e., returns
something other than None to actual_type_return, etc.) for a window upon
which the property does not exist, that's a bug, but I take it that's not
what you're seeing (you're just seeing XInternAtom returning a value other
than None, which is the correct behavior).

-- 

Doug Becker
doug@nmri.ge.com
crdgw1!sane!doug
