bug#3347: 23.0.93; unnecessary display updates with mouse-drag-region

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#3347: 23.0.93; unnecessary display updates with mouse-drag-region

YAMAMOTO Mitsuharu
Mouse dragging over a text in the default face causes unnecessary
updates in other windows displaying the same buffer.

Steps to reproduce:

  1. Invoke "Quartz Debug.app" on Mac OS X and check the "Flash screen
     updates" button.
  2. $ emacs -Q -D
  3. C-x 2
  4. Drag the mouse over the *scratch* buffer text in the first
     window.

Result:

  The text not only in the first window but also the other one is
  flashed whereas the latter doesn't need updates.  The flashed area
  corresponds to the extended/shrunken part of the region in the first
  window.

The updates in the second window do not happen if the text is in
non-default face (e.g., start with "emacs -Q" instead of "emacs -Q
-D").

I can't observe this phenomenon on Emacs 22.3.

                                     YAMAMOTO Mitsuharu
                                [hidden email]

In GNU Emacs 23.0.93.1 (powerpc-apple-darwin9.6.0, X toolkit)
 of 2009-05-22 on yamamoto-mitsuharu-no-power-mac-g5.local
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure  '--without-jpeg' '--without-gif' '--without-tiff''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ja_JP.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t




Reply | Threaded
Open this post in threaded view
|

bug#3347: 23.0.93; unnecessary display updates with mouse-drag-region

YAMAMOTO Mitsuharu
>>>>> On Fri, 22 May 2009 11:54:58 +0900, YAMAMOTO Mitsuharu <[hidden email]> said:

> Mouse dragging over a text in the default face causes unnecessary
> updates in other windows displaying the same buffer.

> Steps to reproduce:

>   1. Invoke "Quartz Debug.app" on Mac OS X and check the "Flash screen
>      updates" button.
>   2. $ emacs -Q -D
>   3. C-x 2
>   4. Drag the mouse over the *scratch* buffer text in the first
>      window.

> Result:

>   The text not only in the first window but also the other one is
>   flashed whereas the latter doesn't need updates.  The flashed area
>   corresponds to the extended/shrunken part of the region in the first
>   window.

> The updates in the second window do not happen if the text is in
> non-default face (e.g., start with "emacs -Q" instead of "emacs -Q
> -D").

> I can't observe this phenomenon on Emacs 22.3.

I tried some older versions and found that the change below made the
difference.

                                     YAMAMOTO Mitsuharu
                                [hidden email]

2008-07-08  Chong Yidong  <[hidden email]>

        * xfaces.c (Finternal_merge_in_global_face): Save merged
        attributes for the default face back into the face vector.

--- xfaces.c 2008/07/06 03:51:06 1.404
+++ xfaces.c 2008/07/08 17:27:28 1.405
@@ -3966,7 +3966,7 @@
     else if (! UNSPECIFIEDP (gvec[i]))
       lvec[i] = gvec[i];
 
-  /* If the default face was changed, realize it again, and update the
+  /* If the default face was changed, update the face cache and the
      `font' frame parameter.  */
   if (EQ (face, Qdefault))
     {
@@ -3977,9 +3977,12 @@
       /* This can be NULL (e.g., in batch mode).  */
       if (oldface)
  {
+  /* Ensure that the face vector is fully specified by merging
+     the previously-cached vector.  */
   bcopy (oldface->lface, attrs, sizeof attrs);
   merge_face_vectors (f, lvec, attrs, 0);
-  newface = realize_face (c, attrs, DEFAULT_FACE_ID);
+  bcopy (attrs, lvec, sizeof attrs);
+  newface = realize_face (c, lvec, DEFAULT_FACE_ID);
 
   if ((! UNSPECIFIEDP (gvec[LFACE_FAMILY_INDEX])
        || ! UNSPECIFIEDP (gvec[LFACE_FOUNDRY_INDEX])



Reply | Threaded
Open this post in threaded view
|

bug#3347: 23.0.93; unnecessary display updates with mouse-drag-region

Lars Ingebrigtsen
In reply to this post by YAMAMOTO Mitsuharu
YAMAMOTO Mitsuharu <[hidden email]> writes:

> Mouse dragging over a text in the default face causes unnecessary
> updates in other windows displaying the same buffer.
>
> Steps to reproduce:
>
>   1. Invoke "Quartz Debug.app" on Mac OS X and check the "Flash screen
>      updates" button.
>   2. $ emacs -Q -D
>   3. C-x 2
>   4. Drag the mouse over the *scratch* buffer text in the first
>      window.

(This was 11 years ago.)

The Quartz Debug app doesn't seem to exist on Macos any more, so I'm
unable to try the recipe.

Do you still see this problem in more recent versions of Emacs?

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



Reply | Threaded
Open this post in threaded view
|

bug#3347: 23.0.93; unnecessary display updates with mouse-drag-region

YAMAMOTO Mitsuharu
On Mon, 14 Sep 2020 23:44:39 +0900,
Lars Ingebrigtsen wrote:

>
> YAMAMOTO Mitsuharu <[hidden email]> writes:
>
> > Mouse dragging over a text in the default face causes unnecessary
> > updates in other windows displaying the same buffer.
> >
> > Steps to reproduce:
> >
> >   1. Invoke "Quartz Debug.app" on Mac OS X and check the "Flash screen
> >      updates" button.
> >   2. $ emacs -Q -D
> >   3. C-x 2
> >   4. Drag the mouse over the *scratch* buffer text in the first
> >      window.
>
> (This was 11 years ago.)
>
> The Quartz Debug app doesn't seem to exist on Macos any more, so I'm
> unable to try the recipe.

It is now included in "Additional Tools for Xcode", which can be
downloaded from https://developer.apple.com/download/more/ (You might
need to sign in with your Apple ID.)


> Do you still see this problem in more recent versions of Emacs?

Yes, but you need to disable double-buffering with
(set-frame-paremter nil 'inhibit-double-buffering t) .
Otherwise, Quartz Debug thinks the whole frame is updated.

                                     YAMAMOTO Mitsuharu
                                [hidden email]