From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Click event bug? (was Re: Moving vertical...) Date: Mon, 17 Apr 2006 01:21:24 +0200 Message-ID: References: <17469.43275.607125.519058@farnswood.snap.net.nz> <17470.47548.900457.675152@farnswood.snap.net.nz> <17470.57240.732675.481013@farnswood.snap.net.nz> <17473.31989.341928.580537@farnswood.snap.net.nz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1145229835 23235 80.91.229.2 (16 Apr 2006 23:23:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 16 Apr 2006 23:23:55 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 17 01:23:53 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FVGan-0005kh-RY for ged-emacs-devel@m.gmane.org; Mon, 17 Apr 2006 01:23:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FVGan-0003oQ-8r for ged-emacs-devel@m.gmane.org; Sun, 16 Apr 2006 19:23:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FVGaZ-0003oC-Nx for emacs-devel@gnu.org; Sun, 16 Apr 2006 19:23:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FVGaY-0003nk-FO for emacs-devel@gnu.org; Sun, 16 Apr 2006 19:23:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FVGaY-0003nh-BA for emacs-devel@gnu.org; Sun, 16 Apr 2006 19:23:30 -0400 Original-Received: from [195.41.46.235] (helo=pfepa.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FVGb3-0000jK-1I; Sun, 16 Apr 2006 19:24:01 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepa.post.tele.dk (Postfix) with SMTP id DF430FAC006; Mon, 17 Apr 2006 01:23:24 +0200 (CEST) Original-To: Nick Roberts In-Reply-To: <17473.31989.341928.580537@farnswood.snap.net.nz> (Nick Roberts's message of "Sun, 16 Apr 2006 11:08:37 +1200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52929 Archived-At: Nick Roberts 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 http://www.cua.dk