From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: set-frame-height glitch [Was: Re: Changes in frame/window code] Date: Wed, 23 Jul 2014 17:36:15 +0200 Message-ID: <53CFD66F.2020302@gmx.at> References: <53CE6A44.1010708@gmx.at> <53CF9245.7080209@yandex.ru> <53CFAF00.5080705@gmx.at> <53CFCF26.2040105@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1406129851 10542 80.91.229.3 (23 Jul 2014 15:37:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Jul 2014 15:37:31 +0000 (UTC) Cc: emacs-devel To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 23 17:37:23 2014 Return-path: Envelope-to: ged-emacs-devel@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 1X9ybZ-0005Wt-Im for ged-emacs-devel@m.gmane.org; Wed, 23 Jul 2014 17:37:21 +0200 Original-Received: from localhost ([::1]:45696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9ybZ-0006Nd-61 for ged-emacs-devel@m.gmane.org; Wed, 23 Jul 2014 11:37:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9ybD-0006FP-4n for emacs-devel@gnu.org; Wed, 23 Jul 2014 11:37:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X9yad-0008Bm-Vo for emacs-devel@gnu.org; Wed, 23 Jul 2014 11:36:59 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:64920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9yad-0008BK-N9 for emacs-devel@gnu.org; Wed, 23 Jul 2014 11:36:23 -0400 Original-Received: from [91.113.4.54] ([91.113.4.54]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0LuxG5-1WRX8O2gwz-0108cj; Wed, 23 Jul 2014 17:36:21 +0200 In-Reply-To: <53CFCF26.2040105@yandex.ru> X-Provags-ID: V03:K0:e3EZSnqaf93SJfMLI6n9UQe2TuFwIEkuwggiDgNxdCsDw3RBRZz O1NTUL3owmGO8BziTedGh0ys4m3WUhPLfVt5202uYIeYacqN+z2Du6iAIb+uv9AfqxVN+wH 2ahhSltQUMTMJGP59K8B+zIWEa37EemxkBqZAJb6D72ml5rXgW09taoNL9/96MIpnskgS82 0tu2yDxkddaBGYMgoHU3g== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.15.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173101 Archived-At: > Nice shot. But, IIUC, this means that set-frame-height goes wrong > but should be: > > === modified file 'src/frame.c' > --- src/frame.c 2014-07-21 16:58:12 +0000 > +++ src/frame.c 2014-07-23 15:01:44 +0000 > @@ -2584,8 +2584,11 @@ > { > if (NILP (pixelwise)) > { > - if (XINT (height) != FRAME_LINES (f)) > - x_set_window_size (f, 1, FRAME_COLS (f), XINT (height), 0); > + int actual = FRAME_LINES (f) - FRAME_TOP_MARGIN (f); > + int requested = XINT (height) + FRAME_TOP_MARGIN (f); > + > + if (requested != actual) > + x_set_window_size (f, 1, FRAME_COLS (f), requested, 0); > > do_pending_window_change (0); > } In some sort of sense, yes. Have you looked at my code? I wrote adjust_frame_size to handle this and related cases in a uniform manner. What I never got around to handle precisely is x_figure_window_size which calculates the toolbar off by two pixels and the menubar off by one pixel (the latter on either Lucid or Motif). So my initial frame may lack one or two pixels. martin