From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: master 2021835326 2/3: Implement `return-frame' for DND on NS Date: Thu, 26 Jan 2023 20:29:39 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <165399160266.27129.5728276928017774382@vcs2.savannah.gnu.org> <20220531100643.37E30C0C1B3@vcs2.savannah.gnu.org> <87y1yh97g4.fsf@yahoo.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31958"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 26 12:31:22 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pL0TS-00084m-03 for ged-emacs-devel@m.gmane-mx.org; Thu, 26 Jan 2023 12:31:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pL0S7-00053O-O6; Thu, 26 Jan 2023 06:30:01 -0500 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 1pL0Rx-0004t7-FJ for emacs-devel@gnu.org; Thu, 26 Jan 2023 06:29:50 -0500 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pL0Ru-00065I-PO for emacs-devel@gnu.org; Thu, 26 Jan 2023 06:29:49 -0500 Original-Received: from mathent.math.s.chiba-u.ac.jp (mathent [192.168.32.5]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id B2BCFF08E3; Thu, 26 Jan 2023 20:29:39 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) In-Reply-To: <87y1yh97g4.fsf@yahoo.com> Received-SPF: pass client-ip=133.82.132.2; envelope-from=mituharu@math.s.chiba-u.ac.jp; helo=mathmail.math.s.chiba-u.ac.jp X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302666 Archived-At: On Tue, 31 May 2022 22:07:23 +0900, Po Lu wrote: > > > + /* FIXME: there must be a better way to leave the event loop. */ > > + [NSException raise: @"" > > + format: @"Must return DND frame"]; > > +} > > +#endif > > This works (and there's nothing in the documentation forbidding it), but > prints an ugly warning message to stdout every time the exception is > raised. Does anyone know of a better way to stop an NS drag-and-drop > operation inside one of the drag source callbacks? Posting ESC KeyDown event seems to work, as long as I tested with Emacs 29-based Mac port (in development). BTW, I think safe_call/redisplay in -[EmacsView draggingUpdated:] is unsafe in some situations. This method is called from the main thread in the context of `select' emulation if the dragging is originated from another application. Because `thread_select' may cause thread switching if we have multiple Lisp threads, Lisp evaluation in another thread might be in progress while the main thread is waiting for the completion of the `select' emulation. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp