From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kazuhiro Ito Newsgroups: gmane.emacs.bugs Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows Date: Sat, 19 May 2012 06:06:09 +0900 Message-ID: <20120518210617.D4D181E0043@msa101.auone-net.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Trace: dough.gmane.org 1337375266 16856 80.91.229.3 (18 May 2012 21:07:46 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 18 May 2012 21:07:46 +0000 (UTC) To: 11513@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 18 23:07:45 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SVUOn-0004s8-EY for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 May 2012 23:07:45 +0200 Original-Received: from localhost ([::1]:59187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVUOm-0000iZ-QP for geb-bug-gnu-emacs@m.gmane.org; Fri, 18 May 2012 17:07:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVUOk-0000iR-0L for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 17:07:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVUOi-0000pg-8b for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 17:07:41 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVUOi-0000pX-4n for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 17:07:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SVUP4-0004f4-DQ for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 17:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kazuhiro Ito Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 May 2012 21:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.133737525917885 (code B ref -1); Fri, 18 May 2012 21:08:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 May 2012 21:07:39 +0000 Original-Received: from localhost ([127.0.0.1]:33215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVUOg-0004eN-Mq for submit@debbugs.gnu.org; Fri, 18 May 2012 17:07:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39069) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVUO4-0004cp-NC for submit@debbugs.gnu.org; Fri, 18 May 2012 17:07:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVUNb-0000ZM-HJ for submit@debbugs.gnu.org; Fri, 18 May 2012 17:06:32 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:40499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVUNb-0000ZC-Eo for submit@debbugs.gnu.org; Fri, 18 May 2012 17:06:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVUNZ-0000dJ-Rs for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 17:06:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVUNY-0000Y0-34 for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 17:06:29 -0400 Original-Received: from msa101.auone-net.jp ([61.117.18.161]:33053) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVUNX-0000Vu-PF for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 17:06:27 -0400 Original-Received: from GUNGNIR.med.osaka-cu.ac.jp (121-87-85-189f1.nar1.eonet.ne.jp [121.87.85.189]) by msa101.auone-net.jp (au one net msa) with ESMTP id D4D181E0043; Sat, 19 May 2012 06:06:17 +0900 (JST) User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.1.50 (i386-mingw-nt6.1.7601) MULE/6.0 (HANACHIRUSATO) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:60197 Archived-At: When I start Emacs with -Q option nd evaluate the below code, I get unexpected result. (let ((frame (selected-frame))) (lower-frame frame) ;; If we change the foreground window while sleeping, raise-frame ;; correctly works. (sleep-for 5) (raise-frame frame)) Result: raise-frame never raise the frame if the selected frame is the foreground window. If other frame or application is the foreground window, raise-frame works as expected. I guess SetForegroundWindow function does not modify Z-order when the window is already foreground. Below patch or similar workaround would be needed. === modified file 'src/w32fns.c' --- src/w32fns.c 2012-05-11 06:39:26 +0000 +++ src/w32fns.c 2012-05-18 11:24:26 +0000 @@ -3681,6 +3760,8 @@ retval = SetForegroundWindow ((HWND) wParam); + BringWindowToTop ((HWND) wParam); + /* Detach from the previous foreground thread. */ if (foreground_thread) AttachThreadInput (GetCurrentThreadId (), -- Kazuhiro Ito