From: martin rudalics <rudalics@gmx.at>
To: "Jan Djärv" <jan.h.d@swipnet.se>
Cc: "16013@debbugs.gnu.org" <16013@debbugs.gnu.org>
Subject: bug#16013: 24.3.50; Rows in height is interpreted as pixels.
Date: Mon, 09 Dec 2013 19:26:38 +0100 [thread overview]
Message-ID: <52A60B5E.5020603@gmx.at> (raw)
In-Reply-To: <52A36085.4000608@swipnet.se>
[-- Attachment #1: Type: text/plain, Size: 188 bytes --]
I now managed to get the correct number of lines here with
the attached patch. Tested with GTK3, Lucid and without
xtoolkit. Not tested with Motif. Please have a look.
Thanks, martin
[-- Attachment #2: frame-height.diff --]
[-- Type: text/plain, Size: 4978 bytes --]
martin@NOREST:~/emacs/quickfixes$ bzr diff
=== modified file 'src/dispnew.c'
--- src/dispnew.c 2013-11-30 09:25:31 +0000
+++ src/dispnew.c 2013-12-09 10:20:26 +0000
@@ -5535,6 +5535,10 @@
manipulating video hardware. */
if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
FrameRows (FRAME_TTY (f)) = new_height;
+
+ FRAME_LINES (f) = new_lines;
+ FRAME_TEXT_HEIGHT (f) = new_text_height;
+ FRAME_PIXEL_HEIGHT (f) = FRAME_TEXT_TO_PIXEL_HEIGHT (f, new_text_height);
}
if (new_text_width != FRAME_TEXT_WIDTH (f)
@@ -5547,6 +5551,10 @@
if ((FRAME_TERMCAP_P (f) && !pretend) || FRAME_MSDOS_P (f))
FrameCols (FRAME_TTY (f)) = new_cols;
+ SET_FRAME_COLS (f, new_cols);
+ FRAME_TEXT_WIDTH (f) = new_text_width;
+ FRAME_PIXEL_WIDTH (f) = FRAME_TEXT_TO_PIXEL_WIDTH (f, new_text_width);
+
#if defined (HAVE_WINDOW_SYSTEM) && ! defined (USE_GTK) && ! defined (HAVE_NS)
if (WINDOWP (f->tool_bar_window))
{
@@ -5556,13 +5564,6 @@
#endif
}
- SET_FRAME_COLS (f, new_cols);
- FRAME_LINES (f) = new_lines;
- FRAME_TEXT_WIDTH (f) = new_text_width;
- FRAME_TEXT_HEIGHT (f) = new_text_height;
- FRAME_PIXEL_WIDTH (f) = FRAME_TEXT_TO_PIXEL_WIDTH (f, new_text_width);
- FRAME_PIXEL_HEIGHT (f) = FRAME_TEXT_TO_PIXEL_HEIGHT (f, new_text_height);
-
{
struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f));
int text_area_x, text_area_y, text_area_width, text_area_height;
=== modified file 'src/window.c'
--- src/window.c 2013-12-08 03:07:11 +0000
+++ src/window.c 2013-12-09 17:25:35 +0000
@@ -4056,7 +4056,8 @@
r->top_line = FRAME_TOP_MARGIN (f);
r->pixel_top = FRAME_TOP_MARGIN_HEIGHT (f);
- if (new_pixel_size == old_pixel_size)
+ if (new_pixel_size == old_pixel_size
+ && XWINDOW (mini)->pixel_height == FRAME_LINE_HEIGHT (f))
return;
else if (WINDOW_LEAF_P (r))
/* For a leaf root window just set the size. */
=== modified file 'src/xfns.c'
--- src/xfns.c 2013-12-03 17:22:05 +0000
+++ src/xfns.c 2013-12-09 17:34:22 +0000
@@ -3069,7 +3069,6 @@
happen. */
init_frame_faces (f);
-#ifdef USE_GTK
/* PXW: This is a duplicate from below. We have to do it here since
otherwise x_set_tool_bar_lines will work with the character sizes
installed by init_frame_faces while the frame's pixel size is still
@@ -3078,12 +3077,8 @@
non-pixelwise code apparently worked around this because it had one
frame line vs one toolbar line which left us with a zero root
window height which was obviously wrong as well ... */
- width = FRAME_TEXT_WIDTH (f);
- height = FRAME_TEXT_HEIGHT (f);
- FRAME_TEXT_HEIGHT (f) = 0;
- SET_FRAME_WIDTH (f, 0);
- change_frame_size (f, width, height, 1, 0, 0, 1);
-#endif /* USE_GTK */
+ change_frame_size (f, FRAME_COLS (f) * FRAME_COLUMN_WIDTH (f),
+ FRAME_LINES (f) * FRAME_LINE_HEIGHT (f), 1, 0, 0, 1);
/* Set the menu-bar-lines and tool-bar-lines parameters. We don't
look up the X resources controlling the menu-bar and tool-bar
=== modified file 'src/xterm.c'
--- src/xterm.c 2013-12-07 23:04:10 +0000
+++ src/xterm.c 2013-12-09 17:39:28 +0000
@@ -6622,8 +6622,8 @@
cancel_mouse_face (f);
}
- FRAME_PIXEL_WIDTH (f) = event->xconfigure.width;
- FRAME_PIXEL_HEIGHT (f) = event->xconfigure.height;
+/** FRAME_PIXEL_WIDTH (f) = event->xconfigure.width; **/
+/** FRAME_PIXEL_HEIGHT (f) = event->xconfigure.height; **/
#endif /* not USE_GTK */
#endif
@@ -7689,6 +7689,9 @@
FRAME_COLUMN_WIDTH (f) = font->average_width;
FRAME_LINE_HEIGHT (f) = FONT_HEIGHT (font);
+ FRAME_TOOL_BAR_HEIGHT (f) = FRAME_TOOL_BAR_LINES (f) * FRAME_LINE_HEIGHT (f);
+ FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f);
+
compute_fringe_widths (f, 1);
/* Compute the scroll bar width in character columns. */
@@ -8541,13 +8544,15 @@
compute_fringe_widths (f, 0);
- pixelwidth =
- (pixelwise ? width : FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width))
- + FRAME_TOOLBAR_WIDTH (f);
- pixelheight =
- (pixelwise ? height : FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height))
- + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
-
+ pixelwidth = ((pixelwise
+ ? FRAME_TEXT_TO_PIXEL_WIDTH (f, width)
+ : FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width))
+ + FRAME_TOOLBAR_WIDTH (f));
+ pixelheight = ((pixelwise
+ ? FRAME_TEXT_TO_PIXEL_HEIGHT (f, height)
+ : FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height))
+ + FRAME_MENUBAR_HEIGHT (f)
+ + FRAME_TOOLBAR_HEIGHT (f));
if (change_gravity) f->win_gravity = NorthWestGravity;
x_wm_set_size_hint (f, (long) 0, 0);
XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
@@ -8582,8 +8587,6 @@
else
{
change_frame_size (f, width, height, 0, 1, 0, 1);
- FRAME_PIXEL_WIDTH (f) = pixelwidth;
- FRAME_PIXEL_HEIGHT (f) = pixelheight;
x_sync (f);
}
}
martin@NOREST:~/emacs/quickfixes$
next prev parent reply other threads:[~2013-12-09 18:26 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-30 13:08 bug#16013: 24.3.50; Rows in height is interpreted as pixels Jan Djärv
2013-11-30 15:00 ` martin rudalics
2013-11-30 18:52 ` Jan Djärv
2013-12-01 9:44 ` martin rudalics
2013-12-01 10:01 ` Jan Djärv
2013-12-01 11:24 ` martin rudalics
2013-12-01 12:02 ` Jan Djärv
2013-12-02 18:15 ` martin rudalics
2013-12-02 22:03 ` Stephen Berman
2013-12-03 7:56 ` martin rudalics
2013-12-03 9:13 ` Stephen Berman
2013-12-03 18:34 ` martin rudalics
2013-12-03 20:02 ` Stephen Berman
2013-12-03 7:53 ` Jan Djärv
2013-12-03 7:58 ` martin rudalics
2013-12-03 16:30 ` Jan Djärv
2013-12-03 18:34 ` martin rudalics
2013-12-03 19:30 ` Jan Djärv
2013-12-03 19:45 ` Jan Djärv
2013-12-04 18:06 ` martin rudalics
2013-12-07 17:53 ` Jan Djärv
2013-12-07 18:09 ` martin rudalics
2013-12-09 18:26 ` martin rudalics [this message]
2014-01-11 14:01 ` martin rudalics
2014-01-11 17:46 ` Jan Djärv
2014-01-12 9:54 ` martin rudalics
2014-01-12 11:13 ` Jan Djärv
2014-01-12 11:46 ` martin rudalics
2014-01-12 20:25 ` Stefan Monnier
2014-01-12 22:21 ` Jan Djärv
2014-01-14 17:30 ` Jan Djärv
2014-01-14 18:10 ` martin rudalics
2014-01-16 10:03 ` martin rudalics
2014-01-16 10:14 ` martin rudalics
2014-01-18 11:30 ` Jan Djärv
2014-01-18 12:07 ` martin rudalics
2014-01-29 10:14 ` martin rudalics
2020-09-09 13:07 ` Lars Ingebrigtsen
2020-09-09 14:46 ` Eli Zaretskii
2020-09-10 12:40 ` Lars Ingebrigtsen
2013-12-04 18:06 ` martin rudalics
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=52A60B5E.5020603@gmx.at \
--to=rudalics@gmx.at \
--cc=16013@debbugs.gnu.org \
--cc=jan.h.d@swipnet.se \
/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.