emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: Selecting region & setting point with mouse at left


From: Kim F. Storm
Subject: Re: address@hidden: Selecting region & setting point with mouse at left border]
Date: Tue, 11 Oct 2005 00:57:35 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

YAMAMOTO Mitsuharu <address@hidden> writes:

>>>>>> On Sun, 05 Jun 2005 23:46:36 +0200, address@hidden (Kim F. Storm) said:
>
>> I have tried to reproduce it on GNU/Linux, but it works for me.
>
>> I tried with the "variable-pitch" face, on a line with a ' as the
>> first character on a line -- and I can select it with the mouse
>> without problems.
>
>> So it seems to be a MAC specific problem.
>
> The problem seems to be solved by using remember_mouse_glyph instead
> of pixel_to_glyph_coords in XTmouse_position as in the W32 version.
> But this fix causes some problems that are also related to other
> platforms.
>
>   1. When I drag the mouse from the text area into the right edge of
>      the left fringe area, the beginning of the highlighted region is
>      advanced suddenly.  This can also be reproduced on X11.

I fixed this for drag into the fringe -- but dragging into the scrollbar
has bad effects too -- I'll look into this next.

>
>   2. It seems that glyph_rect does not calculate the correct area on
>      any platforms.  On X11, the area becomes outside the mouse
>      pointer.  On W32 and Mac, some adjustment for
>      WINDOW_LEFT_FRINGE_WIDTH is needed.  I tried to fix that on Mac
>      in the patch below, but it causes some problems:
>
>      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 just committed a trivial change to xterm.c which may have fixed
these problem for X11, but I haven't had time to test it yet.

A similar change should be made to other platforms, even if it doesn't
fix the problems.

*** xterm.c     10 Oct 2005 21:09:47 +0200      1.878
--- xterm.c     11 Oct 2005 00:27:24 +0200      
***************
*** 3647,3654 ****
    Lisp_Object window;
    struct window *w;
    struct glyph_row *r, *end_row;
  
!   window = window_from_coordinates (f, x, y, 0, &x, &y, 0);
    if (NILP (window))
      return 0;
  
--- 3647,3655 ----
    Lisp_Object window;
    struct window *w;
    struct glyph_row *r, *end_row;
+   enum window_part part;
  
!   window = window_from_coordinates (f, x, y, &part, &x, &y, 0);
    if (NILP (window))
      return 0;
  
***************
*** 3656,3661 ****
--- 3657,3665 ----
    r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
    end_row = r + w->current_matrix->nrows - 1;
  
+   if (part != ON_TEXT)
+     return 0;
+ 
    for (; r < end_row && r->enabled_p; ++r)
      {
        if (r->y >= y)




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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]