unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* two-pixel trace left when move overlay
@ 2006-04-01 19:24 Drew Adams
  2006-04-23 22:49 ` Kim F. Storm
  0 siblings, 1 reply; 6+ messages in thread
From: Drew Adams @ 2006-04-01 19:24 UTC (permalink / raw)


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

I have an overlay in buffer *Completions* to highlight the current candidate
during cycling of candidates in the minibuffer. I use this code to
reposition the overlay:

(if (symbol-value overlay)
      (move-overlay (symbol-value overlay) start end buffer)
    (set overlay (make-overlay start end buffer))
    (overlay-put (symbol-value overlay) 'face face))

In Emacs 20, 21, and a CVS snapshot of June 26, 2005, this works OK. In a
CVS snapshot of 2006-03-20, when I move the overlay, a two-pixel (I believe)
trace is left behind. See attached screenshots.

[-- Attachment #2: bug-emacs-22-Completions-pixel.jpg --]
[-- Type: image/jpeg, Size: 198824 bytes --]

[-- Attachment #3: bug-emacs-22-Completions-pixel-closeup.jpg --]
[-- Type: image/jpeg, Size: 67082 bytes --]

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: two-pixel trace left when move overlay
  2006-04-01 19:24 two-pixel trace left when move overlay Drew Adams
@ 2006-04-23 22:49 ` Kim F. Storm
  2006-04-23 22:58   ` Drew Adams
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Kim F. Storm @ 2006-04-23 22:49 UTC (permalink / raw)
  Cc: Emacs-Devel

"Drew Adams" <drew.adams@oracle.com> writes:

> I have an overlay in buffer *Completions* to highlight the current candidate
> during cycling of candidates in the minibuffer. I use this code to
> reposition the overlay:
>
> (if (symbol-value overlay)
>       (move-overlay (symbol-value overlay) start end buffer)
>     (set overlay (make-overlay start end buffer))
>     (overlay-put (symbol-value overlay) 'face face))
>
> In Emacs 20, 21, and a CVS snapshot of June 26, 2005, this works OK. In a
> CVS snapshot of 2006-03-20, when I move the overlay, a two-pixel (I believe)
> trace is left behind. See attached screenshots.

Hi Drew,  I tried to reproduce this with the files you sent me (I had to get
hexrgb.el from the wiki), but I don't see the problem on X/GNU/Linux.

Perhaps it is a Windoze specific problem?


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: two-pixel trace left when move overlay
  2006-04-23 22:49 ` Kim F. Storm
@ 2006-04-23 22:58   ` Drew Adams
  2006-04-24  3:26   ` Eli Zaretskii
  2006-04-24 10:45   ` Jason Rumney
  2 siblings, 0 replies; 6+ messages in thread
From: Drew Adams @ 2006-04-23 22:58 UTC (permalink / raw)


    > I have an overlay in buffer *Completions* to highlight the
    > current candidate
    > during cycling of candidates in the minibuffer. I use this code to
    > reposition the overlay:
    >
    > (if (symbol-value overlay)
    >       (move-overlay (symbol-value overlay) start end buffer)
    >     (set overlay (make-overlay start end buffer))
    >     (overlay-put (symbol-value overlay) 'face face))
    >
    > In Emacs 20, 21, and a CVS snapshot of June 26, 2005, this
    > works OK. In a
    > CVS snapshot of 2006-03-20, when I move the overlay, a
    > two-pixel (I believe)
    > trace is left behind. See attached screenshots.

    Hi Drew,  I tried to reproduce this with the files you sent me
    (I had to get
    hexrgb.el from the wiki), but I don't see the problem on X/GNU/Linux.

    Perhaps it is a Windoze specific problem?

No doubt (since I see it systematically, with just those files). Thanks for
trying on X/GNU/Linux.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: two-pixel trace left when move overlay
  2006-04-23 22:49 ` Kim F. Storm
  2006-04-23 22:58   ` Drew Adams
@ 2006-04-24  3:26   ` Eli Zaretskii
  2006-04-24 10:45   ` Jason Rumney
  2 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2006-04-24  3:26 UTC (permalink / raw)
  Cc: drew.adams, emacs-devel

> From: storm@cua.dk (Kim F. Storm)
> Date: Mon, 24 Apr 2006 00:49:49 +0200
> Cc: Emacs-Devel <emacs-devel@gnu.org>
> 
> "Drew Adams" <drew.adams@oracle.com> writes:
> 
> > I have an overlay in buffer *Completions* to highlight the current candidate
> > during cycling of candidates in the minibuffer. I use this code to
> > reposition the overlay:
> >
> > (if (symbol-value overlay)
> >       (move-overlay (symbol-value overlay) start end buffer)
> >     (set overlay (make-overlay start end buffer))
> >     (overlay-put (symbol-value overlay) 'face face))
> >
> > In Emacs 20, 21, and a CVS snapshot of June 26, 2005, this works OK. In a
> > CVS snapshot of 2006-03-20, when I move the overlay, a two-pixel (I believe)
> > trace is left behind. See attached screenshots.
> 
> Hi Drew,  I tried to reproduce this with the files you sent me (I had to get
> hexrgb.el from the wiki), but I don't see the problem on X/GNU/Linux.
> 
> Perhaps it is a Windoze specific problem?

If someone gives a precise recipe, starting with "emacs -Q", to
reproduce this, I could see if today's CVS exhibits the problem on
Windows.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: two-pixel trace left when move overlay
  2006-04-23 22:49 ` Kim F. Storm
  2006-04-23 22:58   ` Drew Adams
  2006-04-24  3:26   ` Eli Zaretskii
