From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: NS port horizontal scroll-bars Date: Tue, 26 Apr 2016 20:27:35 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <20160424160123.GA37657@breton.local> <20160425203420.GA37698@breton.local> <571F0C30.6080100@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1461670077 11302 80.91.229.3 (26 Apr 2016 11:27:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Apr 2016 11:27:57 +0000 (UTC) Cc: martin rudalics , Anders Lindgren , emacs-devel To: Alan Third Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Apr 26 13:27:49 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1av19g-0004RP-Jy for ged-emacs-devel@m.gmane.org; Tue, 26 Apr 2016 13:27:48 +0200 Original-Received: from localhost ([::1]:37549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av19f-0002Zv-Uh for ged-emacs-devel@m.gmane.org; Tue, 26 Apr 2016 07:27:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av19b-0002X3-OZ for emacs-devel@gnu.org; Tue, 26 Apr 2016 07:27:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1av19X-0008Sn-Jd for emacs-devel@gnu.org; Tue, 26 Apr 2016 07:27:43 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:56372) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1av19X-0008S6-48 for emacs-devel@gnu.org; Tue, 26 Apr 2016 07:27:39 -0400 Original-Received: from fermat1.math.s.chiba-u.ac.jp (fermat [192.168.32.10]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 6C6D9F08DD; Tue, 26 Apr 2016 20:27:35 +0900 (JST) (envelope-from mituharu@math.s.chiba-u.ac.jp) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 133.82.132.2 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:203329 Archived-At: >>>>> On Tue, 26 Apr 2016 10:51:57 +0100, Alan Third said: > It's actually the other end of the process that I'm struggling > with. I write pixel values for dragging the scroll-bar into an > emacs_event struct (location of mouse in scroll-bar and total length > of scroll-bar), and when that data pops back out in scroll-bar.el it > doesn't seem to be any use to the standard scroll-bar functions. Ah, that reminds me of something. You can see how the Mac port handles that (in the `work' branch based on Emacs 25.0.93 pretest). https://bitbucket.org/mituharu/emacs-mac/src/472fe59bac472a9076cbb6e86e0ea92908f7b78d/src/macappkit.m?at=work&fileviewer=file-view-default#macappkit.m-6002 6690 if (bar->horizontal && whole > 0) 6691 { 6692 /* The default horizontal scroll bar drag handler assumes 6693 previously-set `whole' value to be preserved and doesn't 6694 want overscrolling. */ 6695 int position = lround (whole * minEdge / maximum); 6696 6697 if (position > whole - portion) 6698 position = whole - portion; 6699 XSETINT (inputEvent.x, position); 6700 XSETINT (inputEvent.y, whole); 6701 } 6702 else 6703 { 6704 XSETINT (inputEvent.x, minEdge); 6705 XSETINT (inputEvent.y, maximum); 6706 } 6707 } > The vertical scroll-bars in the NS port have their own functions > defined in ns-win.el, rather than using the functions in > scroll-bar.el. I think this is, at least in part, to enable clicking > directional arrows in older versions of OS X (and GNUSTEP), but it's > doing something different with dragging too. The Mac port (and its predecessors) has been using the standard toolkit scroll bar handler in scroll-bar.el as it is, and there has been no problem even in the old OS X versions having the directional arrows. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp