unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [hober0@bogus.example.com: Re: mode-line redisplay bug]
@ 2005-10-12 10:57 David PONCE
  2005-10-12 11:20 ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 12+ messages in thread
From: David PONCE @ 2005-10-12 10:57 UTC (permalink / raw)
  Cc: emacs-devel

Hi,

Since your last changes related to the mode-line redisplay bug
thread, help-echo messages on the header-line or the mode-line
are shown sporadically.

Just start emacs -Q and move the mouse on the mode-line, it is
difficult to make tool tips appear.  When I turn off tooltip-mode, I
see that messages in the echo area are cleared as soon as they appear.

On the tool bar tool tips and echo area messages appear normally.

Sincerely,
David

In GNU Emacs 22.0.50.2 (i686-pc-linux-gnu, GTK+ Version 2.4.14)
 of 2005-10-12 on localhost
X server distributor `The X.Org Foundation', version 11.0.60802000
configured using `configure '--with-gtk'

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: en_US.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

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

* Re: [hober0@bogus.example.com: Re: mode-line redisplay bug]
  2005-10-12 10:57 David PONCE
@ 2005-10-12 11:20 ` YAMAMOTO Mitsuharu
  2005-10-12 11:44   ` Kim F. Storm
  0 siblings, 1 reply; 12+ messages in thread
From: YAMAMOTO Mitsuharu @ 2005-10-12 11:20 UTC (permalink / raw)
  Cc: emacs-devel, storm

>>>>> On Wed, 12 Oct 2005 12:57:07 +0200 (CEST), David PONCE <david.ponce@wanadoo.fr> said:

> Since your last changes related to the mode-line redisplay bug
> thread, help-echo messages on the header-line or the mode-line are
> shown sporadically.

That's "Problem 2.1" in the thread.

>>>>> On Tue, 07 Jun 2005 18:45:48 +0900, YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> said:

>      2.1 Sometimes a tooltip is not shown.  I hope the first
>          fragment of the patch below fix this.

>      2.2 The value of last_mouse_glyph may become invalid.  For
>          example, after clicking the image on the splash screen,
>          dragging the area where the image was displayed does not
>          issue mouse-movement events.  I think last_mouse_glyph
>          should be cleared in some appropriate timing, but I'm not
>          sure when it is.

I installed the following change.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

Index: src/macterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macterm.c,v
retrieving revision 1.135
diff -c -r1.135 macterm.c
*** src/macterm.c	11 Oct 2005 22:35:40 -0000	1.135
--- src/macterm.c	12 Oct 2005 11:05:53 -0000
***************
*** 4193,4198 ****
--- 4193,4200 ----
        /* Remember which glyph we're now on.  */
        remember_mouse_glyph (frame, pos->h, pos->v, &last_mouse_glyph);
      }
+   else
+     help_echo_string = previous_help_echo_string;
  }
  
  \f
Index: src/w32term.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/w32term.c,v
retrieving revision 1.233
diff -c -r1.233 w32term.c
*** src/w32term.c	11 Oct 2005 22:36:35 -0000	1.233
--- src/w32term.c	12 Oct 2005 11:05:54 -0000
***************
*** 3238,3243 ****
--- 3238,3245 ----
  	 other times.  */
        remember_mouse_glyph (frame, mouse_x, mouse_y, &last_mouse_glyph);
      }
+   else
+     help_echo_string = previous_help_echo_string;
  }
  
  \f
Index: src/xterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xterm.c,v
retrieving revision 1.880
diff -c -r1.880 xterm.c
*** src/xterm.c	11 Oct 2005 22:37:01 -0000	1.880
--- src/xterm.c	12 Oct 2005 11:05:55 -0000
***************
*** 3610,3615 ****
--- 3610,3617 ----
        /* Remember which glyph we're now on.  */
        remember_mouse_glyph (frame, event->x, event->y, &last_mouse_glyph);
      }
+   else
+     help_echo_string = previous_help_echo_string;
  }
  
  \f

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

* Re: [hober0@bogus.example.com: Re: mode-line redisplay bug]
@ 2005-10-12 11:37 David PONCE
  0 siblings, 0 replies; 12+ messages in thread
From: David PONCE @ 2005-10-12 11:37 UTC (permalink / raw)
  Cc: storm, emacs-devel

