From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Jones Stephen <happyojones@gmail.com>
Cc: 71912@debbugs.gnu.org
Subject: bug#71912: 30.0.50; Inaccurate window-absolute-pixel-position Values on macOS After Sleep and During Fullscreen Mode
Date: Tue, 23 Jul 2024 13:06:09 +0200 [thread overview]
Message-ID: <m21q3kqsf2.fsf@pro2.fritz.box> (raw)
In-Reply-To: <CAOFab0=gs1aChbEoe=rX2b2AobWkZzki72FEYBsteSwY3rzmSA@mail.gmail.com> (Jones Stephen's message of "Wed, 3 Jul 2024 10:38:16 +0800")
Jones Stephen <happyojones@gmail.com> writes:
> Dear Emacs Developers,
>
> I am encountering an issue with window-absolute-pixel-position on macOS that leads to incorrect Y-coordinate values under specific conditions. This
> bug appears to manifest in two scenarios: after the system resumes from sleep, and when Emacs is in fullscreen mode.
>
> Environment:
>
> Emacs Version: (30.0.50)
> Operating System: macOS (After 14.00)
> Issue Description:
>
> After Sleep: When macOS resumes from sleep, the Y-coordinate value returned by window-absolute-pixel-position is off by approximately one-fourth
> of the screen height.
> During Fullscreen Mode: In fullscreen mode, the Y-coordinate is incorrectly offset by the height of the navbar.
> Steps to Reproduce:
>
> Open Emacs and position a window at a known pixel position.
> Either put the system to sleep and wake it, or switch Emacs to fullscreen mode.
> Evaluate (window-absolute-pixel-position) and note the Y-coordinate.
> Expected Behavior:
> The function should return accurate window positions regardless of sleep mode or fullscreen state, without any unexpected offsets.
>
> Actual Behavior:
> The Y-coordinate is inaccurately calculated, showing a significant offset that seems to be influenced by system sleep and fullscreen transitions.
>
> This issue can be particularly disruptive in workflows that rely on precise window positioning, such as automated GUI testing or window management
> scripts. Any insights or fixes would be greatly appreciated!
>
> Thank you for your attention to this matter.
>
> Best regards,
> happyo
I can reproduce this (only tried the fullscreen case), but I don't know
how to fix it. In a fullscreen frame, eval
(ns-frame-edges (selected-frame) 'native-edges)
-> (566 39 2290 1107)
That is, both left and top are bogus values. Also,
(frame-parameter (selected-frame) 'fullscreen)
-> fullboth
(frame-parameter (selected-frame) 'top)
-> 39
(frame-parameter (selected-frame) 'left)
-> 566
which is why ns-frame-edges in its current implementation returns these
values for left and top. Don't know what is expected here. Should top
and left frame parameters have been set to 0 somewhere? Or is the
implementation of ns-frame-edges wrong in using top_pos and left_pos of
the frame?
next prev parent reply other threads:[~2024-07-23 11:06 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 [this message]
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
[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=m21q3kqsf2.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).