From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#7296: display-pixel-height not enough Date: Sat, 30 Oct 2010 08:06:47 -0700 Message-ID: <9549EA1551554B2C97BE46ADFB617435@us.oracle.com> References: <83hbg66vt4.fsf@gnu.org><83d3qt77lj.fsf@gnu.org> <4CCA9E5D.5060002@swipnet.se><838w1h6zbp.fsf@gnu.org><4CCAC90B.4070800@swipnet.se> <4CCB2713.5070104@swipnet.se><4CCBC930.5060705@swipnet.se><4CCBF75B.8070209@swipnet.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1288451608 21277 80.91.229.12 (30 Oct 2010 15:13:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 30 Oct 2010 15:13:28 +0000 (UTC) Cc: 7296@debbugs.gnu.org To: "'Lennart Borgman'" , "'Jan =?UTF-8?Q?Dj=C3=A4rv'?=" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 30 17:13:23 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PCD7R-0005rr-Iw for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Oct 2010 17:13:22 +0200 Original-Received: from localhost ([127.0.0.1]:50063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCD7Q-0003dL-Te for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Oct 2010 11:13:20 -0400 Original-Received: from [140.186.70.92] (port=33560 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCD7J-0003bH-6z for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2010 11:13:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PCD7I-0004JR-57 for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2010 11:13:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60093) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PCD7I-0004JL-2I for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2010 11:13:12 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PCCxS-00064e-IQ; Sat, 30 Oct 2010 11:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Oct 2010 15:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7296 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 7296-submit@debbugs.gnu.org id=B7296.128845097123340 (code B ref 7296); Sat, 30 Oct 2010 15:03:02 +0000 Original-Received: (at 7296) by debbugs.gnu.org; 30 Oct 2010 15:02:51 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PCCxG-00064P-VI for submit@debbugs.gnu.org; Sat, 30 Oct 2010 11:02:51 -0400 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PCCxE-00064K-3H for 7296@debbugs.gnu.org; Sat, 30 Oct 2010 11:02:49 -0400 Original-Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o9UF70nZ008084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 30 Oct 2010 15:07:02 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o9U21h7r008564; Sat, 30 Oct 2010 15:06:59 GMT Original-Received: from abhmt009.oracle.com by acsmt353.oracle.com with ESMTP id 733258491288451207; Sat, 30 Oct 2010 08:06:47 -0700 Original-Received: from dradamslap1 (/10.159.217.50) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 30 Oct 2010 08:06:47 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Act4PKHpfh5GJ9qxRludomj5uK0S3QAAYOPQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 30 Oct 2010 11:03:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:41274 Archived-At: > >> The Emacs frame can be partly hidden by the taskbar... > >> if the height is ... x-dsiplay-pixel-height... > Every function that tries to maximize just height will do it. Can you give a recipe starting from emacs -Q? How are you setting the frame height? Remember that the frame `height' parameter should not include the frame area outside the space available for text, and it is measured in lines, not pixels. If you are setting the `height' parameter based on the `x-display-pixel-height' then you should first subtract frame borders, horizontal scroll bar (well, there isn't any, but the same method applies for the width), title bar, and (except on Mac) menu bar. And then convert pixels to char size - the `height' parameter is the number of text lines available at the frame's char size. See http://www.emacswiki.org/emacs/frame-cmds.el for examples. The code compensates for MacIntosh thingies that reduce the available space, but it uses `x-display-pixel-height' otherwise. See `maximize-frame-vertically' and `maximize-frame', which do not overlap the Windows task bar. Something like this calculates the `height' frame parameter: (- (/ (- (x-display-pixel-height) (* 2 (cdr (assq 'border-width (frame-parameters FRAME)))) (frame-extra-pixels-height FRAME) window-mgr-title-bar-pixel-height (smart-tool-bar-pixel-height)) (frame-char-height FRAME)) (if (eq window-system 'mac) 0 ; Menu bar for Carbon Emacs is not in the frame. (cdr (assq 'menu-bar-lines (frame-parameters FRAME))))))) Where: (defun frame-extra-pixels-height (frame) "Pixel diff between FRAME total height and its text area height." (- (frame-pixel-height frame) (* (frame-char-height frame) (frame-height frame)))) (defcustom window-mgr-title-bar-pixel-height (if (eq window-system 'mac) 22 27) "*Height of frame title bar provided by the window manager, in pixels. You might alternatively call this constant the title-bar \"width\" or \"thickness\". There is no way for Emacs to determine this, so you must set it." :type 'integer) (defun smart-tool-bar-pixel-height (&optional frame) "Pixel height of Mac smart tool bar." (if (and (boundp 'mac-tool-bar-display-mode) (> (frame-parameter frame 'tool-bar-lines) 0)) (if (eq mac-tool-bar-display-mode 'icons) 40 56) 0))