@ 2006-04-24 10:45   ` Jason Rumney
  2006-04-24 16:37     ` Drew Adams
  2 siblings, 1 reply; 6+ messages in thread
From: Jason Rumney @ 2006-04-24 10:45 UTC (permalink / raw)
  Cc: Drew Adams, Emacs-Devel


[-- Attachment #1.1: Type: text/plain, Size: 2078 bytes --]

Kim F. Storm wrote:
> "Drew Adams" <drew.adams@oracle.com> writes:
>
>   
>> I have an overlay in buffer *Completions* to highlight the current candidate
>> during cycling of candidates in the minibuffer. I use this code to
>> reposition the overlay:
>>
>> (if (symbol-value overlay)
>>       (move-overlay (symbol-value overlay) start end buffer)
>>     (set overlay (make-overlay start end buffer))
>>     (overlay-put (symbol-value overlay) 'face face))
>>
>> In Emacs 20, 21, and a CVS snapshot of June 26, 2005, this works OK. In a
>> CVS snapshot of 2006-03-20, when I move the overlay, a two-pixel (I believe)
>> trace is left behind. See attached screenshots.
>>     
>
> Hi Drew,  I tried to reproduce this with the files you sent me (I had to get
> hexrgb.el from the wiki), but I don't see the problem on X/GNU/Linux.
>
> Perhaps it is a Windoze specific problem?
>
>
>   
It is almost certainly due to this change:

2005-07-01  Jason Rumney  <jasonr@gnu.org>

    * w32term.c (cleartype_active): New flag for enabling sub-pixel
    workaround.
    (w32_initialize): Initialize it.
    (w32_native_per_char_metric): Allow a couple of extra pixels when
    Cleartype is active.

    * w32term.c (w32_initialize): Move check for screen reader here
    from syms_of_w32term.

The history of this is:

In Windows XP, "Cleartype" sub-pixel anti-aliasing was introduced. With 
some fonts, this caused a garbaged display, since characters draw 
outside of their advertised bounding box.

In 21.3 I disabled the use of Cleartype in Emacs to avoid this problem, 
but users complained, so a workaround of increasing the width of the 
bounding box by one pixel left and right was installed. This should 
cause Emacs to always draw a whole line at a time (after figuring out 
that characters on that line are overlapping), which is the advice that 
Microsoft gives to avoid this problem.

I guess the workaround must be adversely affecting the drawing of 
overlays though - the extra two pixels being drawn on the background, 
but not detected when it comes time to erase them.


[-- Attachment #1.2: Type: text/html, Size: 2779 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: two-pixel trace left when move overlay
  2006-04-24 10:45   ` Jason Rumney
@ 2006-04-24 16:37     ` Drew Adams
  0 siblings, 0 replies; 6+ messages in thread
From: Drew Adams @ 2006-04-24 16:37 UTC (permalink / raw)


      In Emacs 20, 21, and a CVS snapshot of June 26, 2005, this works OK.
In a
      CVS snapshot of 2006-03-20, when I move the overlay, a two-pixel (I
believe)
      trace is left behind. See attached screenshots.

    Perhaps it is a Windoze specific problem?

  It is almost certainly due to this change:

  2005-07-01  Jason Rumney  <jasonr@gnu.org>

    * w32term.c (cleartype_active): New flag for enabling sub-pixel
    workaround.
    (w32_initialize): Initialize it.
    (w32_native_per_char_metric): Allow a couple of extra pixels when
    Cleartype is active.

    * w32term.c (w32_initialize): Move check for screen reader here
    from syms_of_w32term.

  The history of this is:

  In Windows XP, "Cleartype" sub-pixel anti-aliasing was introduced. With
some fonts,
  this caused a garbaged display, since characters draw outside of their
advertised
  bounding box.

  In 21.3 I disabled the use of Cleartype in Emacs to avoid this problem,
but users
  complained, so a workaround of increasing the width of the bounding box by
one pixel
  left and right was installed. This should cause Emacs to always draw a
whole line at
  a time (after figuring out that characters on that line are overlapping),
which is
  the advice that Microsoft gives to avoid this problem.

  I guess the workaround must be adversely affecting the drawing of overlays
though -
  the extra two pixels being drawn on the background, but not detected when
it comes
  time to erase them.

Here's another piece of the puzzle (mentioned in my initial bug report): The
bug only appears if (setq-default indent-tabs-mode nil). If this is non-nil
there is no problem.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-04-24 16:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-01 19:24 two-pixel trace left when move overlay Drew Adams
2006-04-23 22:49 ` Kim F. Storm
2006-04-23 22:58   ` Drew Adams
2006-04-24  3:26   ` Eli Zaretskii
2006-04-24 10:45   ` Jason Rumney
2006-04-24 16:37     ` Drew Adams

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).