From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#25542: 25.1; Restoring the frame from fullscreen to maximized Date: Fri, 11 Sep 2020 16:16:09 -0400 Message-ID: <5d802046-c401-3a50-78b7-f5db80095114@cornell.edu> References: <588B108E.9070501@gmx.at> <588B1437.9010303@gmx.at> <588B4F7C.40909@gmx.at> <588C5003.4070409@gmx.at> <87r1rhbu2s.fsf@gnus.org> <83wo18pvoh.fsf@gnu.org> <17a425a3-7b6e-56bc-40a3-35ac78fdaa6a@gmx.at> <56ee5ed9-fd85-b5c3-6aba-d51332398f03@cornell.edu> <818f2053-a996-7ade-c1cf-6592b6d2cde5@gmx.at> <4869c79f-2f3b-cafb-0459-c6f39f9a6bd5@cornell.edu> <3cea3f08-d87c-03a0-4b0b-b54f3ea63149@cornell.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------7F46198AFFC10A2A9D711EF0" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26976"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 Cc: Lars Magne Ingebrigtsen , 25542@debbugs.gnu.org, Noam Postavsky To: martin rudalics , Dani Moncayo , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 11 22:17:12 2020 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 1kGpTr-0006tb-Gd for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Sep 2020 22:17:11 +0200 Original-Received: from localhost ([::1]:45254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGpTq-0006JD-Io for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 11 Sep 2020 16:17:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGpTi-0006IA-Mg for bug-gnu-emacs@gnu.org; Fri, 11 Sep 2020 16:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34122) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGpTi-0006XJ-Dj for bug-gnu-emacs@gnu.org; Fri, 11 Sep 2020 16:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kGpTi-00006v-8l for bug-gnu-emacs@gnu.org; Fri, 11 Sep 2020 16:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Sep 2020 20:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25542 X-GNU-PR-Package: emacs Original-Received: via spool by 25542-submit@debbugs.gnu.org id=B25542.1599855381375 (code B ref 25542); Fri, 11 Sep 2020 20:17:02 +0000 Original-Received: (at 25542) by debbugs.gnu.org; 11 Sep 2020 20:16:21 +0000 Original-Received: from localhost ([127.0.0.1]:45668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kGpT3-00005z-GG for submit@debbugs.gnu.org; Fri, 11 Sep 2020 16:16:21 -0400 Original-Received: from mail-eopbgr680111.outbound.protection.outlook.com ([40.107.68.111]:63542 helo=NAM04-BN3-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kGpT1-00005k-6N for 25542@debbugs.gnu.org; Fri, 11 Sep 2020 16:16:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wjo7WO0QstTzMLsJBMnlv/Y/kINxY7mz6cZbn3zDAcuywAGQ77kDYhDmxGm/pzLJFvzBWfupZnOKVKjp3FfHCPY0XFMPiYfCSTSfcev6s+QT03VqzUnpCo5ZE9QEzHswNGT0K2XeI9yruQAqep08MCCVMTzNv/94+SYM74EbBQvEy6Y8AJqsOXcM4vIf6gR8FrKJFDb1Q+RTqqiQKqLuO5fEDWsNQKZvkEPO/6nt3jSPzzLEOh2MjG2Z2eP4EmOyf2X9iljTAqgJW5EcBytscMZQbmph9OxQKZ+Rrz+xZb/yCrYk3bvn6KW/pfR2hF0KCpXWR3/gBVOPhSYdJpj0Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ornYPF8irdJO0HnLGgTZYD5BzmNzlQGx3GI61bQk7qk=; b=Pa0M3BZmepP7fRj0knAaYkK+GZ2N7ov0TvVi+6efLoQh2aZ6q+I418vYzGv+vWytc2T2gmktUqXjWFH0OF8J7hO664118xvXkieXuB1ulkqFB7EibWQr5Q6iXSo3pTRqwCQk2n0bYS91jFZ8te6/M8z3K0g9q2VfcNwNLo7fhgMddYQdSFOVOfj52gWVVcd+C+EN/f61gxAghixbKMj0kQ8MkI7ivR7u5x7Pe8NxheDp0pt3qi7qRP+hCN602b6rN/FKfE6smm6lFWPQx8P7RpG/SDhtSqQrsa7GyP9T1XVclDIei8xpxb9Ou9emlkY2/w32MfnCvhlWIw5aIvYcrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ornYPF8irdJO0HnLGgTZYD5BzmNzlQGx3GI61bQk7qk=; b=SjEHzImT3N8nXaRF9nGoFG/tH7sIk/C2ktZeevSVY465TLhMWFawzF8Glqu93jvQuNrzZ4/0/7fvWj3ueGjQgVLiv/h8zauMUzGPp2r78qQ6pqBAjH+3Qdluj3u4J0UzBssrLXktLPx0L+ZBWizaYL0kxCEyBi2x7Y67Lv8kMM0= Authentication-Results: users.sourceforge.net; dkim=none (message not signed) header.d=none; users.sourceforge.net; dmarc=none action=none header.from=cornell.edu; Original-Received: from MN2PR04MB6176.namprd04.prod.outlook.com (2603:10b6:208:e3::13) by MN2PR04MB6110.namprd04.prod.outlook.com (2603:10b6:208:e5::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Fri, 11 Sep 2020 20:16:10 +0000 Original-Received: from MN2PR04MB6176.namprd04.prod.outlook.com ([fe80::c144:d206:c369:af44]) by MN2PR04MB6176.namprd04.prod.outlook.com ([fe80::c144:d206:c369:af44%7]) with mapi id 15.20.3348.019; Fri, 11 Sep 2020 20:16:10 +0000 In-Reply-To: Content-Language: en-US X-ClientProxiedBy: CH2PR07CA0024.namprd07.prod.outlook.com (2603:10b6:610:20::37) To MN2PR04MB6176.namprd04.prod.outlook.com (2603:10b6:208:e3::13) X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from [192.168.0.17] (68.175.129.7) by CH2PR07CA0024.namprd07.prod.outlook.com (2603:10b6:610:20::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16 via Frontend Transport; Fri, 11 Sep 2020 20:16:09 +0000 X-Originating-IP: [68.175.129.7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: db0c449f-a84f-477e-7df7-08d8568f8629 X-MS-TrafficTypeDiagnostic: MN2PR04MB6110: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zj0kG7XP4DQiCFr5jZiZZM925WPI19aqHvenE+Lue6Gxldam5PmhGiPtajrgQd7kLiiQJQOiUanNkhkOnelNVlyluXjnRhk3mLYK1fzhAspA1fhpP54Km1zg8IxrGPlUiKQKIJ46isRFmLZ7qHo6cNK1U9OkicNJp1GCDjtXvAB9Ngil3KluFeg81GFzOW0iwDrjyTDaFg3vnA4f9Mj0cT6ewdminsQXU/6OgLupPtXqlcwmZD/pElEPFj6YTqHesljZzrT3gt/7YT7/6D6zCZkub3KnzrAoHH1u6OwtmfYlHuFjj7uGIWkdGNpoyVb41rbWWjLYaaDeKgxK/S8ScxFeUKr+aJnNjN26ydum3XE5D8ZZlD1DSQsSobYQo6J02s1d93owJDqi4jooX2hAVQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR04MB6176.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(376002)(39860400002)(346002)(136003)(26005)(186003)(36756003)(110136005)(75432002)(786003)(53546011)(54906003)(66946007)(33964004)(2906002)(16576012)(66616009)(66556008)(66476007)(316002)(52116002)(31686004)(5660300002)(86362001)(83380400001)(16526019)(6486002)(4326008)(8676002)(8936002)(2616005)(31696002)(235185007)(478600001)(956004)(14963001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: t8AehS8PiHmVMB6mhsTK/DPYuLhWE28pZJGEt6bTetPOXkLnU/aMcVK2Lndh+13F3mINwJzbOHttRL1+m0hn35BgEK1RkxlQnfM8LMWzwDR4HScJwVxPraMLtcN/Z1oSPnl7BQqxFD5pQTD1fCtt30J3XuNxRfej2KcGYwMGV0XL4uIFKkDPKD5GjIBkpjRc6yUYY1fEZ522yrRqrSuL9mf2QGYKUH+5btAsamhP7CVTpgUsa2rPq4/FzcNMKBZp/vOVUaMQlItq3pAit1uosM4NMwkgHsjvZt81+3AlGiU3h5WHJyp1RHfzs9JydDg4nEFnCOctQV7RdJSyyjw8gh35YPTmw1MFa1F/u2q31jSiYRM03atfxtmLFtipY/BisMe/iuxkGL4sVWrnPkBd8XSBvVOFvCYIlplWQc9kT7FwjGIPJ7o/H6B7ZZgEaltVmGoXcNT8NL3D0kzgKbi4gX3vlZGujVrg+NJL7A9OC1RbCsIDpVHi34ot0EgiAQGGqaneUsJYIw/Ca2Wg/7+EG1HYzhEciC+tseS7SvckcX4MIXxVa+ab1vYOv6rsT9Mjob/ccngA7N6CipG7DTKl5/c/+jgIc4xRTxxaVnrTSyBF3vv2CnulhgF3sW9NVi11LjJI2ddx1ZUKhRIsHWyWVw== X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: db0c449f-a84f-477e-7df7-08d8568f8629 X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB6176.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2020 20:16:10.6512 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QgnYCjyz2S/csUC1Ib7freMzjmsK6FZ2LinSjnb43qMaiSEHBwAswsQGpgwzwUn9digMT4giBtm6QlSz+u3P7w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6110 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:187861 Archived-At: --------------7F46198AFFC10A2A9D711EF0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit On 9/11/2020 3:53 AM, martin rudalics wrote: > >> ... after > >> maximizing the frame with the mouse, the value of > >> > >> (frame-parameter nil 'fullscreen) > >> > >> is nil.  Correct? > > > > Yes. > > > >> And what is its value if, instead, you maximize the > >> frame via 'toggle-frame-maximized'? > > > > maximized. > > Mixing frame resizing triggered by Emacs commands and external tools is > tricky to handle. > > >> Apparently some check _is_ needed (why?) so probably > >> using > >> > >>              if (x < 0 || y < 0) > >>                store_frame_param (f, Qfullscreen, Qmaximized); > >> > >> instead will fix it.  Can you try that (as I said elsewhere it will then > >> fail for borderless, maximized frames)? > > > > Yes, that does fix it. > > So we'll probably have to use that.  Can you install it? Patch attached (under your name). Please check it and see if the commit message and comment change are OK. Eli and Lars, I think this should go to master rather than the emacs-27 branch, since there's too much that we don't understand about the fix. Do you agree? > > I haven't tried to test anything involving borderless frames. > > If you > > (set-frame-parameter nil 'undecorated t) > > and maximize the frame via some Windows (Aero, IIRC) command, what does Sorry, but I don't know what an Aero command is, and I'm not interested in learning if I don't have to. If anyone really cares about this case and can't carry out the experiment themselves, I'm willing to do it, but I'll need explicit instructions. > (frame-parameter nil 'fullscreen) > > report?  With and without the && ~> || change. > > And it would still be interesting to understand your earlier finding, > namely that > >   If I make this change and follow Dani's recipe from the original bug >   report, the second F11 press doesn't restore the previous state. >   Instead, the frame appears to get slightly smaller for an instant and >   then immediately reverts to fullscreen mode. > > That second F11 should set the 'fullscreen parameter to 'maximized so I > fail to see how a subsequent action can restore it to 'fullboth.  In > retrospect, that > >           /* Windows can send us a SIZE_MAXIMIZED message even >              when fullscreen is fullboth .... > > comment apparently matches your experience now but I cannot even recall > based on what experience I added it back then. > > Thanks, martin Ken --------------7F46198AFFC10A2A9D711EF0 Content-Type: text/plain; charset=UTF-8; name="0001-Fix-toggle-frame-fullscreen-on-w32-builds.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Fix-toggle-frame-fullscreen-on-w32-builds.patch" >From 9dd0fe7a16fba2b37e79be24acbd325b159086c6 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Fri, 11 Sep 2020 16:04:20 -0400 Subject: [PATCH] Fix toggle-frame-fullscreen on w32 builds * src/w32term.c (w32_read_socket): Set 'fullscreen' to 'maximized' if Windows sends SIZE_MAXIMIZED and either the top or the left of the frame is outside the screen. (Bug#25542) --- src/w32term.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/w32term.c b/src/w32term.c index 1766b32514..2669f29b56 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -5478,15 +5478,15 @@ w32_read_socket (struct terminal *terminal, /* Windows can send us a SIZE_MAXIMIZED message even when fullscreen is fullboth. The following is a simple hack to check that based on the fact that - only a maximized fullscreen frame should have both - top/left outside the screen. */ + only a maximized fullscreen frame should have top + or left outside the screen. */ if (EQ (fullscreen, Qfullwidth) || EQ (fullscreen, Qfullheight) || NILP (fullscreen)) { int x, y; w32_real_positions (f, &x, &y); - if (x < 0 && y < 0) + if (x < 0 || y < 0) store_frame_param (f, Qfullscreen, Qmaximized); } } -- 2.28.0 --------------7F46198AFFC10A2A9D711EF0--