From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30002 invoked by alias); 23 May 2003 22:57:08 -0000 Mailing-List: contact guile-gtk-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: guile-gtk-owner@sources.redhat.com Received: (qmail 29945 invoked from network); 23 May 2003 22:57:07 -0000 Received: from unknown (HELO lumo.pacujo.net) (209.77.185.85) by sources.redhat.com with SMTP; 23 May 2003 22:57:07 -0000 Received: (from marko@localhost) by lumo.pacujo.net (8.11.6/8.11.6/SuSE Linux 0.5) id h4NMmK231190; Fri, 23 May 2003 15:48:20 -0700 To: guile-gtk@sources.redhat.com Subject: Re: Selection and DND completed References: <87d6i9miga.fsf@zip.com.au> From: Marko Rauhamaa Date: Fri, 23 May 2003 22:57:00 -0000 In-Reply-To: <87d6i9miga.fsf@zip.com.au> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-q2/txt/msg00095.txt.bz2 Kevin Ryde : > Marko Rauhamaa writes: > > return length ? scm_take_str (data, length) : SCM_BOOL_F; > > Not sure if length==0 would be valid data, though I don't see a reason > it wouldn't be. It might be nice to return an empty string for that. I misread the code (and the documentation) as though 0 was the error return value, but as you say: > data==NULL is supposedly the error indication, perhaps that could give > the #f. I have fixed it: return data ? scm_take_str (data, length) : SCM_BOOL_F; (but not yet submitted since I'm in the middle of other changes). > However the 1.2 code looks like it doesn't store anything to data if > the window has been destroyed, so it might be prudent to initialize to > NULL. That's where I probably got the idea that 0 is the error return value -- it definitely is a bug in gdk-1.2. I now initialize data with NULL and comment the kludge. > It also looks like prop_type and prop_format are not set if the window > has been destroyed, maybe they should get initial values to avoid > problems too. GDK_NONE and 0 might be enough. Prop_format is an integral value -- a random value is not an issue. Prop_type is sent to sgtk_atom2scm(), which returns SCM_BOOL_F if the atom is garbage. So I don't think those values need to be accounted for. (If I wanted to do it, I wouldn't rely on initializing their values, but I would rather set them to known values after returning from gdk_selection_property_get(). Marko -- Marko Rauhamaa mailto:marko@pacujo.net http://pacujo.net/marko/