From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18528: 24.3.93; Crash during restoration of frameset from desktop Date: Tue, 23 Sep 2014 18:26:27 +0300 Message-ID: <8361gexsrg.fsf@gnu.org> References: <83egv3y90k.fsf@gnu.org> <54205FCF.4050503@gmx.at> <83bnq7y13y.fsf@gnu.org> <542109B8.6080107@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1411486729 15022 80.91.229.3 (23 Sep 2014 15:38:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 23 Sep 2014 15:38:49 +0000 (UTC) Cc: 18528@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 23 17:38:41 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 1XWSAf-0003GD-4f for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Sep 2014 17:38:29 +0200 Original-Received: from localhost ([::1]:53965 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWSAe-00024w-Om for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Sep 2014 11:38:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWSAS-0001uK-5R for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 11:38:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWSAK-0007mB-IV for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 11:38:16 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58538) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWSAK-0007lF-El for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 11:38:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XWS0Y-0003yQ-C0 for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 11:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Sep 2014 15:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18528 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141148602315188 (code B ref -1); Tue, 23 Sep 2014 15:28:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Sep 2014 15:27:03 +0000 Original-Received: from localhost ([127.0.0.1]:50099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XWRza-0003wt-Jq for submit@debbugs.gnu.org; Tue, 23 Sep 2014 11:27:02 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56159) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XWRzY-0003wT-Or for submit@debbugs.gnu.org; Tue, 23 Sep 2014 11:27:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWRzS-0004es-VO for submit@debbugs.gnu.org; Tue, 23 Sep 2014 11:27:00 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:60131) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWRzS-0004eS-Sl for submit@debbugs.gnu.org; Tue, 23 Sep 2014 11:26:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWRzI-0005zO-M1 for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 11:26:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWRzD-0004cJ-Ga for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 11:26:44 -0400 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:55027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWRzD-0004ba-8b for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 11:26:39 -0400 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NCD00E0017GRU00@mtaout29.012.net.il> for bug-gnu-emacs@gnu.org; Tue, 23 Sep 2014 18:26:04 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NCD00BOM1JGKQ40@mtaout29.012.net.il>; Tue, 23 Sep 2014 18:26:04 +0300 (IDT) In-reply-to: <542109B8.6080107@gmx.at> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:93656 Archived-At: > Date: Tue, 23 Sep 2014 07:48:40 +0200 > From: martin rudalics > CC: bug-gnu-emacs@gnu.org > > > I certainly think so. If GetClientRect fails, how does it make sense > > to use what we find in the rectangle data structure we passed to it? > > The values there are just garbage. > > We have to check these values anyway because our window structure might > be too complex to fit into the rectangle returned by GetClientRect. Sorry, I don't think I understand this. GetClientRect just returns the dimensions of our frame, it doesn't know anything about Emacs windows. > But then we should probably also rewrite things like > w32_clear_window as > > if (hdc && GetClientRect (FRAME_W32_WINDOW (f), &rect)) > w32_clear_rect (f, hdc, &rect); Indeed. > >> > + /* Recompute the dimensions in character units, since > >> > + check_frame_size might have changed the pixel dimensions. */ > >> > + /* Consider rounding here: Currently, the root window can be > >> > + larger than the frame in terms of columns/lines. */ > >> > + new_cols = new_text_width / FRAME_COLUMN_WIDTH (f); > >> > + new_lines = new_text_height / FRAME_LINE_HEIGHT (f); > > I never got around to ask you: Do you anywhere see a need to round up > the values of new_cols and new_lines in cases like this? Yes, I think so. I think the reason we didn't see any problems with that is that GUI windows always over-allocate their glyph matrices, to be prepared for dealing with the smallest possible font, which is rarely if ever used. But I think if you actually use that smallest font for the default face, you will see the problem. (Just make sure you don't round up for TTY frames, so as not to add one extra row there.)