>>Since your last changes related to the mode-line redisplay bug
>>thread, help-echo messages on the header-line or the mode-line are
>>shown sporadically.
> 
> 
> That's "Problem 2.1" in the thread.
> 
[...]
> 
> I installed the following change.
> 
[...]

It works fine now.  Thanks!

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

* Re: [hober0@bogus.example.com: Re: mode-line redisplay bug]
  2005-10-12 11:20 ` YAMAMOTO Mitsuharu
@ 2005-10-12 11:44   ` Kim F. Storm
  2005-10-12 12:52     ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 12+ messages in thread
From: Kim F. Storm @ 2005-10-12 11:44 UTC (permalink / raw)
  Cc: david.ponce, emacs-devel

YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:

>>      2.2 The value of last_mouse_glyph may become invalid.  For
>>          example, after clicking the image on the splash screen,
>>          dragging the area where the image was displayed does not
>>          issue mouse-movement events.  I think last_mouse_glyph
>>          should be cleared in some appropriate timing, but I'm not
>>          sure when it is.

I have just installed the following change to xterm.c, which seems to be
the proper fix for X:

2005-10-12  Kim F. Storm  <storm@cua.dk>

	* xterm.c (handle_one_xevent): Clear last_mouse_glyph on mouse up/down.


*** xterm.c	12 Oct 2005 13:18:14 +0200	1.881
--- xterm.c	12 Oct 2005 13:37:27 +0200	
***************
*** 6634,6639 ****
--- 6634,6640 ----
          int tool_bar_p = 0;
  
          bzero (&compose_status, sizeof (compose_status));
