* bug#3459: NS: mouse-face flicker
@ 2009-06-03 16:37 David Reitter
2016-01-10 22:45 ` Alan J Third
0 siblings, 1 reply; 5+ messages in thread
From: David Reitter @ 2009-06-03 16:37 UTC (permalink / raw)
To: emacs-pretest-bug
This happens only with the NS port, not on X:
Emacs -Q
(insert (propertize "Hello World" 'mouse-face 'highlight))
Hover mouse over the Hello World text. Nothing special should happen.
Now select a region with the mouse or the keyboard.
Hover mouse over mouseface text again ==> Heavy flicker; there is a
visible, sequential removal and redraw of the highlighted text with
every mouse movement.
Diagnosis:
I'm not sure, hence this report.
One contributing factor is that we ns_flush() in ns_update_end().
However, this is not just due to nested updates, and just adding
ns_update calls in note_mouse_highlight alonedoesn't seem to help, at
least when transient-mark-mode is on.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#3459: NS: mouse-face flicker
@ 2009-06-03 21:11 David Reitter
0 siblings, 0 replies; 5+ messages in thread
From: David Reitter @ 2009-06-03 21:11 UTC (permalink / raw)
To: 3459
Some analysis suggests that the mouse face is generally cleared when t-
m-m is on, whether really needed or not. With the patch below (not
meant as a bug fix) applied, the bug goes away.
Without the patch, try_window_reusing_current_matrix is not used in t-
m-m with a region visible.
I guess that dpyinfo->mouse_face_window is then set to Qnil, the mouse
face text cleared and redrawn at a later point in time outside of the
update_begin/end bracket.
The double-redraws are inefficient, and I don't quite understand why
they are necessary.
I suspect that this only shows up in NS because the frame is flushed
every time we have an update_window_end().
Help, please!
diff --git a/src/xdisp.c b/src/xdisp.c
index ac989d3..9db30f8 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14162,11 +14162,13 @@ try_window_reusing_current_matrix (w)
return 0;
/* Can't do this if region may have changed. */
+ /*
if ((!NILP (Vtransient_mark_mode)
&& !NILP (current_buffer->mark_active))
|| !NILP (w->region_showing)
|| !NILP (Vshow_trailing_whitespace))
return 0;
+ */
/* If top-line visibility has changed, give up. */
if (WINDOW_WANTS_HEADER_LINE_P (w)
@@ -23672,9 +23674,9 @@ note_mouse_highlight (f, x, y)
/* If we were displaying active text in another window, clear that.
Also clear if we move out of text area in same window. */
- if (! EQ (window, dpyinfo->mouse_face_window)
- || (part != ON_TEXT && part != ON_MODE_LINE && part !=
ON_HEADER_LINE
- && !NILP (dpyinfo->mouse_face_window)))
+ if ((! EQ (window, dpyinfo->mouse_face_window)
+ || (part != ON_TEXT && part != ON_MODE_LINE && part !=
ON_HEADER_LINE))
+ && !NILP (dpyinfo->mouse_face_window))
clear_mouse_face (dpyinfo);
/* Not on a window -> return. */
^ permalink raw reply related [flat|nested] 5+ messages in thread
* bug#3459: NS: mouse-face flicker
@ 2009-09-18 21:42 Adrian Robert
2009-09-18 21:51 ` David Reitter
0 siblings, 1 reply; 5+ messages in thread
From: Adrian Robert @ 2009-09-18 21:42 UTC (permalink / raw)
To: 3459; +Cc: David Reitter
Hello,
Can anyone familiar with the redisplay code take a look at this? Or
try the patch?
David, can you explain the second part of your patch? Just including
the first part fixes the bug for me. Is the change to the if test in
the second part meant to handle a problematic case that slips through
as the result of the first part? It seems to make no difference. In
particular, there is still flickering either way if you try to select
the mouse-highlighted text.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#3459: NS: mouse-face flicker
2009-09-18 21:42 Adrian Robert
@ 2009-09-18 21:51 ` David Reitter
0 siblings, 0 replies; 5+ messages in thread
From: David Reitter @ 2009-09-18 21:51 UTC (permalink / raw)
To: Adrian Robert; +Cc: 3459
[-- Attachment #1: Type: text/plain, Size: 708 bytes --]
On Sep 18, 2009, at 5:42 PM, Adrian Robert wrote:
> David, can you explain the second part of your patch? Just
> including the first part fixes the bug for me. Is the change to the
> if test in the second part meant to handle a problematic case that
> slips through as the result of the first part? It seems to make no
> difference. In particular, there is still flickering either way if
> you try to select the mouse-highlighted text.
I can't recall the details after 3+ months, but judging from the code
I think the second change doesn't make a difference unless window can
be Qnil, and I guess it can't.
Note: the patch is not a fix. Just a way to demonstrate one source of
flicker.
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#3459: NS: mouse-face flicker
2009-06-03 16:37 bug#3459: NS: mouse-face flicker David Reitter
@ 2016-01-10 22:45 ` Alan J Third
0 siblings, 0 replies; 5+ messages in thread
From: Alan J Third @ 2016-01-10 22:45 UTC (permalink / raw)
To: David Reitter; +Cc: 3459
David Reitter <david.reitter@gmail.com> writes:
> This happens only with the NS port, not on X:
>
> Emacs -Q
>
> (insert (propertize "Hello World" 'mouse-face 'highlight))
>
> Hover mouse over the Hello World text. Nothing special should happen.
>
> Now select a region with the mouse or the keyboard.
>
> Hover mouse over mouseface text again ==> Heavy flicker; there is a
> visible, sequential removal and redraw of the highlighted text with
> every mouse movement.
I can't reproduce this in Emacs 25, so I'm going to close it as fixed.
--
Alan Third
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-01-10 22:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-03 16:37 bug#3459: NS: mouse-face flicker David Reitter
2016-01-10 22:45 ` Alan J Third
-- strict thread matches above, loose matches on Subject: below --
2009-06-03 21:11 David Reitter
2009-09-18 21:42 Adrian Robert
2009-09-18 21:51 ` David Reitter
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).