From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#998: after split-window-horizontally scroll works only on first window Date: Tue, 30 Sep 2008 10:58:16 +0200 Message-ID: <48E1EA28.50100@gmx.at> References: <20080918134412.GH3430@zinosat.homelinux.com> <48D29A54.2050605@gmx.at> <20080919065012.GI3430@zinosat.homelinux.com> <48D34E41.9090301@gmx.at> <20080919073544.GJ3430@zinosat.homelinux.com> <48D365FB.8010007@gmx.at> <20080919112310.GK3430@zinosat.homelinux.com> <48DA09D9.9010407@gmx.at> <20080929132643.GB14199@zinosat.homelinux.com> Reply-To: martin rudalics , 998@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040100050800090804070209" X-Trace: ger.gmane.org 1222767021 21452 80.91.229.12 (30 Sep 2008 09:30:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Sep 2008 09:30:21 +0000 (UTC) Cc: Davide Viti To: 998@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 30 11:31:10 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KkbZV-00040N-RF for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Sep 2008 11:31:10 +0200 Original-Received: from localhost ([127.0.0.1]:39013 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkbYS-0007UF-IA for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Sep 2008 05:30:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KkbYN-0007U2-SZ for bug-gnu-emacs@gnu.org; Tue, 30 Sep 2008 05:29:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KkbYN-0007Tq-3S for bug-gnu-emacs@gnu.org; Tue, 30 Sep 2008 05:29:59 -0400 Original-Received: from [199.232.76.173] (port=35843 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KkbYM-0007Tf-Ro for bug-gnu-emacs@gnu.org; Tue, 30 Sep 2008 05:29:58 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:34040) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KkbYM-00054X-T0 for bug-gnu-emacs@gnu.org; Tue, 30 Sep 2008 05:29:59 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8U9Ttlw000784; Tue, 30 Sep 2008 02:29:55 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m8U9A4Rm028676; Tue, 30 Sep 2008 02:10:04 -0700 X-Loop: don@donarmstrong.com Resent-From: martin rudalics Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 30 Sep 2008 09:10:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 998 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 998-submit@emacsbugs.donarmstrong.com id=B998.122276528226594 (code B ref 998); Tue, 30 Sep 2008 09:10:04 +0000 Original-Received: (at 998) by emacsbugs.donarmstrong.com; 30 Sep 2008 09:01:22 +0000 Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m8U91IWr026584 for <998@emacsbugs.donarmstrong.com>; Tue, 30 Sep 2008 02:01:20 -0700 Original-Received: (qmail invoked by alias); 30 Sep 2008 09:01:12 -0000 Original-Received: from 62-47-51-10.adsl.highway.telekom.at (EHLO [62.47.51.10]) [62.47.51.10] by mail.gmx.net (mp040) with SMTP; 30 Sep 2008 11:01:12 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+t7uEMl9KtwnT49OXCPYI+7HvmeC39lWvckqcY/a rZ7/htlu1vUmQ1 User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) In-Reply-To: <20080929132643.GB14199@zinosat.homelinux.com> X-Y-GMX-Trusted: 0 X-FuHaFi: 0.82,0.58 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Tue, 30 Sep 2008 05:29:59 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:20897 Archived-At: This is a multi-part message in MIME format. --------------040100050800090804070209 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > it does fix the problem! OK. So I could install the attached patch. Any objections? martin --------------040100050800090804070209 Content-Type: text/plain; name="998.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="998.diff" *** scroll-bar.el.~1.59.~ 2008-05-06 09:57:49.000000000 +0200 --- scroll-bar.el 2008-09-30 08:56:36.312500000 +0200 *************** *** 295,300 **** --- 295,311 ---- =20 =0C ;;; Tookit scroll bars. + (defcustom scroll-bar-resample-mouse-position nil + "Non-nil means re-sample mouse position when scrolling. + When your mouse-wheel scrolls the wrong window, setting this to + non-nil might help. The mouse cursor must be within the window + you want to scroll in order for this to take effect. +=20 + This option works for toolkit scrollbars only." + :type 'boolean + :group 'frames + :group 'mouse + :version "23.1") =20 (defun scroll-bar-toolkit-scroll (event) (interactive "e") *************** *** 302,341 **** (window (nth 0 end-position)) (part (nth 4 end-position)) before-scroll) ! (cond ((eq part 'end-scroll)) ! (t ! (with-current-buffer (window-buffer window) ! (setq before-scroll point-before-scroll)) ! (save-selected-window ! (select-window window) ! (setq before-scroll (or before-scroll (point))) ! (cond ((eq part 'above-handle) ! (scroll-up '-)) ! ((eq part 'below-handle) ! (scroll-up nil)) ! ((eq part 'ratio) ! (let* ((portion-whole (nth 2 end-position)) ! (lines (scroll-bar-scale portion-whole ! (1- (window-height))))) ! (scroll-up (cond ((not (zerop lines)) lines) ! ((< (car portion-whole) 0) -1) ! (t 1))))) ! ((eq part 'up) ! (scroll-up -1)) ! ((eq part 'down) ! (scroll-up 1)) ! ((eq part 'top) ! (set-window-start window (point-min))) ! ((eq part 'bottom) ! (goto-char (point-max)) ! (recenter)) ! ((eq part 'handle) ! (scroll-bar-drag-1 event)))) ! (sit-for 0) ! (with-current-buffer (window-buffer window) ! (setq point-before-scroll before-scroll)))))) !=20 !=20 =0C ;;;; Bindings. =20 --- 313,361 ---- (window (nth 0 end-position)) (part (nth 4 end-position)) before-scroll) ! (when scroll-bar-resample-mouse-position ! ;; With some mouse drivers the window reported in EVENT might not= ! ;; be valid, see Bug#998. Here we re-sample the mouse position i= n ! ;; the hope to get a more suitable window. ! (condition-case nil ! (let* ((mouse-position (mouse-position)) ! (mouse-window ! (window-at (cadr mouse-position) ! (cddr mouse-position) ! (car mouse-position)))) ! (when (window-live-p mouse-window) ! (setq window mouse-window))) ! (error nil))) !=20 ! (unless (eq part 'end-scroll) ! (with-selected-window window ! (setq before-scroll (or point-before-scroll (point))) ! (cond ! ((eq part 'above-handle) ! (scroll-up '-)) ! ((eq part 'below-handle) ! (scroll-up nil)) ! ((eq part 'ratio) ! (let* ((portion-whole (nth 2 end-position)) ! (lines (scroll-bar-scale portion-whole ! (1- (window-height))))) ! (scroll-up (cond ((not (zerop lines)) lines) ! ((< (car portion-whole) 0) -1) ! (t 1))))) ! ((eq part 'up) ! (scroll-up -1)) ! ((eq part 'down) ! (scroll-up 1)) ! ((eq part 'top) ! (set-window-start window (point-min))) ! ((eq part 'bottom) ! (goto-char (point-max)) ! (recenter)) ! ((eq part 'handle) ! (scroll-bar-drag-1 event)))) ! (sit-for 0) ! (with-current-buffer (window-buffer window) ! (setq point-before-scroll before-scroll))))) =0C ;;;; Bindings. =20 --------------040100050800090804070209--