From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Changes in frame/window code Date: Mon, 18 Aug 2014 18:00:56 +0300 Message-ID: <83lhqldeqf.fsf@gnu.org> References: <53CE6A44.1010708@gmx.at> <83fvhlhad5.fsf@gnu.org> <53D656BB.3010201@gmx.at> <83egx5h86z.fsf@gnu.org> <53D68806.9080101@gmx.at> <838undgxiu.fsf@gnu.org> <53D76758.2030707@gmx.at> <831tt4h58x.fsf@gnu.org> <83y4vcfoqi.fsf@gnu.org> <53D77BDB.1090500@gmx.at> <83wqawflgj.fsf@gnu.org> <53D7A981.30909@gmx.at> <83lhrctdzr.fsf@gnu.org> <53D7C10C.4010402@gmx.at> <83k36wta5m.fsf@gnu.org> <53D7E6B0.7040504@gmx.at> <83egx4t3nq.fsf@gnu.org> <53D917B5.2050604@gmx.at> <837g2uu80w.fsf@gnu.org> <53D9211C.7010000@gmx.at> <834mxyu5jg.fsf@gnu.org> <53D92D04.3010006@gmx.at> <83zjfqspfw.fsf@gnu.org> <53DA0310.4010706@gmx.at> <53DA15C4.5050006@gmx.at> <83mwbpss6s.fsf@gnu.org> <53DA29EC.3000504@gmx.at> <837g2ssg30.fsf@gnu.org> <53DB6B08.7000305@gmx.at> <834mxws6a0.fsf@gnu.org> <53DBB268.2020909@gmx.at> <831tt0rwyp.fsf@gnu.org> <53EE2CD5.50603@gmx.a> <83tx5demej.fsf@gnu.org> <53EF25F2.9010909@gmx.at> <83iolsekqd.fsf@gnu.org> <53EF609C.2090303@gmx> <83wqa7cfoy.fsf@gnu.org> <53F1B9EA.6030808@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1408374104 14732 80.91.229.3 (18 Aug 2014 15:01:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Aug 2014 15:01:44 +0000 (UTC) Cc: emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 18 17:01:36 2014 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 1XJOR8-00021e-HV for ged-emacs-devel@m.gmane.org; Mon, 18 Aug 2014 17:01:30 +0200 Original-Received: from localhost ([::1]:44224 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJOR8-0002We-4n for ged-emacs-devel@m.gmane.org; Mon, 18 Aug 2014 11:01:30 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJOQr-0002Er-Vo for emacs-devel@gnu.org; Mon, 18 Aug 2014 11:01:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJOQk-0007dw-UV for emacs-devel@gnu.org; Mon, 18 Aug 2014 11:01:12 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:54748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJOQk-0007dY-H3 for emacs-devel@gnu.org; Mon, 18 Aug 2014 11:01:06 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0NAI00700CCRF900@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Mon, 18 Aug 2014 18:01:04 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAI0064GCDSQK80@a-mtaout22.012.net.il>; Mon, 18 Aug 2014 18:01:04 +0300 (IDT) In-reply-to: <53F1B9EA.6030808@gmx.at> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173743 Archived-At: > Date: Mon, 18 Aug 2014 10:31:38 +0200 > From: martin rudalics > CC: emacs-devel@gnu.org > > >> (1) When dragging I cannot move the slider entirely to the right and > >> make the first column of R2L lines visible until I release the mouse > >> button. I suppose this is due to some off-by-one failure here but > >> there might be more to it. > > > > I'm not sure this is at all related to R2L lines. I wrote a trivial > > function which just displays the mouse event, and bound it to clicks > > on the horizontal scroll bar. When I drag the scroll bar, even in an > > entirely L2R buffer, I see some strange phenomena: e.g., more often > > than not, when I drag the bar all the way to the right, releasing the > > mouse button without moving the mouse reports slightly different > > coordinates than the ones reported before releasing the mouse. > > Moreover, many time the 2nd coordinate reported after releasing the > > mouse is -1. Try it. Maybe it's Windows-specific, I don't know. > > I suppose the -1 is due to the > > si.nPage = min (portion, si.nMax) + 1; > > you mention below and that's likely the culprit for the effect described > in (1). Perhaps, but it's still unclear to me why this problem is not visible in L2R buffers. > > Btw, it looks like the information returned by mouse events on the > > horizontal scroll bar is not described anywhere, not even in NEWS. > > Your use of (cdr (nth 2 start-position)) in > > scroll-bar-horizontal-drag-1 got my jaw dropped for a few seconds, > > before I realized it was not the Y coordinate... > > I'm not sure yet where to eventually put this and whether it's the right > solution at all. IIUC the scroll bar area on the right of the thumb stands > for w->hscroll in R2L text and this was the easiest way to pass on that > value from what GetScrollInfo returns without consing. If you have any > suggestion how to handle this cleanly I'd be all ears. I don't think your solution is unclean (the Y coordinate makes no sense for horizontal scroll bar events), I just wish it were documented, at least in NEWS. It doesn't take more than a few lines. > >> (2) Sometimes during dragging the slider starts moving for-/backward in > >> some erratic fashion. I'm not yet sure whether this is caused by an > >> hmargin issue or something else. > > > > I could only see this in the very first line of the tutorial. There > > was an old and very subtle bug in xdisp.c, revealed by > > set_horizontal_scroll_bar, which caused broken cursor motion in that > > line. This is now fixed in r117711 on the trunk. If you still see > > something like that, and it's not related to the few L2R lines in the > > tutorial, please report a bug with the recipe. > > I can see it only with my personal setup here. With emacs -Q I can > reproduce it by setting > > (set-frame-parameter nil 'right-divider-width 7) > > and scrolling the tutorial in the left window of a C-x 3 split frame. On Windows XP, I cannot see this at all. On Windows 7, I always see this on the 1st line of the tutorial, even without setting right-divider-width, and I see it when point is on most (but not all, see below) lines if I do set right-divider-width. Alas, I'm not your guy in these matters, as I'm clueless as to GUI programming in general and Windows GUI in particular. So I just sprinkled fprintf lines in suspect places and watched them while exercising the erratic behavior of the scroll bar. Here are some observations that might help you figure this out: . The erratic behavior seems to be due to our own code resetting the thumb position right after I drag the thumb to some new position. The code which causes this seems to be -- surprise, surprise -- set_horizontal_scroll_bar that calls set_horizontal_scroll_bar_hook passing it the previous position. I didn't yet figure out why this affects only R2L lines. . If point is on an empty line, the problem doesn't happen. Likewise, if I drag the scroll bar of a non-selected window, the problem doesn't happen, either. Maybe we call the scroll-bar hook too early, without giving redisplay the chance to hscroll all the windows? (Btw, note that I needed a small change to be able to scroll correctly non-selected windows; see r117712 on the trunk.) (Btw2, when is x_horizontal_scroll_bar_report_motion called? I couldn't see it being called when the scroll bar is used.) HTH