unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>
Cc: esabof@gmail.com, 14233@debbugs.gnu.org
Subject: bug#14233: 24.3; Don't constrain frame size to character multiples
Date: Fri, 26 Apr 2013 09:42:06 +0200	[thread overview]
Message-ID: <517A2FCE.30006@gmx.at> (raw)
In-Reply-To: <834neuvas1.fsf@gnu.org>

 >> ... but the display margins were always included in the window
 >> dimensions ...
 >
 > Yes, and that might explain why so are the fringes.

... but the fringes never were ...

 >>  > but OTOH the fringes separate the window into 2 disjoint
 >>  > areas.
 >>
 >> ... so what am I missing?  All I want is to maintain fringes exclusively
 >> inside the frame's root window.
 >
 > I don't know anymore who misses what.  You said:
 >
 >>  >> When you remove the scrollbars the Emacs frame shrinks.  When you
 >>  >> remove the fringes it does not shrink.  Yet, when changing frame
 >>  >> sizes we are expected to handle fringes and scrollbars alike: They
 >>  >> are no text, they are no windows and therefore should not be counted
 >>  >> in the width of the frame's text area.
 >
 > which to me means that you want fringes to NOT be included in the
 > window text area.  Therefore, I tried to explain what was (or could
 > be) the motivation to INCLUDE fringes in the text area: because
 > otherwise, the display margins, which ARE part of text area, would
 > become disjoint from the rest of the window's text area by the fringes
 > that are in-between.

You misread.  There's a difference between what I want to do and what
has to be done to fix an existing bug.  Let me start with the latter
first.

------

An Emacs frame contains a text area and a non-text area, both of which
are not necessarily contiguous.  Traditionally, the text area contains
the displayed buffer texts, the display margins, the minibuffer window,
the toolbar window and the menubar window.  The non-text area contains
the scrollbars and vertical divider lines, the fringes, and the internal
borders of the frame.

In addition, a frame usually has parts maintained externally like an
external toolbar, menubar, decorations and external borders.  Parts
maintained externally are not directly controlled by Emacs, their sizes
and appearances are subject to negotiations with the operating system's
window manager.

Part of this traditional convention is that when certain aspects of the
appearance of a frame change, Emacs tries to keep the size of the
displayed buffer text unchanged in terms of lines and columns.  This
implies that when we add/remove/change the size of a scrollbar or a
fringe, the size of the frame as a whole has to change to keep the
number of columns in the text area (which is already an abstraction of
the displayed buffer text due to the presence of display margins)
constant.  We also resize the frame when we change its default font or
the internal border width.

We do not change the frame size when we modify the buffer text, change
the height of the minibuffer window, a toolbar window, a menubar window,
or the size of display margins.

I don't know whether changing parts maintained externally (like removing
an external toolbar or setting the operating system's default font for
menubar items), may affect the size of the rest of the frame.  I guess
that usually the OS/window manager tries to keep the size of the entire
frame (inlcuding the external parts) constant, but this might not be
always the case.  I'd be glad if someone informed me about the behavior
of Emacs in this regard on the various platforms we maintain.

The traditional concept works well for frames that contain one window
only.  It fails already, where a frame is built from two windows one
above the other where one of these windows comprises two side-by-side
windows.  In this case, changing a scrollbar or a fringe will invalidate
the attempt to keep the number of columns/lines of displayed buffer text
(the text areas) unchanged.

In addition, the concept sketched above has been softened with the
addition of window/buffer-local fringes and scrollbars.  Changing these
affect the window(s) displaying a certain buffer only and do not change
the size of the frame.

Note that with side-by-side windows frame-local fringe/scrollbar widths
have been practically eradicated - they continue to live virtually only
(mainly serving as a default value for windows and buffers that don't
define their own).

Unfortunately, later changes clashed with the earlier defined concepts
in a number of ways.  Here I shall sketch two of them:

