From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: raman@google.com (T.V Raman) Newsgroups: gmane.emacs.devel Subject: focus-in-hook ---fires incorrectly? Date: Mon, 26 Mar 2018 10:20:11 -0700 Message-ID: <23225.11211.455169.412084@retriever.mtv.corp.google.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1522084743 25903 195.159.176.226 (26 Mar 2018 17:19:03 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 26 Mar 2018 17:19:03 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 26 19:18:59 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 1f0Vlr-0006bP-De for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2018 19:18:59 +0200 Original-Received: from localhost ([::1]:58155 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0Vnu-0005wa-M4 for ged-emacs-devel@m.gmane.org; Mon, 26 Mar 2018 13:21:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0VnF-0005tv-4I for emacs-devel@gnu.org; Mon, 26 Mar 2018 13:20:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0VnB-0006Nh-UI for emacs-devel@gnu.org; Mon, 26 Mar 2018 13:20:25 -0400 Original-Received: from mail-pl0-x235.google.com ([2607:f8b0:400e:c01::235]:45656) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0VnB-0006Mr-N9 for emacs-devel@gnu.org; Mon, 26 Mar 2018 13:20:21 -0400 Original-Received: by mail-pl0-x235.google.com with SMTP id n15-v6so12341500plp.12 for ; Mon, 26 Mar 2018 10:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:mime-version:content-transfer-encoding:message-id:date:to :subject; bh=wRgFKMd0F8kGmJB2aIYpyn/Ko9RZthlMcc0I9+Z/lbE=; b=NgwVhC1AFIIqrWc2IAgm+wgHCEq2ZtTlAojrs0uW5B9gvvB1S2toBC+cITZ1bP3StA CfUjoj+H/zYUf5C1492ULgctoHGOjIM+KNpwIlHkWuizNgsLPWZME6tjJOcuAVxv74Mf PLC3HerqbPbV53rn6jUm2zeapW5M+iElrVHJuedkfprPTsXTbu6uAM0QNPD7qIGwcKXw 9s+xL3nGgn99YDoQhqmawIYrGPJuVhDwXUZJJH3qf4MzxPHG3UbMEXN2xTWXlYhEGLTw YmtHaCCZAXA8PvFdBJLoQxH02VVojqqmPzZAeFSNDWifPWvQOA1vVRikGBRqnkLcCb/d vvDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:content-transfer-encoding :message-id:date:to:subject; bh=wRgFKMd0F8kGmJB2aIYpyn/Ko9RZthlMcc0I9+Z/lbE=; b=WNTLmm8VtqfOI+PxVAaQN6RJ8A943n0QNpv5MeY3eLRlbk+ckf+qnmzSa+/hNMEXmD +WbpFEyHtySa7xVSDftF8dPgOWSknSygGyoRPI1dnECR2gvvZKce5eyl7sWxX3d3jvIn b/k9O3Uer2n1qDNSMyr24fU540VHFQcA4rtbNsif/1EE9Fk+Vz+yOpvkfPr18EWtbnwG iVfMihe/ZPRFmGBKB/Mv5AXToh6rdxRz9xYXdMcY2kOl78T/iDwCFASkVON3n2EcS2/m qOI5SaaNRlj28YwH7aEp04wUbZlY7EnyFonneDpg7S15xLSDIS33nt/sqvvmf3Z+1S7M 0A6Q== X-Gm-Message-State: AElRT7F3Plflpx0HeiSSDvpTlGLuKhcvRMBhQMeVjxcYLsOCUbuRrOCh rOoXu3iers0tgothb+E5gFQw9y0x4rM= X-Google-Smtp-Source: AG47ELuRzmB+OfVsUzdEXk/jeEuwDiMEX3LoNdCWy9jfoAotlp9xm9Milf4qhqsTBU1cZPjCCqi5ZQ== X-Received: by 2002:a17:902:5910:: with SMTP id o16-v6mr25099915pli.258.1522084817880; Mon, 26 Mar 2018 10:20:17 -0700 (PDT) Original-Received: from retriever.mtv.corp.google.com ([100.98.8.29]) by smtp.gmail.com with ESMTPSA id k24sm13446403pfj.32.2018.03.26.10.20.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Mar 2018 10:20:13 -0700 (PDT) Original-Received: by retriever.mtv.corp.google.com (Postfix, from userid 13930) id E1B4D1A1644; Mon, 26 Mar 2018 10:20:11 -0700 (PDT) X-Mailer: VM 8.1.1 under 27.0.50 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::235 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:224051 Archived-At: this is on emacs built from Git @head running on Debian under StumpWM as a window-manager. Try: (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. Note that the corresponding focus-out-hook appears to work correctly i.e. only fires when Emacs loses focus. -- -- -- --