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#19619: 25.0.50; Fullheight frames in daemonized emacsen are wrong width Date: Fri, 16 Jan 2015 18:55:25 +0100 Message-ID: <54B9508D.8040609@gmx.at> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000105050803060908090808" X-Trace: ger.gmane.org 1421430981 12506 80.91.229.3 (16 Jan 2015 17:56:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Jan 2015 17:56:21 +0000 (UTC) To: mwd@cert.org, 19619@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 16 18:56:17 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 1YCB81-0004uN-3e for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Jan 2015 18:56:13 +0100 Original-Received: from localhost ([::1]:56811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCB80-0004Wl-Hq for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Jan 2015 12:56:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCB7v-0004WV-S2 for bug-gnu-emacs@gnu.org; Fri, 16 Jan 2015 12:56:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCB7q-00073T-Ob for bug-gnu-emacs@gnu.org; Fri, 16 Jan 2015 12:56:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50660) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCB7q-00073P-Ku for bug-gnu-emacs@gnu.org; Fri, 16 Jan 2015 12:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YCB7q-0003m7-Cv for bug-gnu-emacs@gnu.org; Fri, 16 Jan 2015 12:56: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: Fri, 16 Jan 2015 17:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19619 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Michael Welsh Duggan , bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.142143095414496 (code B ref -1); Fri, 16 Jan 2015 17:56:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Jan 2015 17:55:54 +0000 Original-Received: from localhost ([127.0.0.1]:59521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YCB7i-0003lj-5Q for submit@debbugs.gnu.org; Fri, 16 Jan 2015 12:55:54 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:47137) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YCB7f-0003lU-Jo for submit@debbugs.gnu.org; Fri, 16 Jan 2015 12:55:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCB7Y-00072P-O3 for submit@debbugs.gnu.org; Fri, 16 Jan 2015 12:55:46 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:32902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCB7Y-00072L-JC for submit@debbugs.gnu.org; Fri, 16 Jan 2015 12:55:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCB7X-0004VV-2N for bug-gnu-emacs@gnu.org; Fri, 16 Jan 2015 12:55:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCB7R-00071S-HI for bug-gnu-emacs@gnu.org; Fri, 16 Jan 2015 12:55:42 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:53554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCB7Q-000716-Tn for bug-gnu-emacs@gnu.org; Fri, 16 Jan 2015 12:55:37 -0500 Original-Received: from [178.189.200.61] ([178.189.200.61]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MDyFr-1XyBh33pIl-00HPOw; Fri, 16 Jan 2015 18:55:35 +0100 In-Reply-To: X-Provags-ID: V03:K0:q7unizGIZDKm4FguADbJRAgQbwvSKiBSvB/vULovDvvzorcWXMK A7v92LP9quZNzslimiy56Pe7sCA2vnnxGYCBq+xtl2xTyQ9fkM5+kK8N1yhZh1nAP1I/35S o4qtiOb9D9PCSPUupL9oY6Y1+1jmGlIeOOOu0qoDiyAm0eh8SCDKx/zTB5ca4nNcNCcDCUe arwqzvvgVdEjOSKsrN/Hw== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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:98425 Archived-At: This is a multi-part message in MIME format. --------------000105050803060908090808 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit > echo "(setq default-frame-alist '((fullscreen . fullheight)))" > /tmp/foo.el > emacs -Q --daemon -l /tmp/foo.el > emacsclient -c -n > > Using the above recipe, I get a frame width of 78 characters instead of > 80 characters. The information from (window--frame-dump) is as follows: Thanks. I haven't looked into your recipe yet. Does the attached patch improve anything? If it doesn't apply right away just tell me and don't bother any further. I'm working on this problem currently and have found a couple of related issues. martin --------------000105050803060908090808 Content-Type: text/plain; charset=windows-1252; name="fullscreen.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fullscreen.diff" diff --git a/lisp/frame.el b/lisp/frame.el index 1d5bbf2..c18e4be 100644 --- a/src/frame.c +++ b/src/frame.c @@ -152,10 +152,13 @@ get_frame_param (register struct frame *frame, Lisp_Object prop) bool frame_inhibit_resize (struct frame *f, bool horizontal, Lisp_Object parameter) { + Lisp_Object fullscreen = get_frame_param (f, Qfullscreen); + return (EQ (frame_inhibit_implied_resize, Qt) || (CONSP (frame_inhibit_implied_resize) && !NILP (Fmemq (parameter, frame_inhibit_implied_resize))) - || !NILP (get_frame_param (f, Qfullscreen)) + || (horizontal && !EQ (fullscreen, Qnil) && !EQ (fullscreen, Qfullheight)) + || (!horizontal && !EQ (fullscreen, Qnil) && !EQ (fullscreen, Qfullwidth)) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)); } @@ -1009,7 +1012,8 @@ affects all frames on the same terminal device. */) { int width, height; get_tty_size (fileno (FRAME_TTY (f)->input), &width, &height); - adjust_frame_size (f, width, height - FRAME_MENU_BAR_LINES (f), 5, 0, Qnil); + adjust_frame_size (f, width, height - FRAME_MENU_BAR_LINES (f), + 5, 0, Qterminal_frame); } adjust_frame_glyphs (f); @@ -3207,14 +3211,14 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist) that here since otherwise a size change implied by an intermittent font change may get lost as in Bug#17142. */ if (!width_change) - width = (f->new_width + width = ((f->can_x_set_window_size && f->new_width) ? (f->new_pixelwise ? f->new_width : (f->new_width * FRAME_COLUMN_WIDTH (f))) : FRAME_TEXT_WIDTH (f)); if (!height_change) - height = (f->new_height + height = ((f->can_x_set_window_size && f->new_height) ? (f->new_pixelwise ? f->new_height : (f->new_height * FRAME_LINE_HEIGHT (f))) @@ -4828,6 +4832,8 @@ syms_of_frame (void) DEFSYM (Qset_window_configuration, "set-window-configuration"); DEFSYM (Qx_create_frame_1, "x-create-frame-1"); DEFSYM (Qx_create_frame_2, "x-create-frame-2"); + DEFSYM (Qtip_frame, "tip-frame"); + DEFSYM (Qterminal_frame, "terminal-frame"); #ifdef HAVE_NS DEFSYM (Qns_parse_geometry, "ns-parse-geometry"); diff --git a/src/w32fns.c b/src/w32fns.c index 2dd92ff..1db47f2 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -1745,7 +1745,8 @@ x_change_tool_bar_height (struct frame *f, int height) f->n_tool_bar_rows = 0; adjust_frame_size (f, -1, -1, - (!f->tool_bar_redisplayed_once ? 1 + ((!f->tool_bar_redisplayed_once + && NILP (get_frame_param (f, Qfullscreen))) ? 1 : (old_height == 0 || height == 0) ? 2 : 4), 0, Qtool_bar_lines); @@ -5786,7 +5787,7 @@ x_create_tip_frame (struct w32_display_info *dpyinfo, SET_FRAME_COLS (f, 0); SET_FRAME_LINES (f, 0); adjust_frame_size (f, width * FRAME_COLUMN_WIDTH (f), - height * FRAME_LINE_HEIGHT (f), 0, 1, Qnil); + height * FRAME_LINE_HEIGHT (f), 0, 1, Qtip_frame); /* Add `tooltip' frame parameter's default value. */ if (NILP (Fframe_parameter (frame, Qtooltip))) diff --git a/src/xfns.c b/src/xfns.c index 936c769..c1a9e6c 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1079,7 +1079,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) void x_change_tool_bar_height (struct frame *f, int height) { -#ifdef USE_GTK +#if defined (USE_GTK) || defined (HAVE_NS) FRAME_TOOL_BAR_LINES (f) = 0; FRAME_TOOL_BAR_HEIGHT (f) = 0; if (height) @@ -1100,6 +1100,7 @@ x_change_tool_bar_height (struct frame *f, int height) int unit = FRAME_LINE_HEIGHT (f); int old_height = FRAME_TOOL_BAR_HEIGHT (f); int lines = (height + unit - 1) / unit; + Lisp_Object fullscreen; /* Make sure we redisplay all windows in this frame. */ windows_or_buffers_changed = 60; @@ -1131,7 +1132,10 @@ x_change_tool_bar_height (struct frame *f, int height) f->n_tool_bar_rows = 0; adjust_frame_size (f, -1, -1, - (!f->tool_bar_redisplayed_once ? 1 + ((!f->tool_bar_redisplayed_once + && (NILP (fullscreen = + get_frame_param (f, Qfullscreen)) + || EQ (fullscreen, Qfullwidth))) ? 1 : (old_height == 0 || height == 0) ? 2 : 4), 0, Qtool_bar_lines); diff --git a/src/xterm.c b/src/xterm.c index 3955d02..971f342 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -9343,13 +9343,22 @@ x_check_fullscreen (struct frame *f) break; case FULLSCREEN_WIDTH: width = x_display_pixel_width (dpyinfo); - break; + height = height + FRAME_MENUBAR_HEIGHT (f); + break; case FULLSCREEN_HEIGHT: height = x_display_pixel_height (dpyinfo); } XResizeWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), width, height); + + if (FRAME_VISIBLE_P (f)) + x_wait_for_event (f, ConfigureNotify); + else + { + change_frame_size (f, width, height, false, true, false, true); + x_sync (f); + } } } --------------000105050803060908090808--