(1) Over the time, the fringe handling code has been rewritten (in a
     routine called compute_fringe_widths) such that changing a frame's
     fringes will not cause the frame to get resized immediately but
     stores the new values in the corresponding frame parameter only.

     This behavior is the immediate cause of bug#14222 and should be
     fixed, either by sending a resize request to the OS (which might be
     tricky) or by having fringes become part of the frame's text area.

(2) Maximized/fullscreen frames do not play nicely with keeping the
     numbers of columns/lines unchanged.  Emacs should not resize such a
     frame when changing default font or parts of the non-text area.

This concludes my assessment of how Emacs frames traditionally behave
and what should be done to fix some shortcomings.  It's by no means
related to the introduction of pixelwise resizing and/or to how I want
Emacs frames to behave.

-----------------------

What I _want_ to do is no less than to remove the aim to keep the number
of columns/lines unchanged when changing aspects that control the
appearance of frames like scrollbars, fringes, or internal borders.
And, as Jan remarked, we should also try to keep the combined size of an
Emacs frame + its externally maintained parts unchanged when, for
example, removing an external toolbar (unless the window manager handles
this case already as it apparently already does when resizing an
external menubar).

This aim has two immediate consequences:

(1) We do not distinguish between a frame's text and non-text areas any
     more.  The frame size changes only when explicitly requested.  This
     also means that we don't have to contact the OS/window manager when
     adding/removing scrollbars/internal borders or changing the default
     font.

(2) In some case we may now have to contact the OS/window manager, for
     example, when removing an external toolbar, we may have to issue a
     request to fill the freed screen space with the to-be-enlarged Emacs
     frame.  Whether and where this is necessary is beyond my knowledge
     though.

I'm still uncertain whether this behavior should be applied to textual
frames too.

-----------

Finally note that I do not intend to implement any of the things I
sketched here in my pixelwise implementation of frame/window resizing.
This implementation will emulate the current behavior (with all its bugs
and shortcomings) as closely as possible.

martin





  reply	other threads:[~2013-04-26  7:42 UTC|newest]

