From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.bugs Subject: bug#745: pop-to-buffer, frames, and input focus Date: Fri, 29 Aug 2008 09:39:37 +0200 Message-ID: References: <48AC2F4A.1000507@gmx.at> <48AC851A.3020906@gmx.at> <48AD2FB5.3000204@gmx.at> <48ADD085.50505@gmx.at> <48AEEBB8.50201@gmx.at> <48AFFD26.3040204@gmx.at> <48B2B78C.9090407@gmx.at> <48B50C63.8010402@gmx.at> <48B69007.20604@gmx.at> <48B7181B.7080706@gmx.at> Reply-To: Helmut Eller , 745@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1219996470 30193 80.91.229.12 (29 Aug 2008 07:54:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Aug 2008 07:54:30 +0000 (UTC) Cc: 745@emacsbugs.donarmstrong.com To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 29 09:55:23 2008 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KYyox-0004ga-AL for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Aug 2008 09:55:03 +0200 Original-Received: from localhost ([127.0.0.1]:42354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYyny-0007Ex-Tp for geb-bug-gnu-emacs@m.gmane.org; Fri, 29 Aug 2008 03:54:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KYynO-00070A-75 for bug-gnu-emacs@gnu.org; Fri, 29 Aug 2008 03:53:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KYynM-0006zD-Fh for bug-gnu-emacs@gnu.org; Fri, 29 Aug 2008 03:53:25 -0400 Original-Received: from [199.232.76.173] (port=34269 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KYynM-0006z8-7a for bug-gnu-emacs@gnu.org; Fri, 29 Aug 2008 03:53:24 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:62032) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KYynL-0003Pb-DZ for bug-gnu-emacs@gnu.org; Fri, 29 Aug 2008 03:53:23 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KYynK-0000Ju-LI for bug-gnu-emacs@gnu.org; Fri, 29 Aug 2008 03:53:22 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7T7lTnE001942; Fri, 29 Aug 2008 00:47:29 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m7T7j4Vj000716; Fri, 29 Aug 2008 00:45:04 -0700 X-Loop: don@donarmstrong.com Resent-From: Helmut Eller Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 29 Aug 2008 07:45:04 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 745 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 745-submit@emacsbugs.donarmstrong.com id=B745.121999548431246 (code B ref 745); Fri, 29 Aug 2008 07:45:04 +0000 Original-Received: (at 745) by emacsbugs.donarmstrong.com; 29 Aug 2008 07:38:04 +0000 Original-Received: from rolmail.net (cgp1.rolmail.net [195.254.252.190]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7T7bxMa031240 for <745@emacsbugs.donarmstrong.com>; Fri, 29 Aug 2008 00:38:01 -0700 Original-Received: from dummy.name; Fri, 29 Aug 2008 09:37:58 +0200 Original-Received: from dummy.name; Fri, 29 Aug 2008 09:39:37 +0200 In-Reply-To: <48B7181B.7080706@gmx.at> (martin rudalics's message of "Thu, 28 Aug 2008 23:26:51 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 3) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) Resent-Date: Fri, 29 Aug 2008 03:53:25 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:19849 * martin rudalics [2008-08-28 23:26+0200] writes: >> I know about the following problems: >> >> 1. pop-to-buffer doesn't switch input focus >> 2. select-window doesn't switch input focus >> 3. x-create-frame does switch input focus (with most WMs) >> >> Is there something else? > > The XSetInputFocus vs x_ewmh_activate_frame dichotomy in > `x-focus-frame'. Emacs could first test whether the window manager is EWMH compliant and depending on the outcome only call one of those functions. x_ewmh_activate_frame seems to test whether the WM supports "_NET_ACTIVE_WINDOW". I guess, we could just move that over to x-focus-frame. >> We agreed that we wont fix 3. > > Yes. Over night I had a little idea that could be useful. I'm just writing it down here so that it's not lost: We could avoid the focus-when-mapped problem, if we clear the input flag in WM_HINTS (the GTK equivalent seems to be gtk_window_set_accept_focus) when we create the frame. But when we receive the MapNotify event, we enable the flag. This should prevent the window manager from focusing the frame initially but afterwards it should be treated as usual. I also found the gtk_window_set_focus_on_map function. This seems to rely on the _NET_WM_USER_TIME EWMH. Sawfish ignores _NET_WM_USER_TIME, but it could be useful for other window managers. >> Fixing 2 isn't so clear. This was shortly discussed on the mailing list >> but RMS said, at that time, that more important things should be done. > > You mean we could solve this with your update-focus-lazily approach? I think it's feasible, yes. Helmut.