From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Roshan Shariff Newsgroups: gmane.emacs.bugs Subject: bug#67654: 29.1; Hiding menu bar makes new frames very small Date: Mon, 11 Dec 2023 00:13:04 -0700 Message-ID: References: <871qbzo6h4.fsf@yahoo.com> <83edfz4i9b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21508"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , 67654@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 11 08:17:10 2023 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 1rCaXL-0005LG-UM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 11 Dec 2023 08:17:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rCaX3-00029P-Hl; Mon, 11 Dec 2023 02:16:49 -0500 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 1rCaX1-00028Q-Ld for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 02:16:47 -0500 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 1rCaX1-00066n-3Z for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 02:16:47 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rCaXF-0006Ar-M7 for bug-gnu-emacs@gnu.org; Mon, 11 Dec 2023 02:17:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Roshan Shariff Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Dec 2023 07:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67654 X-GNU-PR-Package: emacs Original-Received: via spool by 67654-submit@debbugs.gnu.org id=B67654.170227897923640 (code B ref 67654); Mon, 11 Dec 2023 07:17:01 +0000 Original-Received: (at 67654) by debbugs.gnu.org; 11 Dec 2023 07:16:19 +0000 Original-Received: from localhost ([127.0.0.1]:52349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCaWY-000698-HX for submit@debbugs.gnu.org; Mon, 11 Dec 2023 02:16:18 -0500 Original-Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:43302) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCaTw-00062i-35 for 67654@debbugs.gnu.org; Mon, 11 Dec 2023 02:13:36 -0500 Original-Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-286d8dae2dbso3918375a91.1 for <67654@debbugs.gnu.org>; Sun, 10 Dec 2023 23:13:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702278796; x=1702883596; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7/cVCwK79FOu8tO0sJp1egOpPTnT62VwE7dumY22YQo=; b=Xx2n/VgYsERA1RVh5H/WKoXK5WrV8JzBoIhih1vQ+7A1vuKskup4VdlXS0fGTs/p8w 0bNtn9WQ5nbitFPipiWmt8k//i1OE0J0t2MxZ2h9s8X9W2hWaLgZcQYIiMvQW2Dsd+q1 xSgwBNpk42eSRZq3idvXF/WMThHwPbD9jEi8NWSA7yz6QFK8slpj3IyGXcEHQdYKMrVt JkS+6Qzi05PYjSUFlELtx2vcLlvl5b3gt8EA0Dh+CEMcNgzxNwE1ZAqeccKGjjMg2KeK YEAlohUkX6UQuHVKCsNrt48d7cBMWoyH1+Pw9jl2DB5P1AEvo0GYlprEjEBj/aUZemcA WTdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702278796; x=1702883596; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7/cVCwK79FOu8tO0sJp1egOpPTnT62VwE7dumY22YQo=; b=Zo24Ep0gTsWQpCMMdLkn6BAsDOY5h2bpaPkMI1K5a+rJNWZjeeGLXqyg029Krz71p5 3DsTQcA2vRjd8H85AdiKEPi0Z04x1094gMyHNUNiA2NJWlDX1zCO1PesQ/AWwT1vrhTl FMlbT/4fuzPKKbIgxZDddcxmvuBBnhGc/VxjRedd4Z+opIE01L+1b0G11h7HH8+426ju R0/uxZ/a6b5PvewWGqJDJu2y6G0p9WzIZDN0Jjk67MueXhdrdWeM1AubV2f9rSQbDMrl Ofw4Eq4F8FsOMkmLTHYyq6kNP3qJTen4Oc/fFW08FuaD4jgzczJ/CX5SUOSYwZaHBwRp t8AA== X-Gm-Message-State: AOJu0YyJQ/48a0wU9OdrFxeGrfXTTULd7fpg+Wlq5/gtoZvpqfAthsnU kFU0YynVmyVdlU4TQYXIGCa/WoE3im20LXvysQQ= X-Google-Smtp-Source: AGHT+IH0zzmRa7dJ4y+872QazLCKELRvwoR3qZ9dd8XP86IqSbE/ooKfIwvrNpCWU09ZenMpS8eQasegSncvSxsUk+0= X-Received: by 2002:a17:90a:6303:b0:28a:a249:2b10 with SMTP id e3-20020a17090a630300b0028aa2492b10mr327137pjj.33.1702278795553; Sun, 10 Dec 2023 23:13:15 -0800 (PST) In-Reply-To: X-Mailman-Approved-At: Mon, 11 Dec 2023 02:16:16 -0500 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:275969 Archived-At: I tried a git bisect only to find that commits as far back as ~2015 exhibit the bug; I wasn't able to compile older versions on my system because of segfaults during compilation. So it seems plausible that the GTK3 build of Emacs has always had this issue. While coming up with a workaround (see below) I noticed something odd. I added a hook to after-make-frame-functions that prints out the frame-{char,native,text,outer}-{width,height} of the newly created frame. I found that immediately after the frame is created, these values are fine. But when printing them out after a brief sleep-for, or using run-with-timer, the values actually match the size of the tiny frame. So it seems that Emacs thinks the frame has the correct size on creation, but learns of its actual size a little bit later. The following workaround needs the run-with-timer (and the duration needs to be long enough): (add-hook 'after-make-frame-functions (defun +resize-after-make-frame (frame) ;; HACK Resize new frames shortly after creation. Works around ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=67654 (when-let ((width (alist-get 'width default-frame-alist)) (height (alist-get 'height default-frame-alist))) (run-with-timer (/ 1.0 60) nil #'set-frame-size frame width height)))) I figure there's little chance of finding the root cause, but hopefully the workaround will help people who come across this.