Thread overview: 103+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19 23:58 bug#14233: 24.3; Don't constrain frame size to character multiples E Sabof
2013-04-20  0:17 ` Glenn Morris
2013-04-20  6:45   ` Eli Zaretskii
2013-04-20  8:53     ` martin rudalics
2013-04-20  9:11       ` Jan Djärv
2013-04-20 11:00         ` martin rudalics
2013-04-20 12:56           ` Jan Djärv
2013-04-20 13:13             ` Eli Zaretskii
2013-04-20 19:26               ` Jan Djärv
2013-04-20 19:54                 ` Eli Zaretskii
2013-04-20 22:02                   ` Drew Adams
2013-04-21  3:40                   ` Stefan Monnier
2013-04-21  7:04                     ` Jan Djärv
2013-04-21  9:28                       ` martin rudalics
2013-04-21 17:05                         ` Jan Djärv
2013-04-22  9:34                           ` martin rudalics
2013-04-22 14:17                       ` Stefan Monnier
2013-04-21  9:27                     ` martin rudalics
2013-04-21  9:27                   ` martin rudalics
2013-04-20 20:47                 ` E Sabof
2013-04-21  9:26                 ` martin rudalics
2013-04-21 17:21                   ` Jan Djärv
2013-04-22  9:34                     ` martin rudalics
2013-04-22 13:11                       ` Jan Djärv
2013-04-22 15:36                         ` martin rudalics
2013-04-22 16:11                           ` Jan Djärv
2013-04-22 16:38                             ` martin rudalics
2013-04-22 18:21                               ` Eli Zaretskii
2013-04-23  6:52                                 ` martin rudalics
2013-04-23 16:28                                   ` Eli Zaretskii
2013-04-24  6:39                                     ` martin rudalics
2013-04-24 17:13                                       ` Eli Zaretskii
2013-04-23 11:58                               ` Jan Djärv
2013-04-23 12:33                                 ` martin rudalics
2013-04-23 16:48                                   ` Eli Zaretskii
2013-04-24  6:39                                     ` martin rudalics
2013-04-24 16:54                                       ` Jan Djärv
2013-04-25  7:29                                         ` martin rudalics
2013-04-25  9:55                                           ` Jan Djärv
2013-04-25 11:58                                             ` martin rudalics
2013-04-25 15:47                                         ` Richard Stallman
2013-04-24 17:15                                       ` Eli Zaretskii
2013-04-24 17:50                                         ` Jan Djärv
2013-04-25  7:29                                         ` martin rudalics
2013-04-20 13:38             ` martin rudalics
2013-04-20 19:33               ` Jan Djärv
2013-04-20 16:22             ` Drew Adams
2013-04-20 17:12               ` Eli Zaretskii
2013-04-20 21:50                 ` Drew Adams
2013-04-21  9:27                   ` martin rudalics
2013-04-21 16:17                     ` Drew Adams
2013-04-20  9:25       ` Eli Zaretskii
2013-04-20 11:01         ` martin rudalics
2013-04-20 11:32           ` Eli Zaretskii
2013-04-20 13:38             ` martin rudalics
2013-04-20 16:25               ` Eli Zaretskii
2013-04-20 17:35                 ` martin rudalics
2013-04-20 17:48                   ` E Sabof
2013-04-20 18:26                   ` Eli Zaretskii
2013-04-21  9:26                     ` martin rudalics
2013-04-21 15:03                       ` Eli Zaretskii
2013-04-22  9:34                         ` martin rudalics
2013-04-21 17:30                       ` Jan Djärv
2013-04-22  9:34                         ` martin rudalics
2013-04-22 13:12                           ` Jan Djärv
2013-04-22 15:36                             ` martin rudalics
2013-04-22 18:36                               ` Eli Zaretskii
2013-04-23  6:54                                 ` martin rudalics
2013-04-23 16:29                                   ` Eli Zaretskii
2013-04-23  6:50                             ` martin rudalics
2013-04-23 16:23                               ` Eli Zaretskii
2013-04-24  6:38                                 ` martin rudalics
2013-04-24 17:09                                   ` Eli Zaretskii
2013-04-24 18:50                                     ` Stefan Monnier
2013-04-24 20:09                                       ` Jan Djärv
2013-04-25  7:31                                         ` martin rudalics
2013-04-25 10:02                                           ` Jan Djärv
2013-04-25 11:58                                             ` martin rudalics
2013-04-25 14:11                                               ` Jan Djärv
2013-04-25  7:30                                       ` martin rudalics
2013-04-25  7:29                                     ` martin rudalics
2013-04-25 16:24                                       ` Eli Zaretskii
2013-04-26  7:42                                         ` martin rudalics [this message]
2013-04-26 13:21                                           ` Stefan Monnier
2013-04-26 14:39                                           ` Drew Adams
2013-04-27  6:59                                             ` martin rudalics
2013-04-27 13:53                                               ` Drew Adams
2013-04-28 12:17                                                 ` martin rudalics
2013-04-28 15:33                                                   ` Drew Adams
2013-04-28 16:29                                                     ` Drew Adams
2013-04-29  7:33                                                     ` martin rudalics
2013-04-29 14:10                                                       ` Drew Adams
2013-04-29 16:48                                                         ` martin rudalics
2013-04-29 20:41                                                           ` Drew Adams
2013-04-30  7:34                                                             ` martin rudalics
2013-04-30 15:47                                                               ` Drew Adams
2013-04-30 17:08                                                                 ` martin rudalics
2013-04-30 19:45                                                                   ` Drew Adams
2013-05-01  9:15                                                                     ` martin rudalics
2013-05-01 13:47                                                                       ` Drew Adams
2013-05-02  9:22                                                                         ` martin rudalics
2013-05-02 13:28                                                                           ` Drew Adams
2014-12-25 19:30 ` martin rudalics

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=517A2FCE.30006@gmx.at \
    --to=rudalics@gmx.at \
    --cc=14233@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=esabof@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).