all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Bruno Félix Rezende Ribeiro" <oitofelix@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 18912@debbugs.gnu.org
Subject: bug#18912: 24.4; mode-line corruption on graphical frames in dual-headed display
Date: Tue, 04 Nov 2014 17:56:42 -0200	[thread overview]
Message-ID: <54592F7A.6010909@gnu.org> (raw)
In-Reply-To: <83r3xjuej2.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 5010 bytes --]

Eli Zaretskii wrote:

> What do you mean by "scrolling", exactly?  Which Emacs commands?

I mean by scroll the change of correspondence between window lines and
buffer lines.  It's not absolutely associated with any particular
Emacs command.  There are commands that are intended to directly cause
scrolling, but don't do so in particular cases (eg. 'C-v' at the
end of the buffer), and there are commands that are not directly
intended to cause scrolling but do so in particular cases
(eg. 'C-n' at the last visible line of a window).

> In any case, the initial display of "C-x d" doesn't involve any 
> scrolling, so it's not a "scrolling problem".

You are right.  That's a particular case for which the rule of thumb
is: for newly created windows the mode-line should be drawn after the
buffer's content is drawn.  I think that would solve the problem.
From there forth, after any scrolling the mode-line should be
(optionally) drawn after the buffer's content is drawn.

> What about moving cursor so it exits the visible portion of the 
> window, which also induces scrolling?

It corrupts the mode-line as do 'C-l' typed multiple times.

> And what about using the scroll bar?

This too.

> Or just "M-x goto-char RET"?

Idem, as long as it causes scrolling and the new view has a buffer
line "under" the mode-line.  The same happens with the 'goto-line'
command.

> Are you saying these don't produce a corrupted mode line?

Nope, actually all of them are capable of corrupting the mode-line.

> When you move to a different line, Emacs only redraws the line number
> part of the mode line.  Does that at least remove the corruption in
> that area, or doesn't it?

It does in that very area.

> In general, Emacs always redraws only the parts of the screen that 
> were changed.  If you tell it to redraw, and nothing changed, it will
> normally not redraw anything at all.

It would be wise to provide a way to force Emacs to redraw, because
there are factors beyond Emacs control and knowledge that could change
the aspect of the frame.  This bug is an example of that.

> Of course, it doesn't!  Emacs doesn't use the technique used by 
> xrefresh, because Emacs tries to redraw as little as possible, not as
> much as possible!  xrefresh was coded specifically to force portions
> of the screen to be completely redrawn, which is almost the 
> anti-thesis of the Emacs display engine.

Again, sometimes it's necessary to redraw more than Emacs think it
should.  I'm not advocating to make Emacs redraw the whole frame,
rather just the mode-line after very specific events.

> Is there _any_ Emacs action that succeeds in redrawing the mode line
>  or its parts in a way that eliminates the corruption?

Yes, there is.

> I already asked above about whether moving to a different line does 
> that in the portion that displays the line number.  How about 
> hovering the mouse pointer over mouse-sensitive portions of the mode
>  line, like the buffer name and the major/minor mode indications?

This also eliminates the corruption.

> do they successfully redraw the corresponding parts of the mode 
> line?

Yep.

> What about "M-x redraw-display RET" -- does it fix the display of the
> mode line?

Nope, because it draws the buffer's content after redrawing the
mode-line, overriding the mode-line refresh, in effect.

> If none of these helps, then I don't think Emacs can do anything at 
> all to help you work around the problem.

They in fact help!  So I think Emacs can do something to help me work
around the problem, if you help Emacs to help me. ;-)

> (And btw, why disabling the acceleration permanently isn't _the_ 
> solution?)

Because the acceleration is not intended to cause that sort of
problem.  That's bug.  Moreover, if I disable acceleration I would
affect a lot more than just Emacs.  On the other hand, the Emacs
workaround I propose won't affect any other application or user of
Emacs, and will help everyone else experiencing similar problems.

From my perspective, it's an improvement to make Emacs aware that it
cannot know everything, and therefore we reserve the right to force it
to redraw some parts of its frames, even if it doesn't feel like it,
when we, the users, judge necessary.

In particular Emacs must know that when redrawing the frame's content,
it should first draw the buffer's content and only then the mode-line.

> Any change in window height that causes it to be an exact integral 
> multiple of the font height will eliminate the problem.  The problem
>  is evidently caused by incorrect clipping of partially-visible 
> lines. That's why you see what you see.

That makes a lot of sense.

-- 
 ,= ,-_-. =.  Bruno Félix Rezende Ribeiro (oitofelix) [0x28D618AF]
