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#16013: 24.3.50; Rows in height is interpreted as pixels. Date: Wed, 29 Jan 2014 11:14:13 +0100 Message-ID: <52E8D475.8070003@gmx.at> 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> <529D8F3E.30400@gmx.at> <93EF122E-7EFC-4ACF-A216-E83981DD511A@swipnet.se> <529E2441.8030808@gmx.at> <9E083836-7DF3-4AC3-8711-A0E4757C9691@swipnet.se> <01BCA22D-62F2-4F04-B14C-85452A9D1201@swipnet.se> <52D14EA5.9060900@gmx.at> <52D18361.5050308@swipnet.se> <52D2663A.3020201@gmx.at> <52D7AE74.70302@gmx.at> <225940B7-0445-4639-81EE-686AEB31DA0B@swipnet.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070102070003030907010702" X-Trace: ger.gmane.org 1390990521 13059 80.91.229.3 (29 Jan 2014 10:15:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Jan 2014 10:15:21 +0000 (UTC) Cc: "16013@debbugs.gnu.org" <16013@debbugs.gnu.org> To: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 29 11:15:25 2014 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 1W8SB2-0000tB-4I for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Jan 2014 11:15:24 +0100 Original-Received: from localhost ([::1]:41325 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8SB1-0000eu-FB for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Jan 2014 05:15:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8SAq-0000dJ-Dm for bug-gnu-emacs@gnu.org; Wed, 29 Jan 2014 05:15:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8SAh-0006T3-Br for bug-gnu-emacs@gnu.org; Wed, 29 Jan 2014 05:15:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54034) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8SAh-0006S5-26 for bug-gnu-emacs@gnu.org; Wed, 29 Jan 2014 05:15:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W8SAg-0000Z5-34 for bug-gnu-emacs@gnu.org; Wed, 29 Jan 2014 05:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Jan 2014 10:15: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.13909904672106 (code B ref 16013); Wed, 29 Jan 2014 10:15:01 +0000 Original-Received: (at 16013) by debbugs.gnu.org; 29 Jan 2014 10:14:27 +0000 Original-Received: from localhost ([127.0.0.1]:39820 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W8SA6-0000Xt-QS for submit@debbugs.gnu.org; Wed, 29 Jan 2014 05:14:27 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:51010) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W8SA4-0000Xi-0z for 16013@debbugs.gnu.org; Wed, 29 Jan 2014 05:14:25 -0500 Original-Received: from [62.47.52.118] ([62.47.52.118]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LeMWL-1VTurb3LlV-00q82d for <16013@debbugs.gnu.org>; Wed, 29 Jan 2014 11:14:23 +0100 In-Reply-To: <225940B7-0445-4639-81EE-686AEB31DA0B@swipnet.se> X-Provags-ID: V03:K0:NHblfDoQtfo99XFNH+1qHRct5Avi+BTFghL96ZkVBqwfVUxon6F jjGfLZQQRMdDF1KT7U2xhUx1FEPK4skOpmKB/6ARPHRBvH2wMa8jEiVZTUFHN0jzLrIQJG7 bLdB9rNIQyYygL8n5FkwExQYSys1JihJUZZZgFNcsHeOIRc7HhWR4YDhvz9W2MGBRjidz2r LOhNISlkkcBTjcc3g7rPg== 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:84212 Archived-At: This is a multi-part message in MIME format. --------------070102070003030907010702 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I would proceed as follows: For the release, apply the attached patch. This should give initial and subsequent frames the same size and thus resolve most issues you raised in this thread and also fix bug 14795. For Lucid/Motif/Windows the toolbar would remain part of the text area, hence the number of lines available for editing would be less than specified. I see no way to provide a safe fix for this without sufficient testing. We could increase the number of DEFAULT_ROWS for these builds though, so the default frames would retain their prior sizes. After the release I would try to change the behavior such that when a frame is created, the toolbar is not counted in the text height on these builds. Hence `default-frame-alist' would be interpreted as for the GTK build. Subsequent changes (adding/removing/wrapping) of the toolbar would not change the size of the frame but that of its text area, so in this case the behavior would differ from GTK but still be different from the prior behavior. I soon intend to implement horizontal scrollbars anyway so the necessary changes would mainly amount to something like defining: #define FRAME_TEXT_LINES_TO_PIXEL_HEIGHT(f, lines) \ ((lines) * FRAME_LINE_HEIGHT (f) \ + FRAME_TOOL_BAR_HEIGHT (f) \ + FRAME_SCROLL_BAR_AREA_HEIGHT (f) \ + 2 * FRAME_INTERNAL_BORDER_WIDTH (f)) WDYT? martin --------------070102070003030907010702 Content-Type: text/plain; name="frame-text-size.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="frame-text-size.diff" =3D=3D=3D modified file 'src/frame.c' --- src/frame.c 2014-01-11 10:01:01 +0000 +++ src/frame.c 2014-01-28 18:21:35 +0000 @@ -4244,7 +4244,10 @@ /* This used to be done _before_ calling x_figure_window_size, but since the height is reset here, this was really a no-op. I assume that moving it here does what Gerd intended (although he - no longer can remember what that was... ++KFS, 2003-03-25. */ + no longer can remember what that was... ++KFS, 2003-03-25. + + Defined out since it makes subsequent frames larger than the + initial one. See Bug#16013. martin, 2014-01-15. */ /* Add the tool-bar height to the initial frame height so that the user gets a text display area of the size he specified with -g or @@ -4252,6 +4255,7 @@ change the frame size. This is done so that users can create tall Emacs frames without having to guess how tall the tool-bar will get. */ +#if 0 if (toolbar_p && FRAME_TOOL_BAR_HEIGHT (f)) { int margin, relief, bar_height; @@ -4272,6 +4276,7 @@ bar_height =3D DEFAULT_TOOL_BAR_IMAGE_HEIGHT + 2 * margin + 2 * re= lief; FRAME_LINES (f) +=3D (bar_height + FRAME_LINE_HEIGHT (f) - 1) / FR= AME_LINE_HEIGHT (f); } +#endif compute_fringe_widths (f, 0); =3D=3D=3D modified file 'src/widget.c' --- src/widget.c 2014-01-01 07:43:34 +0000 +++ src/widget.c 2014-01-28 18:21:35 +0000 @@ -687,12 +687,18 @@ int width, height; pixel_to_text_size (ew, ew->core.width, ew->core.height, &width, &= height); - change_frame_size (f, width, height, 0, 1, 0, 1); - - update_wm_hints (ew); - update_various_frame_slots (ew); - - cancel_mouse_face (f); + if (width !=3D FRAME_TEXT_WIDTH (f) + || height !=3D FRAME_TEXT_HEIGHT (f) + || ew->core.width !=3D FRAME_PIXEL_WIDTH (f) + || ew->core.height + x->menubar_height !=3D FRAME_PIXEL_HEIGHT (f)) + { + change_frame_size (f, width, height, 0, 1, 0, 1); + + update_wm_hints (ew); + update_various_frame_slots (ew); + + cancel_mouse_face (f); + } #if 0 /* See comment above. */ } else @@ -820,12 +826,12 @@ /* Special entry points */ void -EmacsFrameSetCharSize (Widget widget, int columns, int rows) +EmacsFrameSetCharSize (Widget widget, int width, int height) { EmacsFrame ew =3D (EmacsFrame) widget; struct frame *f =3D ew->emacs_frame.frame; - x_set_window_size (f, 0, columns, rows, 0); + x_set_window_size (f, 0, width, height, 1); } =0C =3D=3D=3D modified file 'src/xmenu.c' --- src/xmenu.c 2014-01-29 08:23:59 +0000 +++ src/xmenu.c 2014-01-29 09:09:51 +0000 @@ -682,7 +682,7 @@ xg_update_frame_menubar (f); #else struct x_output *x; - int columns, rows; + int width, height; eassert (FRAME_X_P (f)); @@ -694,8 +694,8 @@ block_input (); /* Save the size of the frame because the pane widget doesn't accept to resize itself. So force it. */ - columns =3D FRAME_COLS (f); - rows =3D FRAME_LINES (f); + width =3D FRAME_TEXT_WIDTH (f); + height =3D FRAME_TEXT_HEIGHT (f); /* Do the voodoo which means "I'm changing lots of things, don't try to refigure sizes until I'm done." */ @@ -717,7 +717,7 @@ lw_refigure_widget (x->column_widget, True); /* Force the pane widget to resize itself with the right values. */ - EmacsFrameSetCharSize (x->edit_widget, columns, rows); + EmacsFrameSetCharSize (x->edit_widget, width, height); unblock_input (); #endif } =3D=3D=3D modified file 'src/xterm.c' --- src/xterm.c 2014-01-26 12:17:55 +0000 +++ src/xterm.c 2014-01-28 18:21:35 +0000 @@ -8573,21 +8573,26 @@ compute_fringe_widths (f, 0); - pixelwidth =3D ((pixelwise - ? FRAME_TEXT_TO_PIXEL_WIDTH (f, width) - : FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width)) - + FRAME_TOOLBAR_WIDTH (f)); - pixelheight =3D ((pixelwise - ? FRAME_TEXT_TO_PIXEL_HEIGHT (f, height) - : FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height)) - + FRAME_MENUBAR_HEIGHT (f) - + FRAME_TOOLBAR_HEIGHT (f)); + pixelwidth =3D (pixelwise + ? FRAME_TEXT_TO_PIXEL_WIDTH (f, width) + : FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, width)); + pixelheight =3D (pixelwise + ? FRAME_TEXT_TO_PIXEL_HEIGHT (f, height) + : FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height)); + +#if defined (USE_LUCID) || defined (USE_MOTIF) + { + struct x_output *x =3D f->output_data.x; + + pixelheight +=3D x->menubar_height; + } +#endif + if (change_gravity) f->win_gravity =3D NorthWestGravity; x_wm_set_size_hint (f, (long) 0, 0); XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), pixelwidth, pixelheight); - /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to receive in the ConfigureNotify event; if we get what we asked for, then the event won't cause the screen to become garbaged, so --------------070102070003030907010702--