unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Jones Stephen <happyojones@gmail.com>
Cc: 71912@debbugs.gnu.org
Subject: bug#71912: [Gerd Möllmann] Re: bug#71912: 30.0.50; Inaccurate window-absolute-pixel-position Values on macOS After Sleep and During Fullscreen Mode
Date: Sun, 11 Aug 2024 13:25:04 +0200	[thread overview]
Message-ID: <m2cymfpai7.fsf@pro2.fritz.box> (raw)
In-Reply-To: <CAOFab0n2H3iwyAmVGV1nYrQVqcjRM=ovvJ5hTt4x_0r6rC_k3g@mail.gmail.com> (Jones Stephen's message of "Sun, 11 Aug 2024 18:39:53 +0800")

[-- Attachment #1: Type: text/plain, Size: 945 bytes --]

Jones Stephen <happyojones@gmail.com> writes:

> Thank you for the patch. I’ve tested it, and it does help, but I
> noticed there’s still a slight issue.
>
> Here’s what I found: if I leave my Mac idle for a while and it enters
> sleep mode, when I wake up the Mac and click to focus on Emacs, the
> frame position sometimes appears to be incorrect. However, if I put
> the Mac to sleep again and then immediately wake it up, the frame
> position is correct when I return to Emacs.
>
> Interestingly, when I moved the `adjustEmacsFrameRect` call to the
> `windowDidBecomeKey` method, the issue was completely resolved. After
> making this adjustment, the frame position remains correct regardless
> of the sleep duration or how the system is woken up.
>

(Please keep the list in CC, I've added it for this reply.)

Thanks. So an a complete patch would look like the attached patch,
right? Could you please confirm?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-macOS-Wrong-frame-rectangle-after-wake-bug-71912.patch --]
[-- Type: text/x-patch, Size: 771 bytes --]

From 44fabe5f1267fc0498e76173987ab4801c732d48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gerd=20M=C3=B6llmann?= <gerd@gnu.org>
Date: Sun, 11 Aug 2024 13:22:45 +0200
Subject: [PATCH] macOS: Wrong frame rectangle after wake (bug#71912)

* src/nsterm.m ([EmacsView windowDidBecomeKey]):
Call adjustEmacsFrameRect.
---
 src/nsterm.m | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/nsterm.m b/src/nsterm.m
index 905707dace4..97b829d0e4c 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7968,6 +7968,7 @@ - (void)windowDidBecomeKey      /* for direct calls */
     dpyinfo->ns_focus_frame = emacsframe;
 
   ns_frame_rehighlight (emacsframe);
+  [self adjustEmacsFrameRect];
 
   event.kind = FOCUS_IN_EVENT;
   XSETFRAME (event.frame_or_window, emacsframe);
-- 
2.46.0


  parent reply	other threads:[~2024-08-11 11:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-03  2:38 bug#71912: 30.0.50; Inaccurate window-absolute-pixel-position Values on macOS After Sleep and During Fullscreen Mode Jones Stephen
2024-07-23 11:06 ` Gerd Möllmann
2024-07-25  7:39   ` Gerd Möllmann
2024-07-26 19:24     ` Alan Third
2024-07-26 19:27       ` Gerd Möllmann
2024-07-26 20:32         ` Gerd Möllmann
2024-07-30  4:06     ` Gerd Möllmann
2024-08-11  6:49 ` bug#71912: [Gerd Möllmann] " Gerd Möllmann
     [not found]   ` <CAOFab0n2H3iwyAmVGV1nYrQVqcjRM=ovvJ5hTt4x_0r6rC_k3g@mail.gmail.com>
2024-08-11 11:25     ` Gerd Möllmann [this message]
     [not found]       ` <CAOFab0mKnZbku1bq3Y0uyZAr6hb1Pkc7gmV7xuxt1pMJq_AFXw@mail.gmail.com>
2024-08-12  3:16         ` Gerd Möllmann

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=m2cymfpai7.fsf@pro2.fritz.box \
    --to=gerd.moellmann@gmail.com \
    --cc=71912@debbugs.gnu.org \
    --cc=happyojones@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).