From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Third Newsgroups: gmane.emacs.devel Subject: Re: redisplay and expose_frame Date: Tue, 24 Jul 2018 21:42:20 +0100 Message-ID: <20180724204220.GA9687@breton.holly.idiocy.org> References: <20180722124418.GA8674@breton.holly.idiocy.org> 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 1532464827 7852 195.159.176.226 (24 Jul 2018 20:40:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 24 Jul 2018 20:40:27 +0000 (UTC) User-Agent: Mutt/1.10.0 (2018-05-17) Cc: emacs-devel@gnu.org To: YAMAMOTO Mitsuharu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 24 22:40:23 2018 Return-path: Envelope-to: ged-emacs-devel@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 1fi46Y-0001xd-RN for ged-emacs-devel@m.gmane.org; Tue, 24 Jul 2018 22:40:22 +0200 Original-Received: from localhost ([::1]:42533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fi48f-0003Vj-MI for ged-emacs-devel@m.gmane.org; Tue, 24 Jul 2018 16:42:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fi48Z-0003Ve-KE for emacs-devel@gnu.org; Tue, 24 Jul 2018 16:42:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fi48Y-0000tE-Es for emacs-devel@gnu.org; Tue, 24 Jul 2018 16:42:27 -0400 Original-Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:35076) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fi48Y-0000rL-6F for emacs-devel@gnu.org; Tue, 24 Jul 2018 16:42:26 -0400 Original-Received: by mail-wr1-x435.google.com with SMTP id a3-v6so5374006wrt.2 for ; Tue, 24 Jul 2018 13:42:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=hwUlanxWHAEyt+NYSS3Wa18HUrFQxBvWzfeHxh9Y000=; b=bEuxmPt9GsagODrY24FGslRJzhgWwvWaRifZgG/xWwHFxwuqQlMftCEVDscbjI+4HB yuTqyt3zeWKzYiXXdeBF19bR2pUfyXczvh3RGM5jwOz4E4nG8MlroP24KeZ4Vs4p12YL iNCLRrICDIZMxkUbIBg/6wNIKN8/7ZEeL7FOzhx7l6SO1CueMyYHfKWo6F6fn+b3m2cG YB/HPkY2e1zfLJ6wRnpohCIQvcr7CDdK1JLI2tqKrSXzq+PKXfdbJgWD8+l+eUfeMDYA wM9S7DkSqJ1jhkHRjxyf0CmbY5Xbn37cz0I6xJya0w1d53j91nAMD84CqzMEN4cEkXED fpXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=hwUlanxWHAEyt+NYSS3Wa18HUrFQxBvWzfeHxh9Y000=; b=LlNsw9MkLoJZdnGMBIvRkxNbEwuLWukB21u3fleb836yyHJyQzWzh5yco6cJiWTXkb yBCX9IpcZLsGKCyIyAlzcviHjY7O0wztbJGCoVsoRi9etOOErPpEAU/aggpFe5x5x8Je sR3dQl3z5rYf2R5SR6W8EFQRjNE68TuHxHvkFVqj+84NAajfR3htmkrFwekm8ZXkeLjW WVPgHQB4mYTZGNyixMpOdEu5FnliQtT0JGp+XLYlxeV9s683T4aMiUHZbYOD6klriHk2 qoqJUUoc4t7sQ/LwyB3E1afLElh3yzk9cByS/y8vXXA+o+nzS2FDcC4uPGUxuitoYCFQ 2ofA== X-Gm-Message-State: AOUpUlGFzvNM1pgBnW57LpDg3+CU8KscqJqy3Gr7MgFOHokeH1UT5hWi eezwGg9WGa+Un7gCJvkifVUCvEyo X-Google-Smtp-Source: AAOMgpckxKY5sdL/10I4J7fOq2Qc64S/MKmxElo9K/zxXvyoVNUq55Bt2KkHM7x6syI23wz5MZ+AAA== X-Received: by 2002:a5d:6892:: with SMTP id h18-v6mr12534887wru.108.1532464944598; Tue, 24 Jul 2018 13:42:24 -0700 (PDT) Original-Received: from breton.holly.idiocy.org (ip6-2001-08b0-03f8-8129-5547-5920-13ce-edfa.holly.idiocy.org. [2001:8b0:3f8:8129:5547:5920:13ce:edfa]) by smtp.gmail.com with ESMTPSA id e5-v6sm1437850wmh.29.2018.07.24.13.42.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 13:42:23 -0700 (PDT) Content-Disposition: inline In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::435 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:227781 Archived-At: On Mon, Jul 23, 2018 at 06:58:22PM +0900, YAMAMOTO Mitsuharu wrote: > On Sun, 22 Jul 2018 21:44:18 +0900, > Alan Third wrote: > > > The background here is that I’m working on splitting the NS port’s GUI > > code into its own thread, and while working on that I noticed that > > Apple have deprecated the method we use to draw, so I thought that > > since I’m working with the code anyway, I may as well try to > > ‘modernise’ it. > > A related thread can be found around > http://lists.gnu.org/archive/html/emacs-devel/2010-07/msg00821.html . That’s interesting, and confirms some of what I’d thought. I take it nothing ever came of it, though? > Mojave, the next version of macOS, already prohibits drawing outside > "drawRect:" by default if the executable was linked on that version. > An attempt to draw outside "drawRect:" triggers invalidation of all > the contents instead, and it is completely redrawn (even for a single > cursor movement) via "drawRect:" at the next cycle of the event loop. > This is kinda usable for small frames on recent machines, but not > efficient of course, especially for full screen frames. This doesn’t sound good, and I wonder if bug#31904 is related, although it doesn’t sound like it should be. Is the Mac port affected by this, or does it avoid this Cocoa stuff? I suppose, to avoid changes in redisplay code, I could make the NS drawing functions detect whether they are running in the main thread (or perhaps they can just ask whether they’re able to draw or not), and if they’re not then invalidate the relevant rectangle, and if they are then do the actual drawing task. Then call display for each frame to force an expose ‘event’ at the end of redisplay. -- Alan Third