all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: occitan@esperanto.org
Cc: 12419@debbugs.gnu.org
Subject: bug#12419: Mouse click changes layout
Date: Mon, 24 Sep 2012 10:17:25 +0200	[thread overview]
Message-ID: <50601715.6030108@gmx.at> (raw)
In-Reply-To: <505F8576.8070902@t-online.de>

 > However my first informatics lesson the professor told us: the most
 > common bug is being off by one.  That is alas still the case with your
 > patch: After C-x 2 the lower window is one row higher than the upper
 > one.  After our little experiment, it's the other way round, with this
 > result:  When letting go of the mouse, I still marked to the line above,
 > which is now in the position of my mouse-down event.  Sounds like an
 > integer division rounding problem, though I don't see such a thing in
 > your patch.  If both windows together have an even number of rows (by
 > resizing the frame) it's fine.

You should get a similar behavior if you have a root window with an odd
number of lines, split that window via C-x 2, shrink the frame by one
line, and enlarge it again by one line: The upper window has stolen one
line from the lower one.  As a matter of fact, this is not an off-by-one
error but more deeply rooted in the history of Emacs' window handling.
You can skip the following explanation if you want.

   Beginning with Emacs 24.1, windows have a normal height (a floating
   point number) which is the fraction of their ideal height wrt to their
   parent.  When you do C-x 2 the normal height of both emanating windows
   is 0.5.  However, when the original window has an odd number of lines,
   I have to give the lower window the one remaining line in order to be
   consistent with the traditional splitting behavior.  This means that,
   if the original window has 11 lines, the upper window gets 5 and the
   lower window gets 6 lines.

   If I now enlarge the parent window to 22 lines, the upper window gets
   11 (and not 10) lines and the lower window 11 (and not 12 lines).
   Sizing back the parent to 11 lines should restore the initial state
   but it doesn't because I resize windows in the "opposite" direction
   (from top to bottom/from left to right) which preferably gives
   to/steals from the topmost/leftmost window.

So I have to fix this regardless of the topic we're discussing here.

 > If however I split either of the two windows again (even the top one,
 > which is out of reach of the resizing echo area) the disturbing new
 > before-your-patch behaviour comes back.

I suppose you should try again.  If I split the top window, only the
bottom window resizes and I can't observe what you observe here.  If I
make a new bottom window instead, the line where `point' appears in that
window moves to the top of the window and I can observe the behavior.
However, I don't see any difference wrt Emacs 23 which means I do not
see a "disturbing new" before-my-patch behavior.  If you nevertheless
do, please give me a detailed step-by-step scenario I can repeat here.

 >> The second scenario you sketched is
[...]
 > The point is moving the mouse over to the i, which causes the 1st
 > scroll, and then letting go, which causes the scrolled region to be
 > marked, plus it causes a 2nd scroll by the same amount.  So the point is
 > now far from the highlighted part.  I guess this comes from a different
 > code location.  Only the user experience feels to me like both cases
 > should be consistent with one another.

OK.  I see something in this regard.  But Emacs 23 seems to behave in
exactly the same way.  Or do you see a difference?

martin





  reply	other threads:[~2012-09-24  8:17 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-11 22:04 bug#12419: Mouse click changes layout Daniel Pfeiffer
2012-09-12  2:59 ` Eli Zaretskii
2012-09-12  8:09 ` martin rudalics
2012-09-13 20:41   ` Daniel Pfeiffer
2012-09-14  9:00     ` martin rudalics
2012-09-14 10:36       ` Eli Zaretskii
2012-09-14 13:38         ` martin rudalics
2012-09-14 14:10           ` Drew Adams
2012-09-14 15:08             ` martin rudalics
2012-09-14 16:18               ` Drew Adams
2012-09-14 19:14                 ` martin rudalics
2012-09-14 19:40                   ` Drew Adams
2012-09-15  9:51                     ` martin rudalics
2012-09-15 10:31                       ` martin rudalics
2012-09-14 14:53           ` Eli Zaretskii
2012-09-14 15:16             ` martin rudalics
2012-09-14 16:20               ` Drew Adams
2012-09-14 19:14                 ` martin rudalics
2012-09-14 16:56               ` Eli Zaretskii
2012-09-14 19:15                 ` martin rudalics
2012-09-14 20:16                   ` Eli Zaretskii
2012-09-15  9:54                     ` martin rudalics
2012-09-15 10:23                       ` Eli Zaretskii
2012-09-15 10:39                         ` martin rudalics
2012-09-15 11:14                           ` Eli Zaretskii
2012-09-15 12:44                             ` martin rudalics
2012-09-15 13:35                               ` Eli Zaretskii
2012-09-15 14:34                                 ` martin rudalics
2012-09-14 15:45             ` Stefan Monnier
2012-09-14 19:14               ` martin rudalics
2012-09-14 19:56                 ` Stefan Monnier
2012-09-15  9:51                   ` martin rudalics
     [not found]       ` <5055D769.1060804@t-online.de>
2012-09-16 17:45         ` martin rudalics
2012-09-22 20:29           ` Daniel Pfeiffer
2012-09-23  9:21             ` martin rudalics
2012-09-23 21:56               ` Daniel Pfeiffer
2012-09-24  8:17                 ` martin rudalics [this message]
2012-09-24 14:33                   ` Eli Zaretskii
2012-09-25  9:58                     ` martin rudalics
2012-09-25 12:09                       ` Eli Zaretskii
2012-09-25 14:12                         ` martin rudalics
2012-09-26  8:22                           ` Eli Zaretskii
2012-09-26 11:03                             ` martin rudalics
2012-09-26 11:55                               ` Eli Zaretskii
2012-09-26 12:43                                 ` martin rudalics
2012-09-26 13:17                                   ` Eli Zaretskii
2012-09-26 13:44                                     ` martin rudalics
2012-09-26 13:57                                       ` Eli Zaretskii
2012-09-24 22:20                   ` Daniel Pfeiffer
2012-09-25  6:32                     ` Eli Zaretskii
2012-09-25  9:58                     ` martin rudalics
2020-09-13 17:06               ` Lars Ingebrigtsen
2020-12-07 16:43                 ` Lars Ingebrigtsen

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=50601715.6030108@gmx.at \
    --to=rudalics@gmx.at \
    --cc=12419@debbugs.gnu.org \
    --cc=occitan@esperanto.org \
    /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.