From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: focus-in-hook ---fires incorrectly? Date: Mon, 26 Mar 2018 20:44:17 +0300 Message-ID: <834ll2g2a6.fsf@gnu.org> References: <23225.11211.455169.412084@retriever.mtv.corp.google.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1522086135 22644 195.159.176.226 (26 Mar 2018 17:42:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Mar 2018 17:42:15 +0000 (UTC) Cc: emacs-devel@gnu.org To: raman@google.com (T.V Raman) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 26 19:42:10 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 1f0W8I-0005mA-84 for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2018 19:42:10 +0200 Original-Received: from localhost ([::1]:58267 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0WAL-0005fZ-PE for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2018 13:44:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0WAF-0005fF-Uw for emacs-devel@gnu.org; Mon, 26 Mar 2018 13:44:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0WAB-000614-Vp for emacs-devel@gnu.org; Mon, 26 Mar 2018 13:44:11 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0WAB-000610-SS; Mon, 26 Mar 2018 13:44:07 -0400 Original-Received: from [176.228.60.248] (port=3229 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1f0WAB-0007zS-9R; Mon, 26 Mar 2018 13:44:07 -0400 In-reply-to: <23225.11211.455169.412084@retriever.mtv.corp.google.com> (raman@google.com) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:224053 Archived-At: > From: raman@google.com (T.V Raman) > Date: Mon, 26 Mar 2018 10:20:11 -0700 > > this is on emacs built from Git @head running on Debian under StumpWM > as a window-manager. Can you try a different window-manager? It could also depend on the focus policy, I think. > (add-hook 'focus-in-hook #'(lambda () (message "hello %s" (selected-frame)))) > > What you'd expect: > > 1. See "hello " when Emacs frames receive focus. > 2. Nothing when Emacs loses focus. > > What Actually Happens: > > Hook fires when emacs loses focus, and you see "Hello " > where frame-id is the id of selected frame in emacs > 2. You get "hello" when Emacs receives focus -- with no frame-id. It works as expected here, but I'm not on X.