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: Fri, 26 Jul 2024 22:32:20 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11331"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Jones Stephen , 71912@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 26 22:34:11 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 1sXRdh-0002mM-I7 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Jul 2024 22:34:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sXRdS-0002KU-Ga; Fri, 26 Jul 2024 16:33:54 -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 1sXRdQ-0002Jx-Uu for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2024 16:33:53 -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 1sXRdQ-0000J6-MC for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2024 16:33:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sXRdZ-0005QC-MC for bug-gnu-emacs@gnu.org; Fri, 26 Jul 2024 16:34: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: Fri, 26 Jul 2024 20:34: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.172202602020808 (code B ref 71912); Fri, 26 Jul 2024 20:34:01 +0000 Original-Received: (at 71912) by debbugs.gnu.org; 26 Jul 2024 20:33:40 +0000 Original-Received: from localhost ([127.0.0.1]:40124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXRdE-0005PY-CG for submit@debbugs.gnu.org; Fri, 26 Jul 2024 16:33:40 -0400 Original-Received: from mail-ej1-f50.google.com ([209.85.218.50]:57788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXRdB-0005PL-QT for 71912@debbugs.gnu.org; Fri, 26 Jul 2024 16:33:38 -0400 Original-Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a7a9a7af0d0so259053366b.3 for <71912@debbugs.gnu.org>; Fri, 26 Jul 2024 13:33:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722025942; x=1722630742; darn=debbugs.gnu.org; h=content-transfer-encoding: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=Q8tysr/Hvl9PMtXifsTWIGkqXGyHIaW/gkj8Ud3CZ3g=; b=XcgwhzXhQpCzvIX0yXZdEFR1i4OZjXx74D2hMtEG+AMd7n+bJY27pSudjAros4TH0r Ur27RHjypyVRj2HAlw+t8zc4gpBHD2a7tlpUY6OxRNyb07UDO7vTn5p4hbK5mRS7egco y/o/4xUwmTDNwWzNCQery1Bs2LvZ5W1keMTcWomTaNq+gCY5mbfxMm4Dv66Inm5Vs1KE OJtxFfiZAlaL4I/ypzSeIp062+oRm6Cn0Cor5jxwSSREjO3kDghfddJa6ZtnJcC/5Vlz iRjgrrOJstVd4p/BrMhx0AbuHjCNaAG0LapEv8VHZcH0ny1l9n0EEHM04CKqD1c5osss TXeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722025942; x=1722630742; h=content-transfer-encoding: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=Q8tysr/Hvl9PMtXifsTWIGkqXGyHIaW/gkj8Ud3CZ3g=; b=Ghc1gzr+PRrkb/IoIUFICEhk6HqUalr4IP+e/4IKmqjLWZzVHoLY8TO5i2C0NxBOMH Y9HZK1+y2kWAmKVxYpL3jDTVEaKKlOQOjIXj4hsoo9wcAb5laIDQsFP0zgrixrb+Xh/z xRHojTxIgzYo8nGZm4rPYACj5RVTzeXQfwB8f4inZYZCmFYuKDvPKLLTf8QEY+sc8rGO CIJzM6TDA4L9z734nq+ka14TEkBv93s9bM0B1siX5llpOTosn8rB+V71pltVzs2wZLDf lgTOd7DWnFeP/6g4ZQZr9hY/53d2iGSSCK6uIOJW1FjMUZ9Ppf7qXreBubUCQF9wDea+ xvtw== X-Forwarded-Encrypted: i=1; AJvYcCUWG1kjA1TK7DmZS99x/gspW1JCQXqEw8o8WTk2ZRqb56qK2xI73iuUxTyNBo6tdLP9SFe4xEniitwgxa75YcWUKZ7Qjro= X-Gm-Message-State: AOJu0YwBrj8rvqqMVYgdoZWVVyirWfs+EnO/xKKCTYPAYYsYH6GJceSK Dn7bCAvk2DO5FsJvVquug/qYSeo+C1zYiKJRDq6VLJRKS9mWeWYkUXWYWg== X-Google-Smtp-Source: AGHT+IHnYoRy7wIXipJB3QkGMtcPvqy7+pwIDA1Yfh5VyQkSn8EeFZcMatlKfyRraQtBC34JbP112g== X-Received: by 2002:a17:907:c48e:b0:a77:da14:8409 with SMTP id a640c23a62f3a-a7d40135360mr40325166b.48.1722025942161; Fri, 26 Jul 2024 13:32:22 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a2c4.dip0.t-ipconnect.de. [79.227.162.196]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a7acab233c0sm210822266b.44.2024.07.26.13.32.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jul 2024 13:32:21 -0700 (PDT) In-Reply-To: ("Gerd =?UTF-8?Q?M=C3=B6llmann?="'s message of "Fri, 26 Jul 2024 21:27:12 +0200") 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:289389 Archived-At: Gerd M=C3=B6llmann writes: > Alan Third writes: > >> On Thu, Jul 25, 2024 at 09:39:16AM +0200, Gerd M=C3=B6llmann wrote: >>> Gerd M=C3=B6llmann writes: >>>=20 >>> The following patch for master addresses this at least partially. Part >>> of the problem is, it appears to me, is that windowDidMove is not called >>> when entering/exiting fullscreen mode, so that a frame's left_pos and >>> top_pos are not adjusted. The patch tries to fix that. I haven't found >>> out what to do with the frame parameters top and left. >> >> If you look at toggleFullScreen it creates a new NSWindow for >> switching to fullscreen, or re-uses the old non-fullscreen NSWindow >> when switching out of fullscreen, so the windows don't move. >> >> You can actually just call windowDidMove directly. I'd suggest doing >> it at the end of toggleFullScreen. > > Thanks, I'll give that a try tomorrow. Tried it today :-). And it looks like toggleFullScreen is somehow not being used. When I press the green button to go into fullscreen, I land in windowDidEnterFullscreen, but it's called directly from AppKit. Similar for exiting fullscreen. * thread #1, queue =3D 'com.apple.main-thread', stop reason =3D breakpoint = 8.1 frame #0: 0x0000000100365e54 emacs`-[EmacsView windowDidEnterFullScreen= ](self=3D0x000000014860f930, _cmd=3D"windowDidEnterFullScreen") at nsterm.m= :8350:4 frame #1: 0x0000000100365e30 emacs`-[EmacsView windowDidEnterFullScreen= :](self=3D0x000000014860f930, _cmd=3D"windowDidEnterFullScreen:", notificat= ion=3D@"NSWindowDidEnterFullScreenNotification") at nsterm.m:8344:3 frame #2: 0x0000000191b4f144 CoreFoundation`__CFNOTIFICATIONCENTER_IS_CAL= LING_OUT_TO_AN_OBSERVER__ + 148 frame #3: 0x0000000191be33d8 CoreFoundation`___CFXRegistrationPost_block_= invoke + 88 frame #4: 0x0000000191be3320 CoreFoundation`_CFXRegistrationPost + 440 frame #5: 0x0000000191b1d678 CoreFoundation`_CFXNotificationPost + 768 frame #6: 0x0000000192c3a4e4 Foundation`-[NSNotificationCenter postNotifi= cationName:object:userInfo:] + 88 frame #7: 0x00000001961742b8 AppKit`-[NSWindow(NSFullScreen) _didEnterFul= lScreen] + 92 frame #8: 0x0000000195f568d8 AppKit`-[_NSEnterFullScreenTransitionControl= ler doAfterEnterFullScreen] + 208 frame #9: 0x0000000195f57710 AppKit`-[_NSEnterFullScreenTransitionControl= ler _performFinalTransitionCleanup] + 56 frame #10: 0x0000000195f5767c AppKit`__68-[_NSEnterFullScreenTransitionCo= ntroller _startFullScreenTransition]_block_invoke + 236 frame #11: 0x00000001918c8750 libdispatch.dylib`_dispatch_call_block_and_= release + 32 frame #12: 0x00000001918ca3e8 libdispatch.dylib`_dispatch_client_callout = + 20 frame #13: 0x00000001918d8bb8 libdispatch.dylib`_dispatch_main_queue_drai= n + 988 frame #14: 0x00000001918d87cc libdispatch.dylib`_dispatch_main_queue_call= back_4CF + 44 frame #15: 0x0000000191b9bad4 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE= _MAIN_DISPATCH_QUEUE__ + 16 frame #16: 0x0000000191b59258 CoreFoundation`__CFRunLoopRun + 1996 frame #17: 0x0000000191b58434 CoreFoundation`CFRunLoopRunSpecific + 608 frame #18: 0x000000019c2fc19c HIToolbox`RunCurrentEventLoopInMode + 292 frame #19: 0x000000019c2fbfd8 HIToolbox`ReceiveNextEventCommon + 648 frame #20: 0x000000019c2fbd30 HIToolbox`_BlockUntilNextEventMatchingListI= nModeWithFilter + 76 frame #21: 0x00000001953b7d68 AppKit`_DPSNextEvent + 660 frame #22: 0x0000000195bad808 AppKit`-[NSApplication(NSEventRouting) _nex= tEventMatchingEventMask:untilDate:inMode:dequeue:] + 700 frame #23: 0x00000001953ab09c AppKit`-[NSApplication run] + 476 frame #24: 0x000000010035b4bc emacs`-[EmacsApp run](self=3D0x0000000149= 005bf0, _cmd=3D"run") at nsterm.m:5952:7 frame #25: 0x0000000100359b38 emacs`ns_select_1(nfds=3D0, readfds=3D0x0= 00000016fdfd24c, writefds=3D0x000000016fdfd1cc, exceptfds=3D0x0000000000000= 000, timeout=3D0x000000016fdfd1a0, sigmask=3D0x0000000000000000, run_loop_o= nly=3DNO) at nsterm.m:4964:3 frame #26: 0x00000001003596f8 emacs`ns_select(nfds=3D0, readfds=3D0x000= 000016fdfd24c, writefds=3D0x000000016fdfd1cc, exceptfds=3D0x000000000000000= 0, timeout=3D0x000000016fdfd1a0, sigmask=3D0x0000000000000000) at nsterm.m:= 5016:10 frame #27: 0x00000001002cc594 emacs`wait_reading_process_output(time_li= mit=3D0, nsecs=3D0, read_kbd=3D-1, do_display=3Dtrue, wait_for_cell=3D(stru= ct Lisp_Symbol *) $0 =3D 0x0000000100a840d0, wait_proc=3D0x0000000000000000= , just_wait_proc=3D0) at process.c:5748:18