From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11957 invoked by alias); 10 Nov 2002 20:57:57 -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 11950 invoked from network); 10 Nov 2002 20:57:55 -0000 Received: from unknown (HELO zagadka.ping.de) (195.138.43.168) by sources.redhat.com with SMTP; 10 Nov 2002 20:57:55 -0000 Received: (qmail 2974 invoked by uid 1000); 10 Nov 2002 20:58:18 -0000 To: Daniel Skarda <0rfelyus@ucw.cz> Cc: guile-gtk Subject: Re: implementing guile-gtk drag & drop... References: <3DC279A4.1010000@wanadoo.be> <87d6pmd7a3.fsf@zagadka.ping.de> <87u1iqh8rl.fsf@zagadka.ping.de> From: Marius Vollmer Date: Sun, 10 Nov 2002 12:57:00 -0000 In-Reply-To: Message-ID: <87k7jlf8gl.fsf@zagadka.ping.de> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-q4/txt/msg00010.txt.bz2 Daniel Skarda <0rfelyus@ucw.cz> writes: > > Using gtk_selection_data_copy/free seems to be the right thing to do. > > Can you figure out why they made drag and drop fail? Maybe there are > > bugs in those functions that we can work around. > > Unfortunately Gtk creates GtkSelectionData, invokes a handler and > expects that you gtk_selection_data_set on data that Gtk passed to > handler, not to its copy :-( See gtkselection.c. Aha. So gtk_selection_data_copy is useless and GtkSelectionData should really be using reference counting, right? In that case, we need a new kind of life-time management option in guile-gtk: the Scheme value that represents a GtkSelectionData needs to be invalidated when the real GtkSelectionData is freed. We don't have such a mechanism currently, but it should not be that difficult to add it. Basically, sgtk_callback_marshal would need to 'destroy' the arguments of the callback when it has returned. Any takers? -- GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405