+ 	bzero (&last_mouse_glyph, sizeof (last_mouse_glyph));
  
          if (dpyinfo->grabbed
              && last_mouse_frame


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

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

* Re: [hober0@bogus.example.com: Re: mode-line redisplay bug]
@ 2005-10-12 11:47 David PONCE
  2005-10-12 12:22 ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 12+ messages in thread
From: David PONCE @ 2005-10-12 11:47 UTC (permalink / raw)
  Cc: storm, emacs-devel

Oops I spoke too fast.  Now I get the following message when the mouse is over
the read-only/modified status characters on the mode-line:

Error during redisplay: (wrong-type-argument window-live-p nil) [126 times]

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

* Re: [hober0@bogus.example.com: Re: mode-line redisplay bug]
  2005-10-12 11:47 David PONCE
@ 2005-10-12 12:22 ` YAMAMOTO Mitsuharu
  2005-10-12 13:42   ` Kim F. Storm
  0 siblings, 1 reply; 12+ messages in thread
From: YAMAMOTO Mitsuharu @ 2005-10-12 12:22 UTC (permalink / raw)
  Cc: storm, emacs-devel

>>>>> On Wed, 12 Oct 2005 13:47:58 +0200 (CEST), David PONCE <david.ponce@wanadoo.fr> said:

> Oops I spoke too fast.  Now I get the following message when the
> mouse is over the read-only/modified status characters on the
> mode-line:

> Error during redisplay: (wrong-type-argument window-live-p nil) [126
> times]

Sorry.  I've been using the patch for a long time, but I didn't notice
that.  The last change was backed out.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

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

* Re: [hober0@bogus.example.com: Re: mode-line redisplay bug]
  2005-10-12 11:44   ` Kim F. Storm
@ 2005-10-12 12:52     ` YAMAMOTO Mitsuharu
  2005-10-12 13:40       ` Kim F. Storm
  0 siblings, 1 reply; 12+ messages in thread
From: YAMAMOTO Mitsuharu @ 2005-10-12 12:52 UTC (permalink / raw)
  Cc: david.ponce, emacs-devel

>>>>> On Wed, 12 Oct 2005 13:44:43 +0200, storm@cua.dk (Kim F. Storm) said:

> I have just installed the following change to xterm.c, which seems to be
> the proper fix for X:

> 2005-10-12  Kim F. Storm  <storm@cua.dk>

> 	* xterm.c (handle_one_xevent): Clear last_mouse_glyph on mouse up/down.

Does it also work when the glyph under the mouse is changed while
grabbing a mouse button?

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

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

* Re: [hober0@bogus.example.com: Re: mode-line redisplay bug]
  2005-10-12 12:52     ` YAMAMOTO Mitsuharu
@ 2005-10-12 13:40       ` Kim F. Storm
  2005-10-13  8:21         ` YAMAMOTO Mitsuharu
  0 siblings, 1 reply; 12+ messages in thread
From: Kim F. Storm @ 2005-10-12 13:40 UTC (permalink / raw)
  Cc: david.ponce, emacs-devel

YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:

>>>>>> On Wed, 12 Oct 2005 13:44:43 +0200, storm@cua.dk (Kim F. Storm) said:
>
>> I have just installed the following change to xterm.c, which seems to be
>> the proper fix for X:
>
>> 2005-10-12  Kim F. Storm  <storm@cua.dk>
>
>> 	* xterm.c (handle_one_xevent): Clear last_mouse_glyph on mouse up/down.
>
> Does it also work when the glyph under the mouse is changed while
> grabbing a mouse button?

Not 100% -- it fails if it is a BIG glyph that changes to a smaller
glyph.

But how often does that happen?  Will anybody really notice?

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

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

* Re: [hober0@bogus.example.com: Re: mode-line redisplay bug]
  2005-10-12 12:22 ` YAMAMOTO Mitsuharu
@ 2005-10-12 13:42   ` Kim F. Storm
  2005-10-12 14:55     ` David Ponce
  2005-10-13  8:22     ` YAMAMOTO Mitsuharu
  0 siblings, 2 replies; 12+ messages in thread
From: Kim F. Storm @ 2005-10-12 13:42 UTC (permalink / raw)
  Cc: david.ponce, emacs-devel

YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:

>>>>>> On Wed, 12 Oct 2005 13:47:58 +0200 (CEST), David PONCE <david.ponce@wanadoo.fr> said:
>
>> Oops I spoke too fast.  Now I get the following message when the
>> mouse is over the read-only/modified status characters on the
>> mode-line:
>
>> Error during redisplay: (wrong-type-argument window-live-p nil) [126
>> times]
>
> Sorry.  I've been using the patch for a long time, but I didn't notice
> that.  The last change was backed out.

I think your change was pretty close to being ok.  Here is something
which seems to work for me on X -- maybe you can install it and adapt
it to W32 and MAC if it works for you too.

*** xterm.c	12 Oct 2005 14:42:03 +0200	1.883
--- xterm.c	12 Oct 2005 15:26:41 +0200	
***************
*** 3582,3588 ****
  static XMotionEvent last_mouse_motion_event;
  static Lisp_Object last_mouse_motion_frame;
  
! static void
  note_mouse_movement (frame, event)
       FRAME_PTR frame;
       XMotionEvent *event;
--- 3582,3588 ----
  static XMotionEvent last_mouse_motion_event;
  static Lisp_Object last_mouse_motion_frame;
  
! static int
  note_mouse_movement (frame, event)
       FRAME_PTR frame;
       XMotionEvent *event;
***************
*** 3596,3605 ****
        frame->mouse_moved = 1;
        last_mouse_scroll_bar = Qnil;
        note_mouse_highlight (frame, -1, -1);
      }
  
    /* Has the mouse moved off the glyph it was on at the last sighting?  */
!   else if (event->x < last_mouse_glyph.x
  	   || event->x >= last_mouse_glyph.x + last_mouse_glyph.width
  	   || event->y < last_mouse_glyph.y
  	   || event->y >= last_mouse_glyph.y + last_mouse_glyph.height)
--- 3596,3606 ----
        frame->mouse_moved = 1;
        last_mouse_scroll_bar = Qnil;
        note_mouse_highlight (frame, -1, -1);
+       return 1;
      }
  
    /* Has the mouse moved off the glyph it was on at the last sighting?  */
!   if (event->x < last_mouse_glyph.x
  	   || event->x >= last_mouse_glyph.x + last_mouse_glyph.width
  	   || event->y < last_mouse_glyph.y
  	   || event->y >= last_mouse_glyph.y + last_mouse_glyph.height)
***************
*** 3609,3615 ****
--- 3610,3619 ----
        note_mouse_highlight (frame, event->x, event->y);
        /* Remember which glyph we're now on.  */
        remember_mouse_glyph (frame, event->x, event->y, &last_mouse_glyph);
