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: Wed, 9 Sep 2020 16:24:31 -0400 Message-ID: <56ee5ed9-fd85-b5c3-6aba-d51332398f03@cornell.edu> References: <5889C6B4.8060506@gmx.at> <588A0102.7010704@gmx.at> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16135"; 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 Wed Sep 09 22:25:11 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 1kG6eU-00045d-QL for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Sep 2020 22:25:10 +0200 Original-Received: from localhost ([::1]:59202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kG6eS-0007Cw-LM for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Sep 2020 16:25:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kG6eM-0007Cn-OW for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2020 16:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51533) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kG6eM-0004Kr-EX for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2020 16:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kG6eM-0007Ma-Ad for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2020 16:25: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: Wed, 09 Sep 2020 20:25: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.159968308528277 (code B ref 25542); Wed, 09 Sep 2020 20:25:02 +0000 Original-Received: (at 25542) by debbugs.gnu.org; 9 Sep 2020 20:24:45 +0000 Original-Received: from localhost ([127.0.0.1]:34846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kG6e4-0007M1-Hp for submit@debbugs.gnu.org; Wed, 09 Sep 2020 16:24:44 -0400 Original-Received: from mail-bn8nam11on2133.outbound.protection.outlook.com ([40.107.236.133]:1473 helo=NAM11-BN8-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kG6e1-0007Lm-6R for 25542@debbugs.gnu.org; Wed, 09 Sep 2020 16:24:43 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kw1iJsWXxBe6wwLHRoiLpLQ24hfbp2yfXyD7eFUPZN9bPOiP3ONEg5z8d3Nrj1N3FdqUMEf2RRwx82I5APqpolZeOmJAvXPVo0OXeJyibcTg3K/AKu2JvBIegspjHPLkwhz0iQbBtppIXGZ9nuyW/pYPQv0CoEYj8I/Ow/1ZI4OobYMr1auJ9DvCytd8oWVsWO4p/+k5lIvMlpPW+B/8Hv391lKubiVHXjQR40MRk6kvM0w53YeSW0ioKkq04WUkri6egj2990LRS8rgUKTS8H6HdHrbZNaX1vXCv0cKtSnIEhs5yDN5LrDcjHLqDpnaSj2tWQoOMIiHdOHetzqlYg== 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=f12Ng1032uhmgdVlnRTDo5dkS9mvqipXW+G1Nzj0dBI=; b=QSdBdOwY22swbFFcrZDQBuJlEXp4OJeNTRabZohVDhrW57IUWq11T4bTjSsC0/c8SxwFWxABMpUBgQqNprfCTE9eQWEaTOD3HVRzxpwNoBFtfOaUBoQf5y+S8LjDnCsxxIom5hB+fhEkYAWV3bKX3mw21KnXLuSmBGMGGMpEeCLS0sBtzfT9ln9zJrQCigHWh+1o0qdGnzOhEtMHjNoIIEjMdlPI/sd0QPrNjqgrEfvpG7SPCfwP6vHhAfqojwsyyZAGCWbZW47346v2m/7WODpQVT5IS+ASu3uIxIRDczN3UxNHHXJ2n8Gx78QwLTd2IdFXSVKxrecFB9iKJIqIbw== 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=f12Ng1032uhmgdVlnRTDo5dkS9mvqipXW+G1Nzj0dBI=; b=LbowdVUy6m3hSQjzE/AQ5Fz09tBoEdKq9RionJrWdzaR5TbgkSuY5HOUZgaBHVVeMEWi79FxvVNtTfoyWmcrQLnPx64eRKP56YdBMtAWB+Puj4U/OOPqsWLGpaUEjDKuRGBjlxv33dBN/kCFBKEm5lRoVcof76qT1BCQkjqGWJo= 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 MN2PR04MB6223.namprd04.prod.outlook.com (2603:10b6:208:db::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.16; Wed, 9 Sep 2020 20:24:33 +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.017; Wed, 9 Sep 2020 20:24:33 +0000 In-Reply-To: Content-Language: en-US X-ClientProxiedBy: BL0PR05CA0013.namprd05.prod.outlook.com (2603:10b6:208:91::23) 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 BL0PR05CA0013.namprd05.prod.outlook.com (2603:10b6:208:91::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.10 via Frontend Transport; Wed, 9 Sep 2020 20:24:32 +0000 X-Originating-IP: [68.175.129.7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0aefb49f-c7b5-45fc-bb04-08d854fe5ce9 X-MS-TrafficTypeDiagnostic: MN2PR04MB6223: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jOQLrGHiJAox94GsnOar2zJKYfxBHItH86xc8G//aQGsEZMtNe9QtgOEICcoRGk/b77pfV63i1Zu9R+IP8rmoHF8xeCOqXTiHowTpeQOZsrbjCl2jQ6OIaMos1xR8vcc9Z7twfsWflfWpWaIixMidp0tJncOFWUPn2W43wCdChKWkP+NKa8S4jWNl3h4m2KkO7q1xAnjAdQhBhi4N4TBL5FFJuVjn2HvkmoAwZ3iLNLPbMaLHjom/2mFNZxB/tUL+riJtFeoka3RQv3eRhQY4U7RSJk6EBy+fzcEnzFqItzPZ9SLZMHSktzoF1XH7+8O9D8qmV4WUw4YMRH+YZ+xMTvTjifCZ2exE3ouupBd039QdXCD3z6LvvX4+i/JMHJi/rbFDCBWzxFeBi0GCzQ6Ng== 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)(376002)(39860400002)(346002)(136003)(396003)(16576012)(6486002)(31686004)(52116002)(956004)(8936002)(31696002)(4326008)(54906003)(110136005)(66476007)(86362001)(66556008)(66946007)(8676002)(83380400001)(26005)(36756003)(53546011)(478600001)(2616005)(2906002)(16526019)(786003)(5660300002)(186003)(75432002)(316002)(14963001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: x5qUAraayIjzHbx+UTIHXN3FlQO/OcKpuawJsdVVkJTj7Vrvz1clM7VcSHjmMxTAdJARjRNywh9kDx91YLYqm+HjXNgGugAjleCHCu7VmplMlCa8IzwM9tnatQFbsQss5UdUK/yRtrLBjlhaGoneRZlCPlEjFzR4mEbEHjtNV0612m1t0RT3FaAymw6+A6CYQQKBnRkwslxEtHMZkgy77GT+mepjrBAjf5G+n4dA2crlWJMz3barisH39XKYsCIlq9HYjEhLUZpbImLsosslgwJR7o9JX6cPPJmPZvuwXKbDPz63+8JXFOlg1KxP/j1T3ewgkDri+aj0URKFFZPkOEwOxL+nBkrv/tECOuAF4uLiVtgqSEDQ+vvCV4UT2cDPyiRnE8f8kd+lCJJakyjiY/qzYA3+Sq/24RVIiWNJ0oDkUFaTUSPbc4d3a2NTLUAPBQ+Y3+EBimFrU90RYbfGyRY3s2e8Jfwd8PG8lYuTmjalK3eGcwyMWkEf9JQ6odYIoyjXi+XhTcYVhSaqTDAQGq+bw8OHG8x1m2qfP4a8eBsyw/+2M1iVlSsYEL9ZR4W4Mjmlb/uY0X64m5Acu2EQEjiseRcoy0RjXPYn5/tn4DZaRMj9yrDImHE8dc0URH9B8GVUP1lSwdJTaz1pMQqEzw== X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 0aefb49f-c7b5-45fc-bb04-08d854fe5ce9 X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB6176.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2020 20:24:33.2521 (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: tvu5MXavprh/A69C3RMd6knMV/BwkfatTTi4doxSRq17yrpd4eYPj953SAeFxFQSb+hjf1IoehEY8Esv1mF/uw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6223 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:187701 Archived-At: On 9/9/2020 2:19 PM, Ken Brown wrote: > On 9/9/2020 4:44 AM, martin rudalics wrote: >>  > I've just downloaded a native w32 build [1] and I've run it on my >>  > system (MS Windows 10 Enterprise). I see the same problem with this >>  > native build. >> >> Can you please run under gdb with a breakpoint in w32fullscreen_hook of >> w32term.c suitably in here >> >>        else if (f->want_fullscreen == FULLSCREEN_MAXIMIZED) >>      { >>        if (prev_fsmode == FULLSCREEN_BOTH || prev_fsmode == FULLSCREEN_WIDTH >>            || prev_fsmode == FULLSCREEN_HEIGHT) >>          /* Make window normal since otherwise the subsequent >>             maximization might fail in some cases.  */ >>          ShowWindow (hwnd, SW_SHOWNORMAL); >>        ShowWindow (hwnd, SW_MAXIMIZE); >>      } >> >> and tell us how the frame appears immediately after the ShowWindow >> calls.  Here the first call makes the frame appear with its "normal" >> size, the second one makes it appear maximized. > > I just tried this on a Cygwin-w32 build from the master branch.  I put the > taskbar on the left, started emacs, maximized it, attached gdb, put breakpoints > at each of the ShowWindow lines, and ran through Dani's recipe for producing the > bug.  The breakpoints were never hit. I just tried again, but this time with a breakpoint at w32fullscreen_hook so that I could follow the flow. Here are the relevant excerpts from the gdb session: $ gdb ./emacs GNU gdb (GDB) (Cygwin 9.2-1) 9.2 [...] (gdb) b w32fullscreen_hook Breakpoint 2 at 0x10069507a: file ../../master/src/w32term.c, line 6441. (gdb) r -Q Starting program: /home/kbrown/src/emacs/x86_64-w32/src/emacs -Q [...] [Press F11] Thread 1 "emacs" hit Breakpoint 2, w32fullscreen_hook (f=0x8001f7c88) at ../../master/src/w32term.c:6441 6441 if (FRAME_VISIBLE_P (f)) (gdb) n 6443 HWND hwnd = FRAME_W32_WINDOW(f); (gdb) 6444 DWORD dwStyle = GetWindowLong (hwnd, GWL_STYLE); (gdb) 6446 enum fullscreen_type prev_fsmode = FRAME_PREV_FSMODE (f); (gdb) 6448 block_input(); (gdb) 6449 f->want_fullscreen &= ~FULLSCREEN_WAIT; (gdb) 6451 if (FRAME_PREV_FSMODE (f) == FULLSCREEN_NONE) (gdb) 6452 GetWindowPlacement (hwnd, &FRAME_NORMAL_PLACEMENT (f)); (gdb) 6454 if (FRAME_PREV_FSMODE (f) == FULLSCREEN_BOTH) (gdb) 6460 else if (FRAME_PREV_FSMODE (f) == FULLSCREEN_HEIGHT (gdb) 6461 || FRAME_PREV_FSMODE (f) == FULLSCREEN_WIDTH) (gdb) 6464 FRAME_PREV_FSMODE (f) = f->want_fullscreen; (gdb) p f->want_fullscreen $1 = FULLSCREEN_BOTH (gdb) n 6466 if (f->want_fullscreen == FULLSCREEN_NONE) (gdb) 6468 else if (f->want_fullscreen == FULLSCREEN_MAXIMIZED) (gdb) 6477 else if (f->want_fullscreen == FULLSCREEN_BOTH) (gdb) 6479 int menu_bar_height = GetSystemMetrics (SM_CYMENU); (gdb) 6482 FRAME_NORMAL_PLACEMENT (f).rcNormalPosition, &rect); (gdb) 6481 w32_fullscreen_rect (hwnd, f->want_fullscreen, (gdb) 6483 if (!FRAME_UNDECORATED (f)) (gdb) 6484 SetWindowLong (hwnd, GWL_STYLE, dwStyle & ~WS_OVERLAPPEDWINDOW); (gdb) 6486 rect.right - rect.left, rect.bottom - rect.top, (gdb) 6485 SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top, (gdb) 6486 rect.right - rect.left, rect.bottom - rect.top, (gdb) 6485 SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top, (gdb) 6490 FRAME_PIXEL_TO_TEXT_HEIGHT (f, (rect.bottom - rect.top (gdb) 6488 change_frame_size (gdb) 6489 (f, FRAME_PIXEL_TO_TEXT_WIDTH (f, rect.right - rect.left), (gdb) 6488 change_frame_size (gdb) 6526 f->want_fullscreen = FULLSCREEN_NONE; (gdb) 6527 unblock_input (); (gdb) 6529 if (f->want_fullscreen == FULLSCREEN_BOTH (gdb) 6530 || f->want_fullscreen == FULLSCREEN_WIDTH (gdb) 6531 || f->want_fullscreen == FULLSCREEN_HEIGHT) (gdb) 6537 } [...] (gdb) c Continuing. [Press F11 again] Thread 1 "emacs" hit Breakpoint 2, w32fullscreen_hook (f=0x8001f7c88) at ../../master/src/w32term.c:6441 6441 if (FRAME_VISIBLE_P (f)) (gdb) n 6443 HWND hwnd = FRAME_W32_WINDOW(f); (gdb) 6444 DWORD dwStyle = GetWindowLong (hwnd, GWL_STYLE); (gdb) 6446 enum fullscreen_type prev_fsmode = FRAME_PREV_FSMODE (f); (gdb) 6448 block_input(); (gdb) 6449 f->want_fullscreen &= ~FULLSCREEN_WAIT; (gdb) 6451 if (FRAME_PREV_FSMODE (f) == FULLSCREEN_NONE) (gdb) p f->want_fullscreen $2 = FULLSCREEN_NONE (gdb) n 6454 if (FRAME_PREV_FSMODE (f) == FULLSCREEN_BOTH) (gdb) 6456 if (!FRAME_UNDECORATED (f)) (gdb) 6457 SetWindowLong (hwnd, GWL_STYLE, dwStyle | WS_OVERLAPPEDWINDOW); (gdb) 6458 SetWindowPlacement (hwnd, &FRAME_NORMAL_PLACEMENT (f)); (gdb) 6464 FRAME_PREV_FSMODE (f) = f->want_fullscreen; (gdb) 6466 if (f->want_fullscreen == FULLSCREEN_NONE) (gdb) 6467 ShowWindow (hwnd, SW_SHOWNORMAL); [Now the frame reverts to an unmaximized state, exhibiting the bug.] Ken