From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#42406: Mouse-wheel scrolling can be flickering Date: Mon, 14 Dec 2020 18:12:01 +0200 Message-ID: <837dpkcqpa.fsf@gnu.org> References: <20200722201659.GA1541@breton.holly.idiocy.org> <969D8DEC-6837-4DD4-93E9-F359DADE1EAB@univie.ac.at> <20201010095100.GG60347@breton.holly.idiocy.org> <9849711D-8DBE-4030-8020-84D86E72505B@univie.ac.at> <83czzg3ge1.fsf@gnu.org> <83sg89cyrq.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36902"; mail-complaints-to="usenet@ciao.gmane.io" Cc: konrad.podczeck@univie.ac.at, 42406@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 14 17:19:24 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1koqZI-0009WK-6Y for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Dec 2020 17:19:24 +0100 Original-Received: from localhost ([::1]:42920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koqZH-0001cv-7x for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Dec 2020 11:19:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koqT9-0002tr-9c for bug-gnu-emacs@gnu.org; Mon, 14 Dec 2020 11:13:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42388) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1koqT9-0004J8-0p for bug-gnu-emacs@gnu.org; Mon, 14 Dec 2020 11:13:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1koqT8-0008Sg-Sr for bug-gnu-emacs@gnu.org; Mon, 14 Dec 2020 11:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Dec 2020 16:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42406 X-GNU-PR-Package: emacs Original-Received: via spool by 42406-submit@debbugs.gnu.org id=B42406.160796234232463 (code B ref 42406); Mon, 14 Dec 2020 16:13:02 +0000 Original-Received: (at 42406) by debbugs.gnu.org; 14 Dec 2020 16:12:22 +0000 Original-Received: from localhost ([127.0.0.1]:53933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koqST-0008RX-SD for submit@debbugs.gnu.org; Mon, 14 Dec 2020 11:12:22 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koqSS-0008R8-Bw for 42406@debbugs.gnu.org; Mon, 14 Dec 2020 11:12:21 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54593) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koqSK-00049W-PD; Mon, 14 Dec 2020 11:12:12 -0500 Original-Received: from [176.228.60.248] (port=4155 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1koqSI-0007V0-DK; Mon, 14 Dec 2020 11:12:11 -0500 In-Reply-To: (message from Alan Third on Sun, 13 Dec 2020 19:46:04 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:196067 Archived-At: > Date: Sun, 13 Dec 2020 19:46:04 +0000 > From: Alan Third > Cc: konrad.podczeck@univie.ac.at, 42406@debbugs.gnu.org > > Which I've not found very useful. I had a look at redisplay_internal > to see if I could work out why the frame is being updated, but I > can't. AFAIU, it is updated because update_mode_lines is non-zero. > I looked at some of the variables in redisplay_internal that are > involved in making the decision whether to check all frames: > > (lldb) p update_mode_lines; > (int) $0 = 42 > (lldb) p windows_or_buffers_changed > (int) $1 = 2 > > but I have no idea if this is useful at all. > > Is there anything specific you'd like me to check? I think the issue is clear: mouse-scroll calls scrolling commands, and all of the scrolling commands set update_mode_lines. Why they do that is explained by the comment in wset_update_mode_line: /* If this window is the selected window on its frame, set the global variable update_mode_lines, so that gui_consider_frame_title will consider this frame's title for redisplay. */ We need to update the mode lines due to scrolling, because mode lines show the buffer position and other related info. And please keep in mind that the frame title can use almost any %-construct defined for the mode line, so we may need to recompute it as well, when we scroll. And there's no mechanism in redisplay to redraw portions of the frame (i.e. something that doesn't belong to any window) except by setting consider_all_windows_p non-zero. The effect of that is to consider all the windows on all the frames for redisplay. But while Emacs can refrain from actually redrawing on the glass the parts that it controls (text displayed in the window etc.), it cannot refrain from redrawing the parts that are under the control of the GUI toolkit or the VW. Which is why you see some portions of the frame flicker. IOW, the flickering in this case is expected, and cannot be avoided without making the display engine more fine-grained wrt which parts need redrawing and when. The usual method of avoiding flickering is by double-buffering, but that isn't supported on NS, is it? However, this bug report said that scrolling becomes slower and slower with time, and that is not expected, and I see no direct relation between that and flickering. Can we please go back to that aspect of the problem? It shouldn't happen.