emacs-devel
[Top][All Lists]
Advanced

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

Re: Click event bug? (was Re: Moving vertical...)


From: Kim F. Storm
Subject: Re: Click event bug? (was Re: Moving vertical...)
Date: Mon, 17 Apr 2006 01:21:24 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Nick Roberts <address@hidden> writes:

>  >     I think this is because the click event on the vertical line returns 
> the
>  >     column number measured from the top of the frame instead of the top of
>        ^^^^^^
>  I meant row number.
>
>  >     the window.
>  > 
>  > Could you fix it?
>
> I'm hoping Kim will look at it.

Does this patch do what you need?


Index: window.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/window.c,v
retrieving revision 1.540
diff -c -r1.540 window.c
*** window.c    20 Mar 2006 22:22:25 -0000      1.540
--- window.c    16 Apr 2006 23:22:02 -0000
***************
*** 661,672 ****
          || WINDOW_RIGHTMOST_P (w))
        {
          if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width)
!           return ON_VERTICAL_BORDER;
        }
        else
        {
          if (abs (*x - x1) < grabbable_width)
!           return ON_VERTICAL_BORDER;
        }
  
        if (*x < x0 || *x >= x1)
--- 661,680 ----
          || WINDOW_RIGHTMOST_P (w))
        {
          if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width)
!           {
!             *x = max (0, *x - x0);
!             *y -= top_y;
!             return ON_VERTICAL_BORDER;
!           }
        }
        else
        {
          if (abs (*x - x1) < grabbable_width)
!           {
!             *x = min (x1, *x) - x0;
!             *y -= top_y;
!             return ON_VERTICAL_BORDER;
!           }
        }
  
        if (*x < x0 || *x >= x1)
***************
*** 708,714 ****
          && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
          && !WINDOW_RIGHTMOST_P (w)
          && (abs (*x - right_x) < grabbable_width))
!       return ON_VERTICAL_BORDER;
      }
    else
      {
--- 716,726 ----
          && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
          && !WINDOW_RIGHTMOST_P (w)
          && (abs (*x - right_x) < grabbable_width))
!       {
!         *x = min (right_x, *x) - left_x;
!         *y -= top_y;
!         return ON_VERTICAL_BORDER;
!       }
      }
    else
      {
***************
*** 720,725 ****
--- 732,739 ----
        {
          /* On the border on the right side of the window?  Assume that
             this area begins at RIGHT_X minus a canonical char width.  */
+         *x = min (right_x, *x) - left_x;
+         *y -= top_y;
          return ON_VERTICAL_BORDER;
        }
      }

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





reply via email to

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