From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Q on frame focus with MS Windows Date: Tue, 25 Oct 2005 23:45:38 +0200 Message-ID: <435EA782.6090001@student.lu.se> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1130276841 3732 80.91.229.2 (25 Oct 2005 21:47:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 25 Oct 2005 21:47:21 +0000 (UTC) Cc: Emacs-Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 25 23:47:19 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EUWcF-0000T4-Bl for ged-emacs-devel@m.gmane.org; Tue, 25 Oct 2005 23:45:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EUWcE-0007oA-T8 for ged-emacs-devel@m.gmane.org; Tue, 25 Oct 2005 17:45:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EUWc6-0007o2-A8 for emacs-devel@gnu.org; Tue, 25 Oct 2005 17:45:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EUWc4-0007no-LL for emacs-devel@gnu.org; Tue, 25 Oct 2005 17:45:46 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EUWc4-0007nl-IR for emacs-devel@gnu.org; Tue, 25 Oct 2005 17:45:44 -0400 Original-Received: from [81.228.11.98] (helo=pne-smtpout1-sn1.fre.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EUWc4-00068C-Hz for emacs-devel@gnu.org; Tue, 25 Oct 2005 17:45:44 -0400 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout1-sn1.fre.skanova.net (7.2.060.1) id 435CB134000AA09C; Tue, 25 Oct 2005 23:45:40 +0200 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: Drew Adams In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:44871 Archived-At: Drew Adams wrote: >What I'm looking for is: > >1. To understand this better. Just what is the nature/cause of the problem? > >2. A way (workaround) to deal with this problem - something that will keep >the input focus in the minibuffer for as long as the minibuffer is active. >(So, for instance, if done by redirect-frame-focus, I would want that undone >after the minibuffer is inactivated.) > >3. If this is a bug in some sense, which could be fixed in Emacs, that would >be great. However, I also need this to work in other versions of Emacs, so I >would still want the workaround (#2). > >Any help is appreciated. > > I am not sure here, but I dived into the C code to see what might be happening. If I understand this correct (which I am not sure about at all) this happens: 1) A frame is created through a call to x-create-frame. 2) This calls x_make_frame_visible 3) There is a call to my_show_window with a parameter that is SW_SHOWNORMAL which I guess is later given to the w32 API ShowWindow or something similar. The documentation for SW_SHOWNORMAL says SW_SHOWNORMAL Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time. I am not sure about what "activates" mean here but I believe it was that it will get the keyboard input focus. And I wonder if the documentation is correct when it sounds that you have to use SW_SHOWNORMAL. *************** A workaround is maybe to use `after-make-frame-functions'?