From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Newsgroups: gmane.emacs.bugs Subject: bug#16013: 24.3.50; Rows in height is interpreted as pixels. Date: Tue, 3 Dec 2013 08:53:08 +0100 Message-ID: References: <5579FC36-5F75-4679-87F6-048C5B7326F6@swipnet.se> <5299FD88.2090600@gmx.at> <529A33F4.5030606@swipnet.se> <529B0519.3010902@gmx.at> <529B1C71.9020707@gmx.at> <529CCE48.9090404@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1386057259 21005 80.91.229.3 (3 Dec 2013 07:54:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Dec 2013 07:54:19 +0000 (UTC) Cc: "16013@debbugs.gnu.org" <16013@debbugs.gnu.org> To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 03 08:54:22 2013 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 1VnkoI-000358-5T for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Dec 2013 08:54:22 +0100 Original-Received: from localhost ([::1]:40667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VnkoH-0005Dc-L5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 03 Dec 2013 02:54:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnko8-0005Bh-F3 for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2013 02:54:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vnknz-0006nR-2c for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2013 02:54:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vnkny-0006nK-Vg for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2013 02:54:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vnkny-0003Z2-1y for bug-gnu-emacs@gnu.org; Tue, 03 Dec 2013 02:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Dec 2013 07:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16013 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16013-submit@debbugs.gnu.org id=B16013.138605720713621 (code B ref 16013); Tue, 03 Dec 2013 07:54:01 +0000 Original-Received: (at 16013) by debbugs.gnu.org; 3 Dec 2013 07:53:27 +0000 Original-Received: from localhost ([127.0.0.1]:55435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VnknO-0003XZ-3d for submit@debbugs.gnu.org; Tue, 03 Dec 2013 02:53:27 -0500 Original-Received: from mailfe05.swip.net ([212.247.154.129]:53583 helo=swip.net) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VnknH-0003X4-MW for 16013@debbugs.gnu.org; Tue, 03 Dec 2013 02:53:21 -0500 X-T2-Spam-Status: No, hits=0.0 required=5.0 tests=MIME_QP_LONG_LINE Original-Received: from hosdjarv.se (account mj138573@tele2.se [46.59.42.57] verified) by mailfe05.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 452928028; Tue, 03 Dec 2013 08:53:10 +0100 Original-Received: from [172.16.2.171] (unknown [176.57.193.190]) (Authenticated sender: jhd) by hosdjarv.se (Postfix) with ESMTPSA id 76D851A0235; Tue, 3 Dec 2013 07:53:10 +0000 (UTC) In-Reply-To: <529CCE48.9090404@gmx.at> X-Mailer: iPhone Mail (11B554a) 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: 140.186.70.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:81285 Archived-At: Hello.=20 > 2 dec 2013 kl. 19:15 skrev martin rudalics : >=20 > >> (/ (frame-text-height) (frame-char-height)) > > > > 47. > > > >> (/ (frame-text-width) (frame-char-width)) > > > > This is a bit random. On 5 starts, I got 79 once, 83 once and 84 three t= imes. > > And the number of columns match, 79, 83 and 84. >=20 > My old patch was silly - it propagated the frame's pixel sizes instead > of the text sizes to xg_frame_set_char_size. Please try the attached > one. I still have two problems here: The height of the initial frame is > by six lines too small and a new frame made via C-x 5 2 is two lines > higher than the initial one. Why not check in the patch at once instead of posting it here? The current trunk is unusable, so it must be an improvement.=20 Also, did you test on the other X variants, i.e. Lucid, Motif and no toolkit= ? This seems it only affects Gtk+.. Jan D.=20 >=20 > Thanks, martin > =3D=3D=3D modified file 'src/gtkutil.c' > --- src/gtkutil.c 2013-11-30 09:25:31 +0000 > +++ src/gtkutil.c 2013-12-02 16:39:10 +0000 > @@ -940,26 +940,12 @@ > void > xg_frame_set_char_size (struct frame *f, int width, int height) > { > - int pixelwidth; > + int pixelwidth =3D FRAME_TEXT_TO_PIXEL_WIDTH (f, width); > int pixelheight =3D FRAME_TEXT_TO_PIXEL_HEIGHT (f, height); >=20 > if (FRAME_PIXEL_HEIGHT (f) =3D=3D 0) > return; >=20 > - /* Take into account the size of the scroll bar. Always use the > - number of columns occupied by the scroll bar here otherwise we > - might end up with a frame width that is not a multiple of the > - frame's character width which is bad for vertically split > - windows. */ > - f->scroll_bar_actual_width > - =3D FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f); > - > - compute_fringe_widths (f, 0); > - > - /* FRAME_TEXT_COLS_TO_PIXEL_WIDTH uses scroll_bar_actual_width, so call= it > - after calculating that value. */ > - pixelwidth =3D FRAME_TEXT_TO_PIXEL_WIDTH (f, width); > - > /* Do this before resize, as we don't know yet if we will be resized. *= / > xg_clear_under_internal_border (f); >=20 > @@ -987,11 +973,7 @@ > x_wait_for_event (f, ConfigureNotify); > } > else > - { > - change_frame_size (f, width, height, 0, 1, 0, 1); > - FRAME_PIXEL_WIDTH (f) =3D pixelwidth; > - FRAME_PIXEL_HEIGHT (f) =3D pixelheight; > - } > + change_frame_size (f, width, height, 0, 1, 0, 1); > } >=20 > /* Handle height/width changes (i.e. add/remove/move menu/toolbar). > @@ -1095,7 +1077,7 @@ > && FRAME_X_DISPLAY (f) =3D=3D dpy) > { > x_set_scroll_bar_default_width (f); > - xg_frame_set_char_size (f, FRAME_COLS (f), FRAME_LINES (f))= ; > + xg_frame_set_char_size (f, FRAME_TEXT_WIDTH (f), FRAME_TEXT= _HEIGHT (f)); > } > } > } >=20 > =3D=3D=3D modified file 'src/gtkutil.h' > --- src/gtkutil.h 2013-09-17 07:06:42 +0000 > +++ src/gtkutil.h 2013-12-02 15:49:38 +0000 > @@ -139,7 +139,7 @@ > extern void xg_frame_resized (struct frame *f, > int pixelwidth, > int pixelheight); > -extern void xg_frame_set_char_size (struct frame *f, int cols, int rows);= > +extern void xg_frame_set_char_size (struct frame *f, int width, int heigh= t); > extern GtkWidget * xg_win_to_widget (Display *dpy, Window wdesc); >=20 > extern void xg_display_open (char *display_name, Display **dpy); >=20 > =3D=3D=3D modified file 'src/xfns.c' > --- src/xfns.c 2013-11-30 09:25:31 +0000 > +++ src/xfns.c 2013-12-02 14:36:33 +0000 > @@ -3069,6 +3069,20 @@ > happen. */ > init_frame_faces (f); >=20 > + /* 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 > + calculated from a character size of 1 and we subsequently hit the > + eassert (height >=3D 0) assertion in window_box_height. The > + 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 =3D FRAME_TEXT_WIDTH (f); > + height =3D FRAME_TEXT_HEIGHT (f); > + FRAME_TEXT_HEIGHT (f) =3D 0; > + SET_FRAME_WIDTH (f, 0); > + change_frame_size (f, width, height, 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 > here; they are processed specially at startup, and reflected in >=20 > =3D=3D=3D modified file 'src/xterm.c' > --- src/xterm.c 2013-11-30 16:25:51 +0000 > +++ src/xterm.c 2013-12-02 17:16:35 +0000 > @@ -8745,6 +8745,8 @@ > { > block_input (); >=20 > + check_frame_size (f, &width, &height, pixelwise); > + > if (NILP (tip_frame) || XFRAME (tip_frame) !=3D f) > { > int text_width, text_height; > @@ -8771,14 +8773,20 @@ > change_frame_size (f, text_width, text_height, 0, 1, 0, 1); > } >=20 > + if (! pixelwise) > + { > + width =3D width * FRAME_COLUMN_WIDTH (f); > + height =3D height * FRAME_LINE_HEIGHT (f); > + } > + > #ifdef USE_GTK > if (FRAME_GTK_WIDGET (f)) > xg_frame_set_char_size (f, width, height); > else > - x_set_window_size_1 (f, change_gravity, width, height, pixelwise); > + x_set_window_size_1 (f, change_gravity, width, height, 1); > #else /* not USE_GTK */ >=20 > - x_set_window_size_1 (f, change_gravity, width, height, pixelwise); > + x_set_window_size_1 (f, change_gravity, width, height, 1); >=20 > #endif /* not USE_GTK */ >=20 >=20