From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#30699: 26.0.91; buffer contents flicker on macOS frames when frames are resized Date: Fri, 09 Mar 2018 15:32:09 +0200 Message-ID: <837eqlwf1i.fsf@gnu.org> References: <834llutstx.fsf@gnu.org> <83tvtus8rc.fsf@gnu.org> <20180305192331.GA26656@breton.holly.idiocy.org> <83muzms3i6.fsf@gnu.org> <20180306225502.GA30546@breton.holly.idiocy.org> <83a7vjre52.fsf@gnu.org> <20180307202603.GA31176@breton.holly.idiocy.org> <83r2ounzty.fsf@gnu.org> <20180309120952.GA45581@breton.holly.idiocy.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1520602329 6272 195.159.176.226 (9 Mar 2018 13:32:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Mar 2018 13:32:09 +0000 (UTC) Cc: 30699@debbugs.gnu.org, aaronjensen@gmail.com To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 09 14:32:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1euI7w-0001Xg-U6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Mar 2018 14:32:05 +0100 Original-Received: from localhost ([::1]:45319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euI9z-0003Bc-Ip for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Mar 2018 08:34:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euI8v-0002Qp-K6 for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2018 08:33:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1euI8s-0006Xi-EA for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2018 08:33:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43960) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1euI8s-0006Xa-AE for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2018 08:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1euI8s-0006OS-0j for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2018 08:33: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: Fri, 09 Mar 2018 13:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30699 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30699-submit@debbugs.gnu.org id=B30699.152060234724527 (code B ref 30699); Fri, 09 Mar 2018 13:33:01 +0000 Original-Received: (at 30699) by debbugs.gnu.org; 9 Mar 2018 13:32:27 +0000 Original-Received: from localhost ([127.0.0.1]:51857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1euI8J-0006NW-8q for submit@debbugs.gnu.org; Fri, 09 Mar 2018 08:32:27 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:57095) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1euI8G-0006NJ-NO for 30699@debbugs.gnu.org; Fri, 09 Mar 2018 08:32:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1euI87-00069A-NF for 30699@debbugs.gnu.org; Fri, 09 Mar 2018 08:32:19 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35473) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euI83-00067V-W6; Fri, 09 Mar 2018 08:32:12 -0500 Original-Received: from [176.228.60.248] (port=1240 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1euI83-00036m-EJ; Fri, 09 Mar 2018 08:32:11 -0500 In-reply-to: <20180309120952.GA45581@breton.holly.idiocy.org> (message from Alan Third on Fri, 9 Mar 2018 12:09:52 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:144069 Archived-At: > Date: Fri, 9 Mar 2018 12:09:52 +0000 > From: Alan Third > Cc: 30699@debbugs.gnu.org, aaronjensen@gmail.com > > [window setFrame: wr display: YES]; > > That resizes and blanks the frame, then asks it to redraw, which takes > us, eventually, to drawRect, which does: > > ns_clear_frame_area (emacsframe, x, y, width, height); > block_input (); > expose_frame (emacsframe, x, y, width, height); > unblock_input (); > > ns_clear_frame_area does nothing here because the frame is already > blank, and expose_frame doesn’t redraw anything because the first > thing it does is: > > /* No need to redraw if frame will be redrawn soon. */ > if (FRAME_GARBAGED_P (f)) > { > TRACE ((stderr, " garbaged\n")); > return; > } > > SO, I think that the SET_GARBAGED_FRAME call in updateFrameSize is > premature, which probably means my original patch is (surprisingly) > the correct fix. But then what would that fix solve? The above test in expose_frame is not a bug: if the frame is marked as garbaged (and it must be after resizing it), then the call to expose_frame cannot possibly DTRT, so it exits right away without doing anything. We should enter redisplay soon enough, which will redraw the entire frame. If anything, then the call to expose_frame in the control flow that reacts to frame resizing is the one that should be removed, because it's bound to do nothing useful. If removing SET_FRAME_GARBAGED when the frame is resized seems to solve some problem, then you are likely not really resizing the frame, or not resizing it significantly enough to show why SET_FRAME_GARBAGED is really needed. Or maybe I'm just missing something.