From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#21415: 25.0.50; Emacs Trunk -- pixelwise width/height for x-create-frame Date: Thu, 10 Sep 2015 08:57:25 +0200 Message-ID: <55F129D5.4090605@gmx.at> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070003080608040809090306" X-Trace: ger.gmane.org 1441868303 17322 80.91.229.3 (10 Sep 2015 06:58:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Sep 2015 06:58:23 +0000 (UTC) Cc: 21415@debbugs.gnu.org To: Keith David Bershatsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 10 08:58:13 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZZvoB-0000G2-D2 for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Sep 2015 08:58:11 +0200 Original-Received: from localhost ([::1]:47336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZvoB-0001K3-2X for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Sep 2015 02:58:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZvo7-0001Jr-27 for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2015 02:58:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZvo2-0008Hy-17 for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2015 02:58:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZvo1-0008Hu-Sz for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2015 02:58:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZZvo1-00084I-Ng for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2015 02:58: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: Thu, 10 Sep 2015 06:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21415 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21415-submit@debbugs.gnu.org id=B21415.144186825630982 (code B ref 21415); Thu, 10 Sep 2015 06:58:01 +0000 Original-Received: (at 21415) by debbugs.gnu.org; 10 Sep 2015 06:57:36 +0000 Original-Received: from localhost ([127.0.0.1]:54418 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZZvnc-00083d-5k for submit@debbugs.gnu.org; Thu, 10 Sep 2015 02:57:36 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:53286) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZZvna-00083V-CP for 21415@debbugs.gnu.org; Thu, 10 Sep 2015 02:57:35 -0400 Original-Received: from [188.22.106.35] ([188.22.106.35]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0Llm9w-1Z0s1s1qiG-00ZSV3; Thu, 10 Sep 2015 08:57:32 +0200 In-Reply-To: X-Provags-ID: V03:K0:7XNv2Bg6+O3y+VvSc24uBivyB3z0odqgrtXagzi7uviNPP2M3f6 JQlPxwpY88Iaox20oNudjY4tQHxyVX7RkTCf1GXSX1qbSRZt/ST/F+9TNFfXrLjZCGomHpF wqvOt4r6Hp45ZX2SFqc7DdtZxLky1NKZSqbxxW0m+5EnexcHmUDUKLFM+LtGj0XMlQM6emi AacnjEyvLvJFmdk5mcJ8Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:ttrQNp8uLho=:iVaRlK4MO79ZY04NaWXY40 IWRMYecXG+tCfqgEFV+DY0KqcLgjwOn/a9md0cPNrCxIpwyGDGzbxWRfjWRyx44+siCgebo99 fSOmdFFnudntfhuzRSDNQXPZoC5YrMd7Gu/2j7DmtapOL4joqzjes9GTaXOPOc3Kxc00rOf2U mdl8K4Z43WtwB/nN/XOMZOHy0i/aP7IBQLatgUslKsnLDmXoXr1xM3Z4ho3OZgzKuPd6gWRTU LPxgfaPjFIP0CZVUZp88AbP7nm7IqsQ9ywH48jxCjNkIwv7efsdSt9FHmJgLX1fhRNlp/0yB5 t9i7bfGdK2JbsuO8U4J4T10DRNdkYO7bjLaLdmc4sqHWBb6S1xaE1649C2n/YK8bWYVb/uKq3 l9AjCeDFsA8IxIkwUnus4d+zJdZ6M1iXx/PlMArQ3bX87g+9uJq7HVUwqjcdSGTtCDuZmOX2q kLoGIaAdP8JNNGoHO5iRqj6fM4v+Hun7xdOx5bQdTUQTumnyDYcVb7az+Y6AObStxCxM9T5T8 dGjR/JS7XYGBqlWnUSmQsRdofBp3F7+U76roLK6ENaGRYi9bD+MrICqwDHbX1AVzExRiCFEf9 s0vqXH5TXE94kShCbNvzS4r6hsewz/7uA+iFhhbwegw0EvFvinx/bPOh77jLI/BomQ1QpXADJ E0mIrpacgtSw65D62oi1Tx3uOgr9QJABIQdppJ9qWiN8DLnBQ7U6otqZxed0B2kKdSbF7nyiB SWTlEIqqEFM3gAjA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106335 Archived-At: This is a multi-part message in MIME format. --------------070003080608040809090306 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable > The patch of `nsterm.m` has repaired much of the functionality of > `frame-inhibit-implied-resize`. The two tests that previously failed > now work as expected: > > 1. From a maximized frame, I can change the `font` to Courier > 18 using `set-face-attribute` and there is no need to set > `frame-inhibit-implied-resize` in that circumstance. I'm afraid that setting =91frame-inhibit-implied-resize=92 would't have helped anyway in that case. > 2. From a frame that is smaller than the screen size, I can use= > `set-face-attribute` to change the font to Courier 18 > provided that `frame-inhibit-implied-resize` is set to `t`. OK. Together with the two I sent earlier I attach one additional change, this time for the tool bar. You don't use it, so it shouldn't affect you. Nevertheless keep it included, it might have side effects. > The problem I am having is with a situation where > `ns-auto-hide-menu-bar` is set to `t`. As previously noted in this > thread, the `top` frame parameter is ignored when making a new frame > that is the size of the screen -- the new frame appears substantially > above the top of the display -- i.e., one-half out of sight. When the= > new frame is partially above the top of the screen, > `set-face-attribute` substantially enlarges the frame even though > `frame-inhibit-implied-resize` is set to `t`. When the frame comes > back into full view (e.g., top 0, left 0), it is then possible to > apply `set-face-attribute` without altering the dimensions of the > frame. The following are two examples -- one example works, the other= > example is broken -- both rely upon `ns-auto-hide-menu-bar` being set > to `t`. > > (setq ns-auto-hide-menu-bar t) > > ;; WORKS > (let* ( > (frame-inhibit-implied-resize t) > (frame > (make-frame '( > (vertical-scroll-bars) > (left-fringe . 8) > (right-fringe . 8) > (width . 1259.0) > (height . 771.0) > (tool-bar-lines . 0)))) ) > (set-frame-position frame 0 0) > (set-face-attribute 'default frame :font "-*-Courier-normal-normal-= normal-*-18-*-*-*-m-0-iso10646-1")) > > ;; BROKEN > (let* ( > (frame-inhibit-implied-resize t) > (frame > (make-frame '( > (font . "-*-Courier-normal-normal-normal-*-18-*-*-*-m-0-iso10= 646-1") > (vertical-scroll-bars) > (left-fringe . 8) > (right-fringe . 8) > (width . 1259.0) > (height . 771.0) > (tool-bar-lines . 0)))) ) > (set-frame-position frame 0 0)) I have no idea what this small segment in nsterm.m if (ns_menu_bar_should_be_hidden ()) return frameRect; is meant to accomplish. Try to comment it out and see what happens. If you see a difference, we'll have to look into it. martin --------------070003080608040809090306 Content-Type: text/plain; charset=windows-1252; name="Keith.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Keith.diff" diff --git a/src/frame.c b/src/frame.c index 6debcb8..f0c76ca 100644 --- a/src/frame.c +++ b/src/frame.c @@ -4582,20 +4582,40 @@ x_figure_window_size (struct frame *f, Lisp_Object parms, bool toolbar_p) { if (!EQ (width, Qunbound)) { - CHECK_NUMBER (width); - if (! (0 <= XINT (width) && XINT (width) <= INT_MAX)) - xsignal1 (Qargs_out_of_range, width); + if (FLOATP (width)) + { + if (XFLOAT_DATA (width) < 0 || (int) XFLOAT_DATA (width) > INT_MAX) + xsignal1 (Qargs_out_of_range, width); + else + SET_FRAME_WIDTH (f, (int) XFLOAT_DATA (width)); + } + else + { + CHECK_NUMBER (width); + if (! (0 <= XINT (width) && XINT (width) <= INT_MAX)) + xsignal1 (Qargs_out_of_range, width); - SET_FRAME_WIDTH (f, XINT (width) * FRAME_COLUMN_WIDTH (f)); + SET_FRAME_WIDTH (f, XINT (width) * FRAME_COLUMN_WIDTH (f)); + } } if (!EQ (height, Qunbound)) { - CHECK_NUMBER (height); - if (! (0 <= XINT (height) && XINT (height) <= INT_MAX)) - xsignal1 (Qargs_out_of_range, height); + if (FLOATP (height)) + { + if (XFLOAT_DATA (height) < 0 || (int) XFLOAT_DATA (height) > INT_MAX) + xsignal1 (Qargs_out_of_range, height); + else + SET_FRAME_HEIGHT (f, (int) XFLOAT_DATA (height)); + } + else + { + CHECK_NUMBER (height); + if (! (0 <= XINT (height) && XINT (height) <= INT_MAX)) + xsignal1 (Qargs_out_of_range, height); - SET_FRAME_HEIGHT (f, XINT (height) * FRAME_LINE_HEIGHT (f)); + SET_FRAME_HEIGHT (f, XINT (height) * FRAME_LINE_HEIGHT (f)); + } } user_size = x_get_arg (dpyinfo, parms, Quser_size, 0, 0, RES_TYPE_NUMBER); diff --git a/src/nsfns.m b/src/nsfns.m index 89b9f7c..4cb33be 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -679,7 +679,8 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) } } - x_set_window_size (f, 0, f->text_cols, f->text_lines, 0); + frame_size_history_add (f, Qupdate_frame_tool_bar, 0, 0, Qnil); + adjust_frame_size (f, -1, -1, 2, 0, Qtool_bar_lines); } diff --git a/src/nsterm.m b/src/nsterm.m index 2806f31..360e831 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -7738,8 +7738,9 @@ x_new_font (struct frame *f, Lisp_Object font_object, int fontset) /* Now make the frame display the given font. */ if (FRAME_NS_WINDOW (f) != 0 && ! [view isFullscreen]) - x_set_window_size (f, false, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f), - FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), true); + adjust_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f), + FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 3, + false, Qfont); return font_object; } --------------070003080608040809090306--