all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: 18528@debbugs.gnu.org
Subject: bug#18528: 24.3.93; Crash during restoration of frameset from desktop
Date: Tue, 23 Sep 2014 18:26:27 +0300	[thread overview]
Message-ID: <8361gexsrg.fsf@gnu.org> (raw)
In-Reply-To: <542109B8.6080107@gmx.at>

> Date: Tue, 23 Sep 2014 07:48:40 +0200
> From: martin rudalics <rudalics@gmx.at>
> 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.)





  reply	other threads:[~2014-09-23 15:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 15:23 bug#18528: 24.3.93; Crash during restoration of frameset from desktop Eli Zaretskii
2014-09-22 17:43 ` martin rudalics
2014-09-22 18:13   ` Eli Zaretskii
2014-09-23  5:48     ` martin rudalics
2014-09-23 15:26       ` Eli Zaretskii [this message]
2014-09-23 16:15         ` martin rudalics
2014-09-23 18:46           ` Eli Zaretskii
2014-09-23 19:17             ` martin rudalics
2014-09-23 19:30               ` Eli Zaretskii
2014-09-23 19:42                 ` Eli Zaretskii
2014-09-24  6:16                   ` martin rudalics
2014-09-24  7:15                     ` Eli Zaretskii
2014-09-24  7:33                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8361gexsrg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=18528@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.