From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Cecilio Pardo Newsgroups: gmane.emacs.bugs Subject: bug#3468: drag and drop text Date: Sat, 5 Oct 2024 14:07:01 +0200 Message-ID: References: <20090604070321.177690@gmx.net> <8ba4e567-550e-4ac2-96f4-c6f7bacd78d0@imayhem.com> <86wmiv3p0r.fsf@gnu.org> <9bef55ae-e0aa-40d0-af77-7e7eac309b3a@imayhem.com> <86msjq4rp5.fsf@gnu.org> <55f3d9b3-4a46-4ca1-9f84-c3bf99d1c403@imayhem.com> <86ed4ux0xj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19563"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 3468@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 05 14:08:30 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sx3aH-0004wF-Tj for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Oct 2024 14:08:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sx3Zp-00036w-SJ; Sat, 05 Oct 2024 08:08:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sx3Zn-00036l-2C for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2024 08:07:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sx3Zm-0006d0-Pd for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2024 08:07:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=54ctTUOR9Gon4DPE9S0Yl9aCDzrjeQOMbo3i7joEhww=; b=iQTV4wZcFiyB+bb7p0j1WEqtw10MEzxhZTNxD/iXFJWHUdFUrp6VH64qRTUZp6baD8EemB2RCEshlJE1HHC8WeBu22zprUKvrjYpVrRUxdziqdYRCoRmiVoG1iGAZ8AJ8l7wGxLQLo5V41bgBUYPId7W57gXNrDz23/7rwmtXnCqivC3oueA/RlI5WDMdBZrKJUtenofsLtvAUykRi/HeiSzmoOR95OeN40VKo6LXtp3autlhrEL9jOAJ1r76Q4v6XDmjInY37py+imhw6/N7/VMLT+HAGOcxb76ossG1TgOiJZYjUJWznCPCHo4bcZJYG66l2yVl84+y1ygsPI+4g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sx3Zq-00038a-6Y for bug-gnu-emacs@gnu.org; Sat, 05 Oct 2024 08:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Cecilio Pardo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Oct 2024 12:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 3468 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: help Original-Received: via spool by 3468-submit@debbugs.gnu.org id=B3468.172813003511997 (code B ref 3468); Sat, 05 Oct 2024 12:08:02 +0000 Original-Received: (at 3468) by debbugs.gnu.org; 5 Oct 2024 12:07:15 +0000 Original-Received: from localhost ([127.0.0.1]:37410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx3Z4-00037Q-OP for submit@debbugs.gnu.org; Sat, 05 Oct 2024 08:07:14 -0400 Original-Received: from mail.imayhem.com ([82.223.54.191]:54617 helo=zealous-pike.82-223-54-191.plesk.page) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx3Z2-00037A-J1 for 3468@debbugs.gnu.org; Sat, 05 Oct 2024 08:07:13 -0400 Original-Received: from [192.168.68.104] (111.red-88-21-7.staticip.rima-tde.net [88.21.7.111]) by zealous-pike.82-223-54-191.plesk.page (Postfix) with ESMTPSA id C485580182; Sat, 5 Oct 2024 12:07:01 +0000 (UTC) Authentication-Results: zealous-pike.82-223-54-191.plesk.page; spf=pass (sender IP is 88.21.7.111) smtp.mailfrom=cpardo@imayhem.com smtp.helo=[192.168.68.104] Received-SPF: pass (zealous-pike.82-223-54-191.plesk.page: connection is authenticated) Content-Language: es-ES In-Reply-To: <86ed4ux0xj.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:293025 Archived-At: On 05/10/2024 13:07, Eli Zaretskii wrote: >> There is no malloc/strdup. > > Well, there are still 2 calls to malloc in w32_createwindow. Any > reasons not to call xmalloc instead? Can w32_createwindow be called > before we call init_heap? [...] > Do we ever have to free the two memory chunks we allocate here? Like > when the window is disposed of? They are freed in w32_drop_target_Release, which is called internally when we call RevokeDragDrop while handling the WW_EMACS_DESTROYWINDOW on w32_wnd_proc. As this runs on the input thread, I used malloc/free instead of xmalloc/xfree. I could send a message to handle on w32_read_socket and then use xmalloc. > This function should call block_input at entry and unblock_input > before it exits, because we must make sure all the GlobalLock calls > are paired with GlobalUnlock and GlobalFree, while functions we call > here, process_dropfiles etc., all cons Lisp object, and therefore > could potentially QUIT, which throws to top-level. The function (w32_process_dnd_data) is called from within the block_input/unblock_input on w32_read_socket. Should I add its own calls for clarity? Maybe just a comment? Thanks.