From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#31020: 27.0; Please provide a way to know about menu-bar wrapping Date: Mon, 02 Apr 2018 10:54:24 +0200 Message-ID: <5AC1EFC0.6020801@gmx.at> References: <37c99926-a5e5-4fa8-b734-6f9c146740e9@default> <837epq6sxx.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1522659196 20466 195.159.176.226 (2 Apr 2018 08:53:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 2 Apr 2018 08:53:16 +0000 (UTC) Cc: 31020@debbugs.gnu.org To: Eli Zaretskii , Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 02 10:53:11 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2vDD-0005Cx-AH for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Apr 2018 10:53:11 +0200 Original-Received: from localhost ([::1]:44432 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2vFH-0000wE-3t for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Apr 2018 04:55:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2vF5-0000tg-0U for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2018 04:55:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2vF0-0004XV-66 for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2018 04:55:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55032) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f2vF0-0004X5-2y for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2018 04:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f2vEz-000668-Mm for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2018 04:55: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, 02 Apr 2018 08:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31020 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31020-submit@debbugs.gnu.org id=B31020.152265928223408 (code B ref 31020); Mon, 02 Apr 2018 08:55:01 +0000 Original-Received: (at 31020) by debbugs.gnu.org; 2 Apr 2018 08:54:42 +0000 Original-Received: from localhost ([127.0.0.1]:34696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2vEg-00065U-G2 for submit@debbugs.gnu.org; Mon, 02 Apr 2018 04:54:42 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:57849) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2vEe-00065H-7R for 31020@debbugs.gnu.org; Mon, 02 Apr 2018 04:54:40 -0400 Original-Received: from [192.168.1.100] ([213.162.73.134]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M6ilI-1eHQmo2XUS-00wRjs; Mon, 02 Apr 2018 10:54:30 +0200 In-Reply-To: <837epq6sxx.fsf@gnu.org> X-Provags-ID: V03:K0:5b4VbrkUUMV1AFI3++h5JcYug/cQjpl6MWhYRkFVhgK9tHaVJIa tXRqGUwpRIjS1l3Qhc8T4ciLWnk5pKXHH5GhsRyIEf3HtdmAojB9qiRSi54wos0r3fKNPUL TbWYkSxjPZlaUOH9wk5q5C6hH2DpPP1LlHJpIpMO/Y1nJYopEysA5gxG9iWEu8rcG8AqwdU ZvdtYKgUXj5IuRZCMXThA== X-UI-Out-Filterresults: notjunk:1;V01:K0:6rLgpu3pBlY=:HKmSj1VVkGMcwgznSlv3tg p/aK3sBrZ2Zv+xbJRH7biO4IKVty1TQBmlOyXSNmys1kNvUvNTKbojwlqgLy3ufg1eEmx1Rb0 m2k7xQNCGssgousafe/M7E9MaKaDwgWlftWz5RkXB7XsPLYlVi4S3xQP5vJ943aePG9E/HeXM SlCQYpR0GnpSW8B5HIklYEOlqcvE6cW02DuSr148o2PijV1DJCP0wt1UQvUrkA2eGIVeKXcwe QM+aLc9/H8TL74m9a+VHowxh+G3GTZQaCPR+HrefQS8hAIDsVkzhhlOfXChGN6yneVwIOg3+y 9cXvdcnbFCWw4Q5oXsqkeUeu2yeeVY3cFmJ2VwOdyBxW/01fSLr7/dbqwDb3d9khJb/1t3CFI rpo1BThdDTwf3BMDwhzMTcdNIGoysmgg5nyH17x2QUDotRc/gWfAn1hfKLwEGR3yJAbhpI8d7 iI4lhGxBA7t8Pu0bfcFyzbulH0HNpU6HdrUTjkq5/XnnB2iGORSSfm3geCf4+VrhAzNiUiFgH 3qP8vRU+LIa7wU7fGL0V5WqE1CECL/E49qOSPMqeovDWCAoFoCnc1PlGxxOQR3a37rSQH5ImM vHGT2osHttTAszYanOhrZMW7JZ5bv4lm3WBcpVLLk0A+09oxWDci4EkeJTc/3fF0Wcgd8u3oR 5zJHnAUlmPLxYWZF19OCDzHdIas1rk/H3PFMcbwXq6wpXBGQMfr+Nq6MkiTUlbn386DyaFMnm 9Mf0DBiFQJvXLdUcUn56W+G5lJhaO8bhrlRuyOcmgoT0px5XssfXomFNzjfyf9Bazks3UBzn 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: 208.118.235.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:144790 Archived-At: > 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. martin