From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs 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 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38296"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 71912@debbugs.gnu.org To: Jones Stephen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 23 13:08:12 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sWDNL-0009pC-3H for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Jul 2024 13:08:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWDNE-0008U0-3P; Tue, 23 Jul 2024 07:08:04 -0400 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 1sWDN7-00087c-SD for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2024 07:08:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWDN7-0004hr-Iu for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2024 07:07:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sWDNB-0000UQ-Rz for bug-gnu-emacs@gnu.org; Tue, 23 Jul 2024 07:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Jul 2024 11:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71912 X-GNU-PR-Package: emacs Original-Received: via spool by 71912-submit@debbugs.gnu.org id=B71912.17217328441829 (code B ref 71912); Tue, 23 Jul 2024 11:08:01 +0000 Original-Received: (at 71912) by debbugs.gnu.org; 23 Jul 2024 11:07:24 +0000 Original-Received: from localhost ([127.0.0.1]:59299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWDMZ-0000TQ-GB for submit@debbugs.gnu.org; Tue, 23 Jul 2024 07:07:23 -0400 Original-Received: from mail-ej1-f47.google.com ([209.85.218.47]:57785) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWDMX-0000TE-P9 for 71912@debbugs.gnu.org; Tue, 23 Jul 2024 07:07:22 -0400 Original-Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a7a9a7af0d0so55298066b.3 for <71912@debbugs.gnu.org>; Tue, 23 Jul 2024 04:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721732771; x=1722337571; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=3CnzYSvn1Q22S0LEPPXeU8g2x2s4MrLp7P4Gk9WT1mM=; b=KGxV7UyZcB93+YlXiKgBgwyeIfSYzTL8DPZ5dUg9JaYUYHOrdGsSr9B2LTDCr9WJel GXQd1ObC9AdnenqUur7b3jFn6+tShxv5bNJNtkPtO6sEMqT8QdrV3wqUSbWwlaNwx3cX MnMa+Lmhl7PGqSXNt1eBbPAoct9HmeS1e5M1fHlhtVkHRFgGAWFXXC6fGgTcsLJL47KQ TU+fOfIH8rTDQqzI64A9DSbFKiazkBvrIqN9kkEwCZ+L553cWvDbpaE4EryvLYYmNGri rA6x356ldpT5Rl5wIPGb/cNcVVs35xaKzbpcSET2ZeJVqn12ebAYyYb5Aeqd02Ps1wNT rFHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721732771; x=1722337571; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3CnzYSvn1Q22S0LEPPXeU8g2x2s4MrLp7P4Gk9WT1mM=; b=qG7M28OnAkag3jHGxfwbhMInGIYpoRyCu6EkG5YRSrFFvzVIXSxNhjYj/v4QqrVhWG MNC38Fnjezes5KFkTwEJ06InU+pbdr69ZjMLCYkmbQNSYeli13ktKWbhSgh65nlhbl+K C4Mx1gS/G/D6ZjjxQvWPtgTcjs+F2ID00avjALbIBHOyZCZsCnNw5rrBmTZA/YUv9r2C wLXXY7yLqFJ7O+j1YUKXSsOWzy5rbqivCn+2F2KHarqNh1ZbS5+CDDQVk0Mg0jHH1pjT 6rlux+yPyf03/7DdbXoIkxd2yKyIrWy6CEgvO98+C6c8c4+KAqS7/iIpeJqY/zeTseOg 3IoQ== X-Gm-Message-State: AOJu0YxZiGeLrzo5M0FeB3HJthaApHcCJFWrZHtCtUkIeh8EwRor0MeC ZVQk97xLkCw0EmWk+4E882Y6Q+QS0Y74AMGddWh80nEVQdDbzenqBxYCSw== X-Google-Smtp-Source: AGHT+IHf0Mu6OW3+bLrL/MaUHmXeG508Vb/X0arwnb5UcdUxzX4BTf/L9EGJk8sHTtDZyMW0KkGUMg== X-Received: by 2002:a17:906:7952:b0:a77:e7cb:2979 with SMTP id a640c23a62f3a-a7a4c2a6123mr757673366b.51.1721732771017; Tue, 23 Jul 2024 04:06:11 -0700 (PDT) Original-Received: from pro2.fritz.box (pd9e3603f.dip0.t-ipconnect.de. [217.227.96.63]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7a3c94edb4sm524836266b.196.2024.07.23.04.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jul 2024 04:06:10 -0700 (PDT) In-Reply-To: (Jones Stephen's message of "Wed, 3 Jul 2024 10:38:16 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:289153 Archived-At: Jones Stephen 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?