((_/)o o(\_)) There is no system but GNU;
 `-'(. .)`-'  GNU Linux-Libre is one of its official kernels;
     \_/      All software must be free as in freedom;


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2014-11-04 19:56 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 13:46 bug#18912: 24.4; mode-line corruption on graphical frames in dual-headed display Bruno Félix Rezende Ribeiro
2014-10-31 20:30 ` Stefan Monnier
2014-10-31 20:44   ` Bruno Félix Rezende Ribeiro
2014-11-01  8:42   ` Eli Zaretskii
2014-11-01 12:56     ` Bruno Félix Rezende Ribeiro
2014-11-01  8:38 ` Eli Zaretskii
2014-11-01  9:16   ` Eli Zaretskii
2014-11-01 12:54   ` Bruno Félix Rezende Ribeiro
2014-11-01 13:03     ` Eli Zaretskii
2014-11-02 21:49       ` Bruno Félix Rezende Ribeiro
2014-11-03  3:34         ` Eli Zaretskii
2014-11-03  6:03           ` Bruno Félix Rezende Ribeiro
2014-11-03 16:20             ` Eli Zaretskii
2014-11-03 17:43               ` martin rudalics
2014-11-03 17:52                 ` Eli Zaretskii
2014-11-03 18:01                   ` martin rudalics
2014-11-03 18:19                     ` Eli Zaretskii
2014-11-03 20:06               ` Bruno Félix Rezende Ribeiro
2014-11-03 20:24                 ` Eli Zaretskii
2014-11-03 20:29                   ` Eli Zaretskii
2014-11-03 20:46                     ` Eli Zaretskii
2014-11-03 21:01                       ` Bruno Félix Rezende Ribeiro
2014-11-03 21:19                         ` Eli Zaretskii
2014-11-04  6:05                           ` Bruno Félix Rezende Ribeiro
2014-11-04  8:25                             ` Bruno Félix Rezende Ribeiro
2014-11-04 16:00                               ` Eli Zaretskii
2014-11-04 19:24                                 ` martin rudalics
2014-11-04 19:52                                   ` Eli Zaretskii
2014-11-04 20:13                                 ` Stefan Monnier
2014-11-05  3:39                                   ` Eli Zaretskii
2014-11-05  9:17                                   ` Andreas Schwab
2014-11-04 21:09                                 ` Bruno Félix Rezende Ribeiro
2014-11-05 16:02                                   ` Eli Zaretskii
2014-11-05 21:38                                     ` Bruno Félix Rezende Ribeiro
2014-11-06  3:45                                       ` Eli Zaretskii
2014-11-06 15:28                                         ` Stefan Monnier
2014-11-04 15:54                             ` Stefan Monnier
2014-11-04 21:28                               ` Bruno Félix Rezende Ribeiro
2014-11-04 23:11                                 ` Stefan Monnier
2014-11-04 15:56                             ` Eli Zaretskii
2014-11-04 19:24                               ` martin rudalics
2014-11-04 20:55                                 ` Bruno Félix Rezende Ribeiro
2014-11-04 20:14                               ` Bruno Félix Rezende Ribeiro
2014-11-05  3:51                                 ` Eli Zaretskii
2014-11-05  6:28                                   ` Bruno Félix Rezende Ribeiro
2014-11-05 15:58                                     ` Eli Zaretskii
2014-11-05 19:46                                       ` Bruno Félix Rezende Ribeiro
2014-11-03 20:55                     ` Bruno Félix Rezende Ribeiro
2014-11-03 20:44                   ` Bruno Félix Rezende Ribeiro
2014-11-03  9:08           ` Andreas Schwab
2014-11-03 16:23             ` Eli Zaretskii
2014-11-03  9:41       ` martin rudalics
2014-11-03 18:58         ` Bruno Félix Rezende Ribeiro
2014-11-03 19:14           ` Eli Zaretskii
2014-11-03 20:10             ` Bruno Félix Rezende Ribeiro
2014-11-04  7:55           ` martin rudalics
2014-11-04  8:20             ` Bruno Félix Rezende Ribeiro
2014-11-04  9:19               ` martin rudalics
2014-11-04 10:25                 ` Bruno Félix Rezende Ribeiro
2014-11-04 16:16                   ` Eli Zaretskii
2014-11-04 19:56                     ` Bruno Félix Rezende Ribeiro [this message]
2014-11-04 19:23                   ` martin rudalics
2014-11-04 21:46                     ` Bruno Félix Rezende Ribeiro

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=54592F7A.6010909@gnu.org \
    --to=oitofelix@gnu.org \
    --cc=18912@debbugs.gnu.org \
    --cc=eliz@gnu.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.