From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#48406: 28.0.50; Emacs stuck in infinite loop in wait_reading_process_output when opening in fullscreen (NS) Date: Sat, 5 Jun 2021 17:33:49 +0100 Message-ID: References: <558D9EDE-D791-49DD-AAB1-56071D6FD56F@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="XsdA0sMDmYlUqmG3" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39964"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48406@debbugs.gnu.org, Andrii Kolomoiets To: Illia Ostapyshyn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 05 18:34:10 2021 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 1lpZFS-000A69-Fj for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Jun 2021 18:34:10 +0200 Original-Received: from localhost ([::1]:39838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpZFR-000605-Eq for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Jun 2021 12:34:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpZFK-0005wX-4r for bug-gnu-emacs@gnu.org; Sat, 05 Jun 2021 12:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38441) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpZFJ-0007jo-Ub for bug-gnu-emacs@gnu.org; Sat, 05 Jun 2021 12:34:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lpZFJ-0000H2-PZ for bug-gnu-emacs@gnu.org; Sat, 05 Jun 2021 12:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Jun 2021 16:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48406 X-GNU-PR-Package: emacs Original-Received: via spool by 48406-submit@debbugs.gnu.org id=B48406.16229108401045 (code B ref 48406); Sat, 05 Jun 2021 16:34:01 +0000 Original-Received: (at 48406) by debbugs.gnu.org; 5 Jun 2021 16:34:00 +0000 Original-Received: from localhost ([127.0.0.1]:49987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpZFI-0000Gm-DK for submit@debbugs.gnu.org; Sat, 05 Jun 2021 12:34:00 -0400 Original-Received: from [217.169.17.33] (port=50073 helo=breton.holly.idiocy.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpZFE-0000GV-D5 for 48406@debbugs.gnu.org; Sat, 05 Jun 2021 12:33:58 -0400 Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id E4BEE202C61116; Sat, 5 Jun 2021 17:33:49 +0100 (BST) Mail-Followup-To: Alan Third , Illia Ostapyshyn , Andrii Kolomoiets , 48406@debbugs.gnu.org Content-Disposition: inline In-Reply-To: <558D9EDE-D791-49DD-AAB1-56071D6FD56F@gmail.com> 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" Xref: news.gmane.io gmane.emacs.bugs:208067 Archived-At: --XsdA0sMDmYlUqmG3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jun 05, 2021 at 06:21:59PM +0200, Illia Ostapyshyn wrote: > > By the way, there seems to be a compilation issue as not all references to > in_fullscreen_transition were removed (see attachment). Oops, my mistake. Please use the attached patch instead. -- Alan Third --XsdA0sMDmYlUqmG3 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="v2-0001-Remove-pause-on-fullscreening-in-NS-bug-48406.patch" >From 1425b3c3ecc440e62506e800b270b9896c86e537 Mon Sep 17 00:00:00 2001 From: Alan Third Date: Sat, 5 Jun 2021 14:38:17 +0100 Subject: [PATCH v2] Remove pause on fullscreening in NS (bug#48406) * src/nsterm.m (ns_make_frame_visible): (ns_set_parent_frame): ([EmacsView windowWillEnterFullScreen:]): ([EmacsView windowDidEnterFullScreen:]): ([EmacsView windowWillExitFullScreen:]): ([EmacsView initFrameFromEmacs:]): Remove references to in_fullscreen_transition. ([EmacsView toggleFullScreen:]): Remove calls to removed methods. ([EmacsView inFullScreenTransition]): ([EmacsView waitFullScreenTransition]): Remove Methods. * src/nsterm.h (EmacsView): Remove defintions of removed methods, and the in_fullscreen_transition variable. --- src/nsterm.h | 3 --- src/nsterm.m | 37 ++----------------------------------- 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/src/nsterm.h b/src/nsterm.h index 0596f3f3c1..e7ea907569 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -443,7 +443,6 @@ #define NS_DRAW_TO_BUFFER 1 int maximized_width, maximized_height; NSWindow *nonfs_window; BOOL fs_is_native; - BOOL in_fullscreen_transition; #ifdef NS_DRAW_TO_BUFFER EmacsSurface *surface; #endif @@ -475,8 +474,6 @@ #define NS_DRAW_TO_BUFFER 1 - (void) toggleFullScreen: (id) sender; - (BOOL) fsIsNative; - (BOOL) isFullscreen; -- (BOOL) inFullScreenTransition; -- (void) waitFullScreenTransition; #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - (void) updateCollectionBehavior; #endif diff --git a/src/nsterm.m b/src/nsterm.m index f6168243a4..838c14d5ab 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1640,8 +1640,6 @@ -(void)remove fullscreen also. So skip handleFS as this will print an error. */ if ([view fsIsNative] && [view isFullscreen]) { - // maybe it is not necessary to wait - [view waitFullScreenTransition]; return; } @@ -2057,11 +2055,7 @@ so some key presses (TAB) are swallowed by the system. */ #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 // child frame must not be in fullscreen if ([view fsIsNative] && [view isFullscreen]) - { - // in case child is going fullscreen - [view waitFullScreenTransition]; - [view toggleFullScreen:child]; - } + [view toggleFullScreen:child]; NSTRACE ("child setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary"); [child setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary]; #endif @@ -7489,7 +7483,6 @@ - (instancetype) initFrameFromEmacs: (struct frame *)f #endif fs_is_native = ns_use_native_fullscreen; #endif - in_fullscreen_transition = NO; maximized_width = maximized_height = -1; nonfs_window = nil; @@ -7862,7 +7855,6 @@ - (NSApplicationPresentationOptions)window:(NSWindow *)window - (void)windowWillEnterFullScreen:(NSNotification *)notification { NSTRACE ("[EmacsView windowWillEnterFullScreen:]"); - in_fullscreen_transition = YES; [self windowWillEnterFullScreen]; } - (void)windowWillEnterFullScreen /* provided for direct calls */ @@ -7875,7 +7867,6 @@ - (void)windowDidEnterFullScreen:(NSNotification *)notification { NSTRACE ("[EmacsView windowDidEnterFullScreen:]"); [self windowDidEnterFullScreen]; - in_fullscreen_transition = NO; } - (void)windowDidEnterFullScreen /* provided for direct calls */ @@ -7914,7 +7905,6 @@ - (void)windowDidEnterFullScreen /* provided for direct calls */ - (void)windowWillExitFullScreen:(NSNotification *)notification { NSTRACE ("[EmacsView windowWillExitFullScreen:]"); - in_fullscreen_transition = YES; [self windowWillExitFullScreen]; } @@ -7934,7 +7924,6 @@ - (void)windowDidExitFullScreen:(NSNotification *)notification { NSTRACE ("[EmacsView windowDidExitFullScreen:]"); [self windowDidExitFullScreen]; - in_fullscreen_transition = NO; } - (void)windowDidExitFullScreen /* provided for direct calls */ @@ -7963,22 +7952,6 @@ - (void)windowDidExitFullScreen /* provided for direct calls */ [[self window] performZoom:self]; } -- (BOOL)inFullScreenTransition -{ - return in_fullscreen_transition; -} - -- (void)waitFullScreenTransition -{ -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - while ([self inFullScreenTransition]) - { - NSTRACE ("wait for fullscreen"); - wait_reading_process_output (0, 300000000, 0, 1, Qnil, NULL, 0); - } -#endif -} - - (BOOL)fsIsNative { return fs_is_native; @@ -8058,14 +8031,8 @@ - (void)toggleFullScreen: (id)sender #if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 if ([[self window] respondsToSelector: @selector(toggleFullScreen:)]) - { -#endif - [[self window] toggleFullScreen:sender]; - // wait for fullscreen animation complete (bug#28496) - [self waitFullScreenTransition]; -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 - } #endif + [[self window] toggleFullScreen:sender]; #endif return; } -- 2.29.2 --XsdA0sMDmYlUqmG3--