From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "T.V Raman" Newsgroups: gmane.emacs.devel Subject: Re: We should decouple focus and frame switching Date: Sun, 10 Jun 2018 17:04:27 -0700 Message-ID: References: <6d1bc582-29be-5df7-56b1-e82305ee477f@dancol.org> <726a268360567d598996f0080b71c0f8.squirrel@dancol.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1528675411 13098 195.159.176.226 (11 Jun 2018 00:03:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Jun 2018 00:03:31 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Emacs developers To: dancol@dancol.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 11 02:03:26 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 1fSAIs-0003Gl-JZ for ged-emacs-devel@m.gmane.org; Mon, 11 Jun 2018 02:03:22 +0200 Original-Received: from localhost ([::1]:45533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSAKz-0000yA-JB for ged-emacs-devel@m.gmane.org; Sun, 10 Jun 2018 20:05:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSAKC-0000xq-8m for emacs-devel@gnu.org; Sun, 10 Jun 2018 20:04:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSAK9-00039Y-55 for emacs-devel@gnu.org; Sun, 10 Jun 2018 20:04:44 -0400 Original-Received: from mail-pl0-x234.google.com ([2607:f8b0:400e:c01::234]:41728) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSAK8-00037a-V1 for emacs-devel@gnu.org; Sun, 10 Jun 2018 20:04:41 -0400 Original-Received: by mail-pl0-x234.google.com with SMTP id az12-v6so11277344plb.8 for ; Sun, 10 Jun 2018 17:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=msTNbb07Qyu5x7JVtOHn7V4AQ5vWKgRxHZqeJE1s1MM=; b=lmM2GBnXjxksUVPYzVK8LnkXowD+NLsE74qAMt+Nx/mfD5iQ5cZ8MObEqk6QW81enG BMtMLa3wD+2Ax5phMmfeLWOEXi21Ly871lg3Xz0h++Kgaf6P2oNk6dD9E0fwaDBqs+G9 fISwBipHCoExWeSJZeGMDgmHjpFTpatuJ9kwEKWiiqvcyz0ePfrOM/ZfkiOA8/WSM/MU QSi5ItiqrDFdi6fiJ/WiRbE9dZ70T6sGwiexVFsmwOkc3OJnskhnKLtadQE7TEI/oVnj Th43piV8pibrFPNlMftYuJbhNQ4cfW9Hfxw/squxXBX/Ljtrqpj0zq02mfh6aCPXgFgB g5aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=msTNbb07Qyu5x7JVtOHn7V4AQ5vWKgRxHZqeJE1s1MM=; b=hOBfbGWm8VtUyQQ/q8Sb2kbFsNMo6FkEN4FN+7PoKkj6/SWRS/21He0Pay8aCKqLSi QJHNddbTgx6f3gESux8j30wV/GTBPUDErRRw9vUMUqwW0NYOG6Y95S4+xk8PBSGw3tuK 9LeVSG6UydiFQbYTSmLcGgwNRDMr+bJoMt/zcH/WG2ZEHLrwCPET2V3FJlsT3FcgYNPX 65Lv0TJMoWP0uIPm0l7MckZ6+zJROJFLZmjLuTUQqBrP1Bqj0D5XzbF46kQg5aAdbalj C7ZG7JOEN+rEv2eZKWteqrph71GgciE3Kw6FR693jDNRwg4ccccSszUNvp4esd+MGmL8 Wryw== X-Gm-Message-State: APt69E2fNCQCPjLXjPwec2QcSVMlItQ+uQtg4Uhl6S/bIh7WOQd7LlFR GqZiaYSEdjALWQVccTrNe3hFbT5PSmQ= X-Google-Smtp-Source: ADUXVKLXSiHvufhungWvqBOn9KGa7GrVdI20k3+AGISLLKwX7rFpS/tu1fu2rDe7YfCLdeEgE4wdAQ== X-Received: by 2002:a17:902:6b04:: with SMTP id o4-v6mr16227023plk.101.1528675476102; Sun, 10 Jun 2018 17:04:36 -0700 (PDT) Original-Received: from raman-glaptop (c-24-4-174-65.hsd1.ca.comcast.net. [24.4.174.65]) by smtp.gmail.com with ESMTPSA id h84-v6sm71496201pfd.69.2018.06.10.17.04.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Jun 2018 17:04:29 -0700 (PDT) In-Reply-To: <726a268360567d598996f0080b71c0f8.squirrel@dancol.org> (dancol@dancol.org's message of "Sun, 10 Jun 2018 16:28:15 -0700") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::234 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:226175 Archived-At: dancol@dancol.org writes: focus-in-hook and focus-out-hook are demonstrably broken --- I remember sending a message here that showed those hooks firing multiple times under stumpwm for a single window-switch event. I believe someone else also reproed the buggy behavior under a different WM >>>>>>> "DC" == Daniel Colascione writes: >> >> DC> How about this? We'll add a frame-focused-p function that returns nil, >> t, >> DC> or 'unknown, and wire up focus-in-hook and focus-out-hook to run only >> when >> DC> we actually observe a window system focus change, letting the frame >> switch >> DC> stuff run completely independently. This way, we'll be able to write >> lisp >> DC> (as I've been trying to do) that reflects the real window system >> focus. >> >> DC> Sound good? >> >> Why might we not want this? > > First of all, I'm worried about backward compatibility with existing > packages that rely on the current strange behavior of focus-in and > focus-out. I briefly scanned the tree, ELPA, and EmacsWiki, and I didn't > see anything that would obviously break, but that's no guarantee. The > alternative I was considering is to keep the existing focus events as they > are and add a new set of window-system-focus query functions and hooks > alongside it. > > Second, Chesterton's fence: maybe there's a good reason the focus events > are structured the way they are? I was hoping somebody knew why we did it > this way in the first place. > > --