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.devel Subject: Re: Flicker on MS Windows Date: Mon, 07 Mar 2022 19:35:27 +0200 Message-ID: <83lexlfyxs.fsf@gnu.org> References: <87o82jpeee.fsf.ref@yahoo.com> <87o82jpeee.fsf@yahoo.com> <83ee3fgwq3.fsf@gnu.org> <87fsnvpbh7.fsf@yahoo.com> <83y21nezys.fsf@gnu.org> <87ee3eoarz.fsf@yahoo.com> <83v8wqexox.fsf@gnu.org> <87a6e1n9j5.fsf@yahoo.com> <83pmmxg7w8.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35948"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: luangruo@yahoo.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 07 18:36:27 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nRHHW-00092Y-OF for ged-emacs-devel@m.gmane-mx.org; Mon, 07 Mar 2022 18:36:26 +0100 Original-Received: from localhost ([::1]:42248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRHHV-0006ao-Kn for ged-emacs-devel@m.gmane-mx.org; Mon, 07 Mar 2022 12:36:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHGj-0005p9-T8 for emacs-devel@gnu.org; Mon, 07 Mar 2022 12:35:37 -0500 Original-Received: from [2001:470:142:3::e] (port=47452 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHGj-0007Kk-KN; Mon, 07 Mar 2022 12:35:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=2P7Mm1s2TAW3lqvBraF1mprbNnvlys+fuxpFRP3Yk4s=; b=Cg80zMtlVPzG U8I/l5PXcW0pTZ58UtTq684acy3a98LZdJrpLsPnNVeBIBuCcf0xHzH8/vMYnYdLZ7Ot3jqvCMXnq KRYamPpmzzuBaloHvG5f7UYSzFDbG4cQqAEBBK9mZD7x7eJjWNN3FoVLpXAysHR+86qVNK1dxMZ4L CLBfmsdjqwZj278IH5WChoiMeQX7OpfSCA44/Ms9oskrS+w1R+fyESjDKengOxHDFSqOw2oLk3azB rA/ytpHauxaoCqMIgXHFLHffNtpzpftPzThMlvYF+u0LyqSgsY5Q1ZpP9N8GqTL/E374pY4IYvv71 Zv7nBGGrufX9k9/19OviLQ==; Original-Received: from [87.69.77.57] (port=1664 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRHGj-00010k-3N; Mon, 07 Mar 2022 12:35:37 -0500 In-Reply-To: <83pmmxg7w8.fsf@gnu.org> (message from Eli Zaretskii on Mon, 07 Mar 2022 16:21:59 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286896 Archived-At: > Date: Mon, 07 Mar 2022 16:21:59 +0200 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org > > > BTW, here's another way to reproduce some severe flicker on MS Windows: > > just type "M-: (run-hooks 'xref-after-jump-hook) RET", and the tool bar > > buttons, cursor and text start to flicker severely. The tool bar > > buttons flicker in a peculiar way: the background is displayed, but the > > image itself flickers with interleaved bands of black. > > I don't see any flickering here, after the above. The window > recenters and I see a single line pulsed; that's all Moreover, Emacs > consumes exactly zero CPU cycles after evaluating that expression. If I increase pulse-iterations to 1000 (from the default of 10), then in an unoptimized build I see a rare and barely-visible flickering of the tool bar images, as if they are redrawn. However, I cannot find where this redrawing comes from. Both xdisp.c and dispnew.c do their jobs correctly, and the tool bar is never actually redrawn on these levels. If I put a breakpoint where dispnew.c actually writes to the glass using the terminal-specific write_glyphs method, as part of the update_frame call, that breakpoint never breaks in all those 1000 iterations, not once. Which means that we correctly decide that the tool bar didn't change and does not need to be redrawn. So it sounds like it's some very low-level Windows-specific code, perhaps triggered by messages we send to the GUI thread or something? This is an area in Emacs about which I know very little. Ideas regarding what could cause this are welcome. And again, it's barely perceptible here, even with this non-trivial setup and a relatively slow Emacs. I have no idea why it's so prominent in your case (assuming it's the same issue that I see, which is not certain, since what I see looks like redrawing of the images on the tool-bar buttons).