From: martin rudalics <rudalics@gmx.at>
To: Keith David Bershatsky <esq@lawlist.com>
Cc: 21415@debbugs.gnu.org
Subject: bug#21415: 25.0.50; Emacs Trunk -- pixelwise width/height for x-create-frame
Date: Thu, 10 Sep 2015 08:57:25 +0200 [thread overview]
Message-ID: <55F129D5.4090605@gmx.at> (raw)
In-Reply-To: <m2oahb6qys.wl%esq@lawlist.com>
[-- Attachment #1: Type: text/plain, Size: 2963 bytes --]
> 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 ‘frame-inhibit-implied-resize’ 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-iso10646-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
[-- Attachment #2: Keith.diff --]
[-- Type: text/plain, Size: 2719 bytes --]
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;
}
next prev parent reply other threads:[~2015-09-10 6:57 UTC|newest]
Thread overview: 141+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 17:41 bug#21415: 25.0.50; Emacs Trunk -- pixelwise width/height for x-create-frame Keith David Bershatsky
2015-09-04 19:17 ` martin rudalics
2015-09-05 0:31 ` Keith David Bershatsky
2015-09-05 9:59 ` martin rudalics
2015-09-06 17:18 ` Keith David Bershatsky
2015-09-06 19:26 ` martin rudalics
2015-09-06 17:56 ` Keith David Bershatsky
2015-09-06 19:26 ` martin rudalics
2015-09-06 22:01 ` Keith David Bershatsky
2015-09-07 7:05 ` martin rudalics
2015-09-07 17:53 ` Keith David Bershatsky
2015-09-08 8:29 ` martin rudalics
2015-09-08 16:13 ` Keith David Bershatsky
2015-09-08 19:22 ` martin rudalics
2015-09-09 0:38 ` Keith David Bershatsky
2015-09-09 6:27 ` martin rudalics
2015-09-09 14:30 ` Keith David Bershatsky
2015-09-09 15:53 ` martin rudalics
2015-09-09 16:26 ` Keith David Bershatsky
2015-09-09 17:11 ` martin rudalics
2015-09-10 0:46 ` Keith David Bershatsky
2015-09-10 6:57 ` martin rudalics [this message]
2015-09-10 18:39 ` Keith David Bershatsky
2015-09-12 11:11 ` martin rudalics
2015-09-12 19:57 ` Anders Lindgren
2015-09-13 9:02 ` martin rudalics
2015-09-12 11:12 ` martin rudalics
2015-09-12 18:11 ` Keith David Bershatsky
2015-09-12 23:09 ` Keith David Bershatsky
2015-09-13 9:02 ` martin rudalics
2015-09-12 23:13 ` Keith David Bershatsky
2015-09-13 7:10 ` Anders Lindgren
2015-09-13 9:02 ` martin rudalics
2015-09-13 16:17 ` Keith David Bershatsky
2015-09-13 18:01 ` martin rudalics
[not found] ` <CABr8ebYkM02NHh9BeU8tNfw0=eMtqJfQALAhN17VfOQtzfq9CQ@mail.gmail.com>
2015-09-13 20:21 ` bug#21415: Fwd: " Anders Lindgren
[not found] ` <55F6860D.9060503@gmx.at>
2015-09-14 9:37 ` Anders Lindgren
2015-09-14 13:39 ` martin rudalics
2015-09-14 14:45 ` Anders Lindgren
2015-09-14 17:37 ` martin rudalics
2015-09-14 19:03 ` Anders Lindgren
2015-09-15 8:29 ` martin rudalics
2015-09-19 21:12 ` Anders Lindgren
2015-09-19 22:17 ` martin rudalics
2015-09-20 7:25 ` Anders Lindgren
2015-09-20 8:44 ` martin rudalics
2015-09-20 9:27 ` Anders Lindgren
2015-09-20 9:54 ` martin rudalics
2015-09-20 18:29 ` Anders Lindgren
2015-09-21 9:42 ` martin rudalics
2015-09-13 18:36 ` Keith David Bershatsky
2015-09-14 8:31 ` martin rudalics
2015-09-14 8:32 ` martin rudalics
2015-09-13 18:53 ` Keith David Bershatsky
2015-09-14 15:25 ` Keith David Bershatsky
2015-09-14 17:37 ` martin rudalics
2015-09-20 16:47 ` Keith David Bershatsky
2015-09-20 18:31 ` Anders Lindgren
2015-09-21 9:43 ` martin rudalics
2015-09-21 18:56 ` Anders Lindgren
2015-09-22 6:38 ` martin rudalics
2015-09-22 8:54 ` Anders Lindgren
2015-09-22 9:36 ` martin rudalics
2015-09-27 18:53 ` Anders Lindgren
2015-09-28 6:48 ` martin rudalics
2015-09-28 21:35 ` Anders Lindgren
2015-09-29 7:23 ` martin rudalics
2015-09-29 7:50 ` Eli Zaretskii
2015-09-30 17:54 ` Anders Lindgren
2015-09-30 18:57 ` martin rudalics
2015-09-30 21:29 ` Anders Lindgren
2015-10-02 8:37 ` martin rudalics
2015-10-03 6:16 ` Anders Lindgren
2015-10-03 8:32 ` martin rudalics
2015-09-20 19:14 ` Keith David Bershatsky
2015-09-28 14:32 ` Keith David Bershatsky
2015-09-28 15:31 ` martin rudalics
2015-09-28 17:49 ` Keith David Bershatsky
2015-09-28 18:00 ` martin rudalics
2015-09-28 18:13 ` Keith David Bershatsky
2015-09-29 7:22 ` martin rudalics
2015-09-29 17:09 ` Keith David Bershatsky
2015-09-29 17:14 ` martin rudalics
2015-10-01 6:43 ` Keith David Bershatsky
2015-10-02 8:37 ` martin rudalics
2015-10-03 11:28 ` Andy Moreton
2015-10-03 12:31 ` martin rudalics
2015-10-05 21:02 ` Andy Moreton
2015-10-06 7:57 ` martin rudalics
2015-10-07 3:42 ` Keith David Bershatsky
2015-10-13 10:21 ` martin rudalics
2015-10-13 17:23 ` Keith David Bershatsky
2015-10-13 17:59 ` Anders Lindgren
2015-10-14 8:49 ` martin rudalics
2015-10-14 15:58 ` Keith David Bershatsky
2015-10-14 17:37 ` martin rudalics
2015-10-14 21:53 ` Anders Lindgren
2015-10-15 10:00 ` martin rudalics
2015-10-20 17:20 ` Anders Lindgren
2015-10-21 8:02 ` martin rudalics
2015-10-21 16:07 ` martin rudalics
2015-10-22 14:54 ` Anders Lindgren
2015-10-22 15:35 ` martin rudalics
2015-10-23 9:13 ` Anders Lindgren
2015-10-23 18:00 ` martin rudalics
2015-10-24 15:33 ` Anders Lindgren
2015-10-24 18:57 ` martin rudalics
2015-10-24 21:43 ` Anders Lindgren
2015-10-27 21:42 ` Anders Lindgren
2015-10-28 7:54 ` Anders Lindgren
2015-10-28 9:55 ` martin rudalics
2015-10-28 11:25 ` Anders Lindgren
2015-10-28 19:19 ` martin rudalics
2015-10-29 22:53 ` Anders Lindgren
2015-10-30 7:59 ` martin rudalics
2015-10-30 8:10 ` martin rudalics
2015-10-30 9:00 ` Anders Lindgren
2015-10-30 9:34 ` martin rudalics
2015-10-30 10:18 ` Anders Lindgren
2015-10-28 9:54 ` martin rudalics
2015-10-14 20:34 ` Keith David Bershatsky
2015-10-15 9:59 ` martin rudalics
2015-10-21 1:03 ` Keith David Bershatsky
2015-10-21 2:07 ` Anders Lindgren
2015-10-29 2:47 ` Keith David Bershatsky
2015-11-14 19:42 ` Anders Lindgren
2015-11-01 16:53 ` Keith David Bershatsky
2015-11-01 21:08 ` Anders Lindgren
2015-11-02 5:18 ` Keith David Bershatsky
2015-11-02 20:50 ` Anders Lindgren
2015-11-03 6:29 ` Keith David Bershatsky
2015-11-03 8:54 ` Anders Lindgren
2015-11-04 2:21 ` Keith David Bershatsky
2015-11-04 5:53 ` Anders Lindgren
2015-11-16 3:06 ` Keith David Bershatsky
2015-11-16 9:11 ` Anders Lindgren
2020-09-17 17:53 ` Lars Ingebrigtsen
2015-11-16 3:16 ` Keith David Bershatsky
2015-11-16 7:54 ` Anders Lindgren
2015-11-16 17:25 ` Keith David Bershatsky
2015-11-16 23:52 ` Keith David Bershatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55F129D5.4090605@gmx.at \
--to=rudalics@gmx.at \
--cc=21415@debbugs.gnu.org \
--cc=esq@lawlist.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.