From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#31020: 27.0; Please provide a way to know about menu-bar wrapping Date: Sat, 28 Sep 2019 20:42:35 +0200 Message-ID: References: <37c99926-a5e5-4fa8-b734-6f9c146740e9@default> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="184284"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 31020@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 28 21:00:52 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEHxb-000lmx-Hm for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Sep 2019 21:00:51 +0200 Original-Received: from localhost ([::1]:34512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEHxZ-0004PH-IT for geb-bug-gnu-emacs@m.gmane.org; Sat, 28 Sep 2019 15:00:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44277) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEHgP-0003nx-2R for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2019 14:43:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iEHgN-0001UT-7k for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2019 14:43:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42436) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iEHgN-0001UA-4W for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2019 14:43:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iEHgM-0002WN-AZ for bug-gnu-emacs@gnu.org; Sat, 28 Sep 2019 14:43:03 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <37c99926-a5e5-4fa8-b734-6f9c146740e9@default> Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Sep 2019 18:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31020 X-GNU-PR-Package: emacs Original-Received: via spool by 31020-submit@debbugs.gnu.org id=B31020.15696961749670 (code B ref 31020); Sat, 28 Sep 2019 18:43:02 +0000 Original-Received: (at 31020) by debbugs.gnu.org; 28 Sep 2019 18:42:54 +0000 Original-Received: from localhost ([127.0.0.1]:51255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEHgE-0002Vt-86 for submit@debbugs.gnu.org; Sat, 28 Sep 2019 14:42:54 -0400 Original-Received: from mail-pl1-f177.google.com ([209.85.214.177]:45140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEHgC-0002VX-EV for 31020@debbugs.gnu.org; Sat, 28 Sep 2019 14:42:52 -0400 Original-Received: by mail-pl1-f177.google.com with SMTP id u12so2309365pls.12 for <31020@debbugs.gnu.org>; Sat, 28 Sep 2019 11:42:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=OIAIIaj2hHDkckrUbUZSI5KtYPdg7TWzUMwOv4ZugPs=; b=XqNvEvdPqsKyzVnYwZ7+dT5iDy3vSRsWI+VqMCbxvIhWlp57YPSqaWkfRTRIQ/PGU7 qx+IugFlbfoVuTsK/1yrtD6v9uc++ST4Gi+d9jP5LuG6hQuIszc7++/WNgV76JwMey3a fGWmk66FZ93SwUjR2RSQfzERRkG4lR1O7oyhED2cMRJW3e2G0V7FATmtzqNGWsrWZ/Lv z9VZmTd/zpJMEM8KKWLyGk5kuEUEW+PpVUtmvSWBHZKjC1UZC3+oThde8cc6vO3bFvvE 7NSCObloSMnLEt9+Yy0eqoUKO22sZFgF/OzNtwkUy9vTEZWrehr8q+cpQCzn+Ao5cH3H eVUQ== X-Gm-Message-State: APjAAAXtK1uS3ARY18piZBpZXkVT9tG2viyjFcR33mY9akwB5qLcETwN VV9JdL0P7UNjh/D7mqvxjuI1weYElifbFRWwyuE= X-Google-Smtp-Source: APXvYqz7zk3Ly7z5J4lp6c4B72Esp7p62+7a0x5Q/tJfrLl4F6NpuDgwzrTuReETutpUrM3u6C0kB/BcHhegygf70T8= X-Received: by 2002:a17:902:a515:: with SMTP id s21mr12155165plq.259.1569696166718; Sat, 28 Sep 2019 11:42:46 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:167516 Archived-At: tags 31020 + wontfix close 31020 quit martin rudalics writes: >> I don't understand why you think that the menu-bar-lines parameter >> should not be it. AFAIU, the problem with setting it (or any other >> frame parameter) to the actual value is that with many toolkits Emacs >> simply doesn't know the correct value. But maybe Martin will have >> some trick up his sleeves. > > I am not aware of any toolkit telling us that number or whether the > current menu bar was wrapped at all. It's nowhere in the various API > descriptions and I suppose the information usually gets lost somewhere > in between calculations of which font the user's theme wants for the > menu bar and how that affects wrapping. I'm not even sure whether > some toolkit would deliberately truncate our menu bar when it doesn't > fit into one line. And lets not talk about GTK auto-resizing our > frame when the menu bar gets too long. > > So what you can do is the following: Make a frame with a _visibly > unwrapped_ menu bar, get the menu bar height via > > (cddr (assq 'menu-bar-size (frame-geometry))) > > Do the same for a frame with a _visibly wrapped_ two-lines menu bar. > You can now derive the height of the single-line and any additional > menu bar line and use these values together with 'frame-geometry' for > getting the actual number of lines. > > Obviously, this will work only as long as you do not change themes, > the menu bar height of the current theme or the resolution of your > screen or whatever else could affect this. And since you have to > visuallly check the "wrappedness" of the menu bar, this work cannot be > reasonably done from within Emacs. It seems like the conclusion here is that the feature suggestion is not practical, so I'm closing it as wontfix. If this is incorrect, please reopen the bug. Best regards, Stefan Kangas