From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: We should decouple focus and frame switching Date: Sun, 10 Jun 2018 11:07:09 -0700 Message-ID: <6d1bc582-29be-5df7-56b1-e82305ee477f@dancol.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1528653957 15233 195.159.176.226 (10 Jun 2018 18:05:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 10 Jun 2018 18:05:57 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 10 20:05:53 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 1fS4iv-0003q9-31 for ged-emacs-devel@m.gmane.org; Sun, 10 Jun 2018 20:05:53 +0200 Original-Received: from localhost ([::1]:44877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fS4l0-0005T5-AP for ged-emacs-devel@m.gmane.org; Sun, 10 Jun 2018 14:08:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fS4kP-0005Sm-P5 for emacs-devel@gnu.org; Sun, 10 Jun 2018 14:07:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fS4kM-0007xw-Kc for emacs-devel@gnu.org; Sun, 10 Jun 2018 14:07:25 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:35382) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fS4kM-0007tI-Ay for emacs-devel@gnu.org; Sun, 10 Jun 2018 14:07:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date:Message-ID:Subject:From:To; bh=F5hoGqNvAiOoi8wz1m0WbgGxHy8egEhbkEPotPSuVR0=; b=bIZGGnUrAhnahv1PnRxGgVaPzQVxargI/b0+1HfkdXdag7HAeuMP9VhXY5hvYGDAVLtI0JhDE6Sonvq4z4BLnQiVVNCKGmah/oHMmoZcWxfxJk2JSfc3ORyJfnz0YAADpqk/m6Y5rHONHy3LuhWqsugWV+AbZp5MasrewyI6cvWaqdqZ4VsnpjDbAdVFb8FqBbHkgoYFu4EyZx7fJto/9QuvwZbQD46pnKu0OxdjCE2XFOOs2l15frqM9MKikf9Nz+VvoJ3qpQh/Y4xj03mhkcFZCCiG8UtcFfnMq53PLkPb6pER8NzzN+ocZDUzwjo7Un06ndtK4sEHedAGDp0Gqg==; Original-Received: from [172.92.145.124] (helo=[192.168.86.27]) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1fS4kF-0001HU-1l for emacs-devel@gnu.org; Sun, 10 Jun 2018 11:07:15 -0700 Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 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:226170 Archived-At: Focus-in and focus-out don't do a good job right now of reflecting actual window system focus state, and that's in part due to the core considering frame switch evidence of a focus change and running the focus-in hooks in response. More than one frame can have window system focus at a time when we have multiple terminals, and even on a single terminal, internal frame switching for processing mouse wheel events and such shouldn't change the reported window system focus state. How about this? We'll add a frame-focused-p function that returns nil, t, or 'unknown, and wire up focus-in-hook and focus-out-hook to run only when we actually observe a window system focus change, letting the frame switch stuff run completely independently. This way, we'll be able to write lisp (as I've been trying to do) that reflects the real window system focus. Sound good?