From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Eure Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#3233: 23.0.93; [NS] Regression in x-display-pixel-width Date: Wed, 6 May 2009 14:22:27 -0700 Message-ID: <87AAEBEC-E8DD-4BE0-A35A-9C0AEFB2F997@digg.com> References: <7F4B990D-CC02-4571-8637-A633215441C4@digg.com> Reply-To: Ian Eure , 3233@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1241645546 27006 80.91.229.12 (6 May 2009 21:32:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 6 May 2009 21:32:26 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org, 3233@emacsbugs.donarmstrong.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 06 23:32:15 2009 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.50) id 1M1oit-0007Jf-Hq for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 May 2009 23:32:15 +0200 Original-Received: from localhost ([127.0.0.1]:39484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1ois-0004Sb-LY for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 May 2009 17:32:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M1oin-0004Rt-Hs for bug-gnu-emacs@gnu.org; Wed, 06 May 2009 17:32:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M1oii-0004RD-PY for bug-gnu-emacs@gnu.org; Wed, 06 May 2009 17:32:09 -0400 Original-Received: from [199.232.76.173] (port=33191 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1oii-0004R3-Ik for bug-gnu-emacs@gnu.org; Wed, 06 May 2009 17:32:04 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:36666) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M1oih-0002hp-So for bug-gnu-emacs@gnu.org; Wed, 06 May 2009 17:32:04 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n46LVrDM007039; Wed, 6 May 2009 14:31:54 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n46LU3mH005796; Wed, 6 May 2009 14:30:03 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Ian Eure Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 06 May 2009 21:30:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3233 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12416449614167 (code B ref -1); Wed, 06 May 2009 21:30:03 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 6 May 2009 21:22:41 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n46LMWJV004136 for ; Wed, 6 May 2009 14:22:34 -0700 Original-Received: from mx10.gnu.org ([199.232.76.166]:44614) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1M1oZU-0000o3-AE for emacs-pretest-bug@gnu.org; Wed, 06 May 2009 17:22:32 -0400 Original-Received: from mail.digg.com ([64.191.203.36]:39252) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M1oZT-000199-KQ for emacs-pretest-bug@gnu.org; Wed, 06 May 2009 17:22:31 -0400 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.digg.com (Postfix) with ESMTP id 92B2FA84FC9; Wed, 6 May 2009 14:22:30 -0700 (PDT) X-Virus-Scanned: amavisd-new at Original-Received: from mail.digg.com ([127.0.0.1]) by localhost (mail.digg.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DuXXByHmMhst; Wed, 6 May 2009 14:22:29 -0700 (PDT) Original-Received: from [10.2.16.122] (diggstage01.digg.com [64.191.203.34]) by mail.digg.com (Postfix) with ESMTP id 5C456A84F57; Wed, 6 May 2009 14:22:28 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.930.3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Wed, 06 May 2009 17:32:09 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:27753 gmane.emacs.pretest.bugs:24398 Archived-At: On May 6, 2009, at 12:57 PM, Stefan Monnier wrote: >> It looks like the rewrite of (ns_get_screen) has some problems. In >> recent >> nightlies, the following code breaks: > >> (x-display-pixel-width (frame-parameter (selected-frame) 'display)) > >> With: >> Wrong type argument: terminal-live-p, "electron.local" >> It worked as of 05/05, > > As of 05/05 it treated any string as equivalent to nil, indeed. > Not sure if that qualifies as "worked". Can you point us to code that > is affected? > I don't think there's anything in Emacs itself, but it broke my code which centers an Emacs frame: (defun screen-usable-height (&optional display) "Return the usable height of the display. Some window-systems have portions of the screen which Emacs cannot address. This function should return the height of the screen, minus anything which is not usable." (- (display-pixel-height display) (cond ((eq window-system 'ns) 22) (t 0)))) (defun screen-usable-width (&optional display) "Return the usable width of the display. This works like `screen-usable-height', but for the width of the display." (display-pixel-width display)) (defun frame-box-get-center (w h cw ch) "Center a box inside another box. Returns a list of `(TOP LEFT)' representing the centered position of the box `(w h)' inside the box `(cw ch)'." (list (/ (- cw w) 2) (/ (- ch h) 2))) (defun frame-get-center (frame) "Return the center position of FRAME on it's display." (let ((disp (frame-parameter frame 'display))) (frame-box-get-center (frame-pixel-width frame) (frame-pixel- height frame) (screen-usable-width disp) (screen-usable-height disp)))) (defun frame-center (&optional frame) "Center a frame on the screen." (interactive) (let ((frame (or frame (selected-frame)))) (apply 'set-frame-position `(,frame ,@(frame-get-center frame))))) I don't know how (display-pixel-height) handles multihead displays, but it seems saner to explicitly pass the display the frame occupies. - Ian