all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu <luangruo@yahoo.com>
To: emacs-devel@gnu.org
Subject: Re: master 2021835326 2/3: Implement `return-frame' for DND on NS
Date: Tue, 31 May 2022 21:07:23 +0800	[thread overview]
Message-ID: <87y1yh97g4.fsf@yahoo.com> (raw)
In-Reply-To: <20220531100643.37E30C0C1B3@vcs2.savannah.gnu.org> (Po Lu via Mailing list for Emacs changes's message of "Tue, 31 May 2022 06:06:43 -0400 (EDT)")

Po Lu via Mailing list for Emacs changes <emacs-diffs@gnu.org> writes:

> +#ifdef NS_IMPL_COCOA
> +- (void) draggedImage: (NSImage *) dragged_image
> +	      movedTo: (NSPoint) screen_point
> +{
> +  NSInteger window_number;
> +  NSWindow *w;
> +
> +  if (dnd_mode == RETURN_FRAME_NEVER)
> +    return;
> +
> +  window_number = [NSWindow windowNumberAtPoint: [NSEvent mouseLocation]
> +		    belowWindowWithWindowNumber: 0];
> +  w = [NSApp windowWithWindowNumber: window_number];
> +
> +  if (!w || w != self)
> +    dnd_mode = RETURN_FRAME_NOW;
> +
> +  if (dnd_mode != RETURN_FRAME_NOW
> +      || ![[w delegate] isKindOfClass: [EmacsView class]])
> +    return;
> +
> +  dnd_return_frame = ((EmacsView *) [w delegate])->emacsframe;
> +
> +  /* 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?



       reply	other threads:[~2022-05-31 13:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <165399160266.27129.5728276928017774382@vcs2.savannah.gnu.org>
     [not found] ` <20220531100643.37E30C0C1B3@vcs2.savannah.gnu.org>
2022-05-31 13:07   ` Po Lu [this message]
2023-01-26 11:29     ` master 2021835326 2/3: Implement `return-frame' for DND on NS YAMAMOTO Mitsuharu
2023-01-26 11:43       ` Po Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y1yh97g4.fsf@yahoo.com \
    --to=luangruo@yahoo.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.