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#18528: 24.3.93; Crash during restoration of frameset from desktop Date: Mon, 22 Sep 2014 19:43:43 +0200 Message-ID: <54205FCF.4050503@gmx.at> References: <83egv3y90k.fsf@gnu.org> 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 1411407941 23772 80.91.229.3 (22 Sep 2014 17:45:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Sep 2014 17:45:41 +0000 (UTC) To: eliz@gnu.org, 18528@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 22 19:45:33 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 1XW7g4-00072l-Nh for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Sep 2014 19:45:32 +0200 Original-Received: from localhost ([::1]:48012 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW7g4-0000Je-E8 for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Sep 2014 13:45:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW7fq-0000Da-2Q for bug-gnu-emacs@gnu.org; Mon, 22 Sep 2014 13:45:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XW7ff-0003Md-Qh for bug-gnu-emacs@gnu.org; Mon, 22 Sep 2014 13:45:18 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW7ff-0003Hw-OT for bug-gnu-emacs@gnu.org; Mon, 22 Sep 2014 13:45:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XW7fa-00071i-1V for bug-gnu-emacs@gnu.org; Mon, 22 Sep 2014 13:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 22 Sep 2014 17:45:01 +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-To: Eli Zaretskii , bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141140787826961 (code B ref -1); Mon, 22 Sep 2014 17:45:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Sep 2014 17:44:38 +0000 Original-Received: from localhost ([127.0.0.1]:49091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XW7fB-00070n-BX for submit@debbugs.gnu.org; Mon, 22 Sep 2014 13:44:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45105) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XW7f8-00070d-Ez for submit@debbugs.gnu.org; Mon, 22 Sep 2014 13:44:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XW7ey-00033V-FL for submit@debbugs.gnu.org; Mon, 22 Sep 2014 13:44:34 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:53355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW7ey-00032L-Cq for submit@debbugs.gnu.org; Mon, 22 Sep 2014 13:44:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW7ek-000809-Pt for bug-gnu-emacs@gnu.org; Mon, 22 Sep 2014 13:44:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XW7ed-0002zg-A4 for bug-gnu-emacs@gnu.org; Mon, 22 Sep 2014 13:44:10 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:65215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW7eV-0002v8-5M; Mon, 22 Sep 2014 13:43:55 -0400 Original-Received: from [194.166.82.229] ([194.166.82.229]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0M0xbD-1YR5zQ0rfD-00v7oc; Mon, 22 Sep 2014 19:43:47 +0200 In-Reply-To: <83egv3y90k.fsf@gnu.org> X-Provags-ID: V03:K0:72GwVBgvKAjTbjpmneIV+wXp0SuM0bI/vUppCVKOq7UpG6zAexU F5PdrfY/+yqjfd51fQUAakEjyBzJ2xHpArfsbaC4/QLXrJM3zrbfrpNPyu1W3lKvNVL0xRz ueFJtWnwLslUenLswjixjAnlRL70Jfo7vbbru5NZ0tLm0iodNuvYPmxrjfKBQ5/LnzvDEXW H6CeQLDGolouW4Oxoyk9w== 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: GNU/Linux 2.6.x 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:93637 Archived-At: > (gdb) p f->text_cols > $6 = -3 <<<<<<<<<<<<<<<<<<< What is the value of f->text_width here? > (We also don't check errors returned by > GetClientRect.) Should we? I wonder already why if (f && !FRAME_ICONIFIED_P (f) && msg.msg.wParam != SIZE_MINIMIZED) in w32_read_socket didn't catch this. > . change_frame_size internally validates the requested dimensions, > and doesn't allow them to become too small. But it does that on > pixel dimensions, and if those are corrected, the character-unit > dimensions are not recalculated to reflect those corrections. That's the bug. > + if (GetClientRect (msg.msg.hwnd, &rect) > + /* GetClientRect evidently returns (0, 0, 0, 0) if > + called on a minimized frame. Such "dimensions" > + aren't useful anyway. */ > + && !(rect.bottom == 0 > + && rect.top == 0 > + && rect.left == 0 > + && rect.right == 0)) It certainly can't harm to do that but I doubt whether it's worth to include a similar change for the other platforms. > + ssize_t frame_message_buf_size = FRAME_MESSAGE_BUF_SIZE (f); > + > + eassert (frame_message_buf_size >= 0); Good. This part should definitely go to the trunk too. > + /* 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); This part should fix the problem for all platforms. Please check it in but please also make sure that only the changes in adjust_decode_mode_spec_buffer and maybe those of w32_read_socket get propagated to the trunk. Did you verify that the trunk handles your .emacs.desktop correctly? Many thanks, martin