+       return 1;
      }
+ 
+   return 0;
  }
  
  \f
***************
*** 6483,6490 ****
      case MotionNotify:
        {
          previous_help_echo_string = help_echo_string;
!         help_echo_string = help_echo_object = help_echo_window = Qnil;
!         help_echo_pos = -1;
  
          if (dpyinfo->grabbed && last_mouse_frame
              && FRAME_LIVE_P (last_mouse_frame))
--- 6487,6493 ----
      case MotionNotify:
        {
          previous_help_echo_string = help_echo_string;
!         help_echo_string = Qnil;
  
          if (dpyinfo->grabbed && last_mouse_frame
              && FRAME_LIVE_P (last_mouse_frame))
***************
*** 6523,6529 ****
  
                  last_window=window;
                }
!             note_mouse_movement (f, &event.xmotion);
            }
          else
            {
--- 6526,6533 ----
  
                  last_window=window;
                }
!             if (!note_mouse_movement (f, &event.xmotion))
! 	      help_echo_string = previous_help_echo_string;
            }
          else
            {

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

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

* Re: [hober0@bogus.example.com: Re: mode-line redisplay bug]
  2005-10-12 13:42   ` Kim F. Storm
@ 2005-10-12 14:55     ` David Ponce
  2005-10-13  8:22     ` YAMAMOTO Mitsuharu
  1 sibling, 0 replies; 12+ messages in thread
From: David Ponce @ 2005-10-12 14:55 UTC (permalink / raw)
  Cc: YAMAMOTO Mitsuharu, emacs-devel

> I think your change was pretty close to being ok.  Here is something
> which seems to work for me on X -- maybe you can install it and adapt
> it to W32 and MAC if it works for you too.

It works perfectly for me too.  Thanks!

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

* Re: [hober0@bogus.example.com: Re: mode-line redisplay bug]
  2005-10-12 13:40       ` Kim F. Storm
@ 2005-10-13  8:21         ` YAMAMOTO Mitsuharu
  0 siblings, 0 replies; 12+ messages in thread
From: YAMAMOTO Mitsuharu @ 2005-10-13  8:21 UTC (permalink / raw)
  Cc: david.ponce, emacs-devel

>>>>> On Wed, 12 Oct 2005 15:40:50 +0200, storm@cua.dk (Kim F. Storm) said:

>>> * xterm.c (handle_one_xevent): Clear last_mouse_glyph on mouse
>>> up/down.
>> 
>> Does it also work when the glyph under the mouse is changed while
>> grabbing a mouse button?

> Not 100% -- it fails if it is a BIG glyph that changes to a smaller
> glyph.

> But how often does that happen?  Will anybody really notice?

It is very rare.  But Emacs Lisp developers will be confused if they
encounter such a situation.  Another rare case would be such that
mouse tracking is not initiated by a mouse button on/off.

BTW, it might be better not to remember last_mouse_glyph (make it
empty) when the glyph under the mouse is an image.  It may have
multiple help strings via hot-spot areas.  And because usually a big
glyph is an image, that would lower the possibility of anomaly above.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

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

* Re: [hober0@bogus.example.com: Re: mode-line redisplay bug]
  2005-10-12 13:42   ` Kim F. Storm
  2005-10-12 14:55     ` David Ponce
@ 2005-10-13  8:22     ` YAMAMOTO Mitsuharu
  1 sibling, 0 replies; 12+ messages in thread
From: YAMAMOTO Mitsuharu @ 2005-10-13  8:22 UTC (permalink / raw)
  Cc: david.ponce, emacs-devel

>>>>> On Wed, 12 Oct 2005 15:42:31 +0200, storm@cua.dk (Kim F. Storm) said:

> I think your change was pretty close to being ok.  Here is something
> which seems to work for me on X -- maybe you can install it and
> adapt it to W32 and MAC if it works for you too.

The same change seems to work for Mac, too.  Thanks.  I'm not sure
about W32: it looks slightly different from others (help_echo_string
is not cleared before note_mouse_movement is called).

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

Index: src/macterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macterm.c,v
retrieving revision 1.137
diff -c -r1.137 macterm.c
*** src/macterm.c	12 Oct 2005 12:18:18 -0000	1.137
--- src/macterm.c	13 Oct 2005 08:04:17 -0000
***************
*** 4149,4155 ****
  static Point last_mouse_motion_position;
  static Lisp_Object last_mouse_motion_frame;
  
! static void
  note_mouse_movement (frame, pos)
       FRAME_PTR frame;
       Point *pos;
--- 4149,4155 ----
  static Point last_mouse_motion_position;
  static Lisp_Object last_mouse_motion_frame;
  
! static int
  note_mouse_movement (frame, pos)
       FRAME_PTR frame;
       Point *pos;
***************
*** 4180,4198 ****
  	    rif->define_frame_cursor (frame,
  				      frame->output_data.mac->nontext_cursor);
  	}
      }
    /* Has the mouse moved off the glyph it was on at the last sighting?  */
!   else if (pos->h < last_mouse_glyph.left
! 	   || pos->h >= last_mouse_glyph.right
! 	   || pos->v < last_mouse_glyph.top
! 	   || pos->v >= last_mouse_glyph.bottom)
      {
        frame->mouse_moved = 1;
        last_mouse_scroll_bar = Qnil;
        note_mouse_highlight (frame, pos->h, pos->v);
        /* Remember which glyph we're now on.  */
        remember_mouse_glyph (frame, pos->h, pos->v, &last_mouse_glyph);
      }
  }
  
  \f
--- 4180,4201 ----
  	    rif->define_frame_cursor (frame,
  				      frame->output_data.mac->nontext_cursor);
  	}
+       return 1;
      }
    /* Has the mouse moved off the glyph it was on at the last sighting?  */
!   if (pos->h < last_mouse_glyph.left
!       || pos->h >= last_mouse_glyph.right
!       || pos->v < last_mouse_glyph.top
!       || pos->v >= last_mouse_glyph.bottom)
      {
        frame->mouse_moved = 1;
        last_mouse_scroll_bar = Qnil;
        note_mouse_highlight (frame, pos->h, pos->v);
        /* Remember which glyph we're now on.  */
        remember_mouse_glyph (frame, pos->h, pos->v, &last_mouse_glyph);
+       return 1;
      }
+   return 0;
  }
  
  \f
***************
*** 10031,10038 ****
  			  er.where.h + 1, er.where.v + 1);
  #endif
  	      previous_help_echo_string = help_echo_string;
! 	      help_echo_string = help_echo_object = help_echo_window = Qnil;
! 	      help_echo_pos = -1;
  
  	      if (dpyinfo->grabbed && last_mouse_frame
  		  && FRAME_LIVE_P (last_mouse_frame))
--- 10034,10040 ----
  			  er.where.h + 1, er.where.v + 1);
  #endif
  	      previous_help_echo_string = help_echo_string;
! 	      help_echo_string = Qnil;
  
  	      if (dpyinfo->grabbed && last_mouse_frame
  		  && FRAME_LIVE_P (last_mouse_frame))
***************
*** 10091,10097 ****
  
  			  last_window=window;
  			}
! 		      note_mouse_movement (f, &mouse_pos);
  		    }
  		}
  
--- 10093,10100 ----
  
  			  last_window=window;
  			}
! 		      if (!note_mouse_movement (f, &mouse_pos))
! 			help_echo_string = previous_help_echo_string;
  		    }
  		}

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

end of thread, other threads:[~2005-10-13  8:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-12 11:37 [hober0@bogus.example.com: Re: mode-line redisplay bug] David PONCE
  -- strict thread matches above, loose matches on Subject: below --
2005-10-12 11:47 David PONCE
2005-10-12 12:22 ` YAMAMOTO Mitsuharu
2005-10-12 13:42   ` Kim F. Storm
2005-10-12 14:55     ` David Ponce
2005-10-13  8:22     ` YAMAMOTO Mitsuharu
2005-10-12 10:57 David PONCE
2005-10-12 11:20 ` YAMAMOTO Mitsuharu
2005-10-12 11:44   ` Kim F. Storm
2005-10-12 12:52     ` YAMAMOTO Mitsuharu
2005-10-12 13:40       ` Kim F. Storm
2005-10-13  8:21         ` YAMAMOTO Mitsuharu

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