all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: James Ahlborn <jahlborn@getguru.com>,
	martin rudalics <rudalics@gmx.at>,
	54863@debbugs.gnu.org
Subject: bug#54863: 28.1; hook move-frame-functions not working in emacs 28.1
Date: Tue, 06 Sep 2022 21:35:29 +0800	[thread overview]
Message-ID: <871qsobp7i.fsf@yahoo.com> (raw)
In-Reply-To: <877d2gskjd.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 06 Sep 2022 15:24:22 +0200")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> With the following patch, the hook fires when I move the frame on Macos.

Nice!  Are the values of the parameters `left' and `top' correct too
once the hook fires?  Converting between the cartesian NS screen
coordinate system and the X one is sometimes tricky, and I don't
completely understand the NS_PARENT_WINDOW_XXX_POS macros.

Thanks.

> diff --git a/src/nsterm.m b/src/nsterm.m
> index 6c6151701b..bc4e072ea0 100644
> --- a/src/nsterm.m
> +++ b/src/nsterm.m
> @@ -7912,6 +7912,7 @@ - (void)windowDidMove: sender
>    NSRect r = [win frame];
>    NSArray *screens = [NSScreen screens];
>    NSScreen *screen = [screens objectAtIndex: 0];
> +  struct input_event ie;
>  
>    NSTRACE ("[EmacsView windowDidMove:]");
>  
> @@ -7922,12 +7923,14 @@ - (void)windowDidMove: sender
>        emacsframe->left_pos = NSMinX (r) - NS_PARENT_WINDOW_LEFT_POS (emacsframe);
>        emacsframe->top_pos = NS_PARENT_WINDOW_TOP_POS (emacsframe) - NSMaxY (r);
>  
> -      // FIXME: after event part below didExitFullScreen is not received
> -      // if (emacs_event)
> -      //   {
> -      //     emacs_event->kind = MOVE_FRAME_EVENT;
> -      //     EV_TRAILER ((id)nil);
> -      //   }
> +      if (emacs_event)
> +	{
> +	 ie.kind = MOVE_FRAME_EVENT;
> +	 XSETFRAME (ie.frame_or_window, emacsframe);
> +	 XSETINT (ie.x, emacsframe->left_pos);
> +	 XSETINT (ie.y, emacsframe->top_pos);
> +	 kbd_buffer_store_event (&ie);
> +	}
>      }
>  }
>  





  reply	other threads:[~2022-09-06 13:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11 20:18 bug#54863: 28.1; hook move-frame-functions not working in emacs 28.1 James Ahlborn via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-12  7:45 ` martin rudalics
2022-04-12  8:14   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-06 11:20     ` Lars Ingebrigtsen
2022-09-06 12:13       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-06 13:24         ` Lars Ingebrigtsen
2022-09-06 13:35           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-09-06 13:40             ` Lars Ingebrigtsen
2022-09-07  1:05               ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-07 12:51                 ` Lars Ingebrigtsen
2022-04-12 21:25 ` James Ahlborn via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-13  8:45   ` martin rudalics
2022-04-13 13:07     ` James Ahlborn via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=871qsobp7i.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=54863@debbugs.gnu.org \
    --cc=jahlborn@getguru.com \
    --cc=larsi@gnus.org \
    --cc=luangruo@yahoo.com \
    --cc=rudalics@gmx.at \
    /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.