From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#46827: Broken initial size of GTK3 frame Date: Mon, 3 May 2021 18:51:52 +0200 Message-ID: <3096e1f1-0090-5892-c752-bd82d974214e@gmx.at> References: <6caa020a-084c-e3f2-7a34-262f7127b21b@gmx.at> <871ratp19y.fsf@linkov.net> <36799c0d-a26b-a862-2b18-fb9bf9f3f30c@gmx.at> <87sg384r70.fsf@mail.linkov.net> <7471b198-a5ad-f79d-46fe-5498a299c964@gmx.at> <87eeerwvoq.fsf@mail.linkov.net> <9cde65ef-b150-121b-bd7f-5852406180c1@gmx.at> <87bl9uqjuq.fsf@mail.linkov.net> <874kfk50f4.fsf@mail.linkov.net> <7e503d11-5cd0-9ed7-e75a-5977eb5ecf3a@gmx.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------B3E8489C2A1BB48A277360AB" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6341"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 46827@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 03 18:53:29 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 1ldbp2-0001XR-DJ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 May 2021 18:53:28 +0200 Original-Received: from localhost ([::1]:32792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldbp1-0008UB-FD for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 May 2021 12:53:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldbob-0008R4-Rk for bug-gnu-emacs@gnu.org; Mon, 03 May 2021 12:53:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35946) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldbob-0002tS-JX for bug-gnu-emacs@gnu.org; Mon, 03 May 2021 12:53:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ldbob-0000dl-Ia for bug-gnu-emacs@gnu.org; Mon, 03 May 2021 12:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 May 2021 16:53:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46827 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 46827-submit@debbugs.gnu.org id=B46827.16200607242446 (code B ref 46827); Mon, 03 May 2021 16:53:01 +0000 Original-Received: (at 46827) by debbugs.gnu.org; 3 May 2021 16:52:04 +0000 Original-Received: from localhost ([127.0.0.1]:47489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldbnf-0000dO-Sq for submit@debbugs.gnu.org; Mon, 03 May 2021 12:52:04 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:56731) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldbnd-0000d0-9O for 46827@debbugs.gnu.org; Mon, 03 May 2021 12:52:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1620060714; bh=qWz/sw1e6KKkd94VccqwrPf9tM6jPRRp16xOJkqrGFM=; h=X-UI-Sender-Class:Subject:From:To:Cc:References:Date:In-Reply-To; b=KPIXqhZEjRuin+rHkfqoHPmRT0eyDl41zRSy4DDZdrz++W8brCclEOCHo6Xnml2Vj +BrblUFAju+bdaQhdCOA8boGAeYCNkSucTtKrL4CVIUBUyPNZT82dT3IEeT5kOIIMc /DcgYIbTBfTbg8D2u5ifcbrzxDxkpyDIKES1Bnww= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([46.125.249.118]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MmDEm-1lDJWM1saO-00iDz9; Mon, 03 May 2021 18:51:54 +0200 In-Reply-To: <7e503d11-5cd0-9ed7-e75a-5977eb5ecf3a@gmx.at> Content-Language: en-US X-Provags-ID: V03:K1:iFOz2b7yoq3dOGai4dYr6T3wDkSApkoYui+uQNp1PR7GKmJYQEI w3GAQLstD9LpeDL7yR+xOtOMER0pVP2jO5MoATcyWu7LJKJQdEFKU3mscw5XtUwizDLrJmc q/lftL0AvZdFMdha+un95hF463cnJwAIoDk7zfqquVHFXD5w9tTuODDFUNYlpdU816WnCS7 /TmJrFT2Dd2ukeqfxoTQA== X-UI-Out-Filterresults: notjunk:1;V03:K0:mgCngGSsRqI=:rvtpMJzArsAay3fLqFzVI7 3hIlOeEb3jpGRM73b1XUgyeLqEqIpXLn3k7XNJ+hwPC/8KIOi4DNIVfqakpuaRKQi9k5hENFD RUi0FvVRfzKXwEP/vee9/JIHRU5D9Gc6FX2YbcujDIF+ckqcwp/4SnWAkiJnKS115zpw06Iaz 1eu5ZhnGnIyZJCq1qVIpVBmwAIicJutKjpeQUa3d+PzM/V1b5JvDDtC5lynGBOL8ugygY3qxM zqH8WvWOxEqRHnSFaPHm4QG4zVZEys9zXoDkDVoQO+Z+BuaEh0VSJNI7tYVdMGCcVxDbnY5t7 LseSA6Q6lWyiGekaxw+64l3CJaOyDwIPpnRwz5i+/FF9jtX3WZc2cMm0Cf+uFLDN26pmXsXbm ERbsaE18+lBTsxA3dmD870ah7eIWN+DftPF8Hr5GfeHkbQSzstftVV+LyIR7LjbJlwumpiAsO 0AlgnZ0j3rT/MQwQxJGsADf/yStvooIoNcEPONOHppFmdfWrB0tgyyhpy63okfO8rei3kcivf 0nyuw5MhzekA34mzTLCs0/B5chN/5WTErbWiQXCXJGVGit28RBZ0YLj7nCiR7ZHkWtHfZCV7f LIo3jWvOM7cFAosMp8muVlPbBUOEOdG99uC9iYAeX5mnYhHMiwV8SNHAk7Hvb7mkyYKTyU53q hgAaR45gOnj1NHzfjKCskDDe1K0fni5m2p72whUy4bTUQwK3i0K0KIIezhxR0h+goUG2Of0Jh P3BOStjSoOkzbiZKd5+dMlruR7qvQDHTgZEQJv7vQbWhYaEjn9z47COGLqFR8Jty5jziu6OZ 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:205533 Archived-At: This is a multi-part message in MIME format. --------------B3E8489C2A1BB48A277360AB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Please try it and tell me whether the frame size history (hoperemains empty now. > > 1. when the frame flashes: > > > > Frame size history of # > > tab-bar-lines (3), TS=640x610~>640x612, TC=80x35~>80x36, IS=656x610~>656x612, MS=32x51 IH IV > > tab-bar-lines (3), TS=640x612~>640x610, TC=80x36~>80x35, IS=656x612~>656x610, MS=80x85 IH IV > > x_make_frame_visible > > set_window_configuration (4), MS=80x85 IH IV > > > > 2. when no flash after adding sit-for in window--display-buffer: > > > > Frame size history of # > > tab-bar-lines (3), TS=640x610~>640x612, TC=80x35~>80x36, IS=656x610~>656x612, MS=32x51 IH IV > > tab-bar-lines (3), TS=640x612~>640x610, TC=80x36~>80x35, IS=656x612~>656x610, MS=32x51 IH IV > > x_make_frame_visible > > set_window_configuration (4), MS=80x85 IH IV > > Didn't you earlier say that all this happens in a maximized frame? The > sizes above seem to contradict that. In either case, someone requests > to enlarge and shrink the tab bar by two pixels which contradicts your > earlier "and the tab bar is not resized". So who wants to do that to > the tab bar and why? And who wants to set the window configuration here > and why? What apparently happens is the following: x_set_tab_bar_lines (why?) gets called all the time with a VALUE of 1 and translates that to FRAME_LINE_HEIGHT (f) when calling x_change_tab_bar_height. So the latter sets FRAME_TAB_BAR_HEIGHT (f) to FRAME_LINE_HEIGHT (f) which is two pixels less than the height needed to display the tab bar. This means we enlarge and move upwards the root window by two pixels and later shrink and move it down when redisplay has calculated the new size. The attached patch tries to fix that. Note that a simple nlines != olines is not sufficient since the tab bar occupies 2 lines while VALUE is 1. Maybe we should do a similar thing for the tool and/or menu bars (but I recall that some builds do process a VALUE > 1 specially for them). martin --------------B3E8489C2A1BB48A277360AB Content-Type: text/x-patch; name="xfns.c.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="xfns.c.diff" diff --git a/src/xfns.c b/src/xfns.c index 2c95065d3e..c6a128ef51 100644 =2D-- a/src/xfns.c +++ b/src/xfns.c @@ -1615,6 +1615,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object v= alue, Lisp_Object oldval) static void x_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldv= al) { + int olines =3D FRAME_TAB_BAR_LINES (f); int nlines; /* Treat tab bars like menu bars. */ @@ -1627,7 +1628,8 @@ x_set_tab_bar_lines (struct frame *f, Lisp_Object va= lue, Lisp_Object oldval) else nlines =3D 0; - x_change_tab_bar_height (f, nlines * FRAME_LINE_HEIGHT (f)); + if (nlines !=3D olines && (olines =3D=3D 0 || nlines =3D=3D 0)) + x_change_tab_bar_height (f, nlines * FRAME_LINE_HEIGHT (f)); } --------------B3E8489C2A1BB48A277360AB--