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: Tue, 19 Aug 2014 18:15:58 +0300 Message-ID: <83bnrgcxxt.fsf@gnu.org> References: <53CE6A44.1010708@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> <83lhqldeqf.fsf@gnu.org> <53F225A7.6030103@gmx.at> <83ha19day1.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1408461395 12099 80.91.229.3 (19 Aug 2014 15:16:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Aug 2014 15:16:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: rudalics@gmx.at Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 19 17:16:26 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 1XJl91-0000aL-VF for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2014 17:16:20 +0200 Original-Received: from localhost ([::1]:51632 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJl91-0007yy-HI for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2014 11:16:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJl8t-0007xr-Ll for emacs-devel@gnu.org; Tue, 19 Aug 2014 11:16:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XJl8o-0005KP-Fk for emacs-devel@gnu.org; Tue, 19 Aug 2014 11:16:11 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:40818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XJl8o-0005KK-7X for emacs-devel@gnu.org; Tue, 19 Aug 2014 11:16:06 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0NAK00I007D99G00@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Tue, 19 Aug 2014 18:16:04 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NAK00I297QS4XA0@a-mtaout23.012.net.il>; Tue, 19 Aug 2014 18:16:04 +0300 (IDT) In-reply-to: <83ha19day1.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.175 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:173766 Archived-At: > Date: Mon, 18 Aug 2014 19:22:46 +0300 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org > > > Date: Mon, 18 Aug 2014 18:11:19 +0200 > > From: martin rudalics > > CC: emacs-devel@gnu.org > > > > > but it's still unclear to me why this problem is not visible > > > in L2R buffers. > > > > Because for L2R I count the part from the leftmost position to the start > > of the scroll bar thumb which is unaffected by the size of the thumb? No, that wasn't it, see below. > > > . 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. > > > > You mean that w->hscroll has its previous value in > > > > start = w->hscroll * FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w)); > > > > in xdisp.c although w->hscroll was in between changed by > > `scroll-bar-horizontal-drag-1'? > > I didn't analyze this further, but it should be easy to verify. I found the reason for this: w32_horizontal_scroll_bar_handle_click reported bogus (always -1) values in the Y part of '(X . Y)' member of the click event, when I drag the thumb. That value is not used in L2R paragraphs, so L2R buffers were not affected. This is now fixed in trunk r117715. Btw, I don't understand why in w32_horizontal_scroll_bar_handle_click you overwrite the value reported from GetScrollInfo by HIWORD(msg->msg.wParam). My reading of MSDN documentation is that they recommend to do it the other way around, since GetScrollInfo is not limited to 16-bit values. If using the values reported by GetScrollInfo doesn't work well, perhaps that's because for SB_THUMBTRACK message you need to use SIF_TRACKPOS and si.nTrackPos rather than SIF_POS and si.nPos.