From unknown Wed Sep 10 06:21:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows 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: To: 11513@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.133737525917885 (code B ref -1); Fri, 18 May 2012 21:08:02 +0000 Received: (at submit) by debbugs.gnu.org; 18 May 2012 21:07:39 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 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 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 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 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 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) Date: Sat, 19 May 2012 06:06:09 +0900 From: Kazuhiro Ito 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) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Message-Id: <20120518210617.D4D181E0043@msa101.auone-net.jp> 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-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) 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 From unknown Wed Sep 10 06:21:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 May 2012 08:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kazuhiro Ito Cc: 11513@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 11513-submit@debbugs.gnu.org id=B11513.133741458411911 (code B ref 11513); Sat, 19 May 2012 08:04:02 +0000 Received: (at 11513) by debbugs.gnu.org; 19 May 2012 08:03:04 +0000 Received: from localhost ([127.0.0.1]:33597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVecx-000363-PX for submit@debbugs.gnu.org; Sat, 19 May 2012 04:03:04 -0400 Received: from mtaout23.012.net.il ([80.179.55.175]:47180) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVecv-00035L-2h for 11513@debbugs.gnu.org; Sat, 19 May 2012 04:03:02 -0400 Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0M4900L00FG0TB00@a-mtaout23.012.net.il> for 11513@debbugs.gnu.org; Sat, 19 May 2012 11:02:28 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4900L7OFNXLJ70@a-mtaout23.012.net.il>; Sat, 19 May 2012 11:02:22 +0300 (IDT) Date: Sat, 19 May 2012 11:02:23 +0300 From: Eli Zaretskii In-reply-to: <20120518210617.D4D181E0043@msa101.auone-net.jp> X-012-Sender: halo1@inter.net.il Message-id: <83obpkzjhs.fsf@gnu.org> References: <20120518210617.D4D181E0043@msa101.auone-net.jp> X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sat, 19 May 2012 06:06:09 +0900 > From: Kazuhiro Ito > > 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. I cannot reproduce this on my Windows XP system. When I evaluate the above, the Emacs frame is correctly lowered (i.e. goes behind the other window(s)), and then is brought into the foreground several seconds later. > If other frame or application is the foreground window, raise-frame > works as expected. What exactly do you mean by "If other frame or application is the foreground window"? If the Emacs frame is the only foreground window (i.e. all the others are iconified) when I evaluate the recipe, then the Emacs frame is neither lowered nor raised, which I think is the expected behavior. So please specify more precisely the conditions for reproducing this problem, in terms of what other windows should or should not be present on the display before evaluating the recipe code. Perhaps the recipe lacks some specific mouse gestures to achieve the required effect? Also, please provide the details normally collected by "M-x report-emacs-bug RET". They are important. Thanks. From unknown Wed Sep 10 06:21:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows Resent-From: Kazuhiro Ito Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 May 2012 12:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 11513@debbugs.gnu.org Received: via spool by 11513-submit@debbugs.gnu.org id=B11513.13374290034060 (code B ref 11513); Sat, 19 May 2012 12:04:02 +0000 Received: (at 11513) by debbugs.gnu.org; 19 May 2012 12:03:23 +0000 Received: from localhost ([127.0.0.1]:33722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SViNW-00013Q-VU for submit@debbugs.gnu.org; Sat, 19 May 2012 08:03:23 -0400 Received: from msa104.auone-net.jp ([61.117.18.164]:33299) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SViNA-00012d-EN for 11513@debbugs.gnu.org; Sat, 19 May 2012 08:03:21 -0400 Received: from GUNGNIR.med.osaka-cu.ac.jp (121-87-85-189f1.nar1.eonet.ne.jp [121.87.85.189]) by msa104.auone-net.jp (au one net msa) with ESMTP id 7181D2C037; Sat, 19 May 2012 21:02:30 +0900 (JST) Date: Sat, 19 May 2012 21:02:21 +0900 From: Kazuhiro Ito In-Reply-To: <83obpkzjhs.fsf@gnu.org> References: <20120518210617.D4D181E0043@msa101.auone-net.jp> <83obpkzjhs.fsf@gnu.org> 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.7600) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Message-Id: <20120519120231.7181D2C037@msa104.auone-net.jp> X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > > 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. > > I cannot reproduce this on my Windows XP system. When I evaluate the > above, the Emacs frame is correctly lowered (i.e. goes behind the > other window(s)), and then is brought into the foreground several > seconds later. The problem also occurs with pre-compiled pretest binary (*1) on Windows XP and Windows 7 (Professional, x64) system. In my environment, when I evaluate the above code, Emacs frame is correctly lowered too, but is not brought into the foreground. Emacs frame keeps behind the other application window(s). (*1) http://alpha.gnu.org/gnu/emacs/pretest/windows/emacs-24.0.97-bin-i386.zip > > If other frame or application is the foreground window, raise-frame > > works as expected. > > What exactly do you mean by "If other frame or application is the > foreground window"? If I change foreground application from Emacs to other application via ALT + TAB or mouse click while Emacs runs sleep-for function in the above code, Emacs frame is brought into the foreground several seconds later. that is the expected result. > So please specify more precisely the conditions for reproducing this > problem, in terms of what other windows should or should not be > present on the display before evaluating the recipe code. Perhaps the > recipe lacks some specific mouse gestures to achieve the required > effect? 1. Launch other Windows application (e.g. explorer, Command Prompt). 2. Start Emacs with -Q option. 3. Move Emacs frame to make it to overlap other application window(s) with mouse drag. 4. Yank the below code into *scratch* buffer. (let ((frame (selected-frame))) (lower-frame frame) (sleep-for 5) (raise-frame frame)) 5. Evaluate it with C-j. 6. Keep away from keyboard and mouse until Emacs finishes evaluation. Result: Emacs frame is behind other application window(s). Expected result: Emacs frame is in front of other application window(s). > Also, please provide the details normally collected by > "M-x report-emacs-bug RET". Here is the details with pretest binary. This bug report will be sent to the Bug-GNU-Emacs mailing list and the GNU bug tracker at debbugs.gnu.org. Please check that the From: line contains a valid email address. After a delay of up to one day, you should receive an acknowledgement at that address. Please write in English if possible, as the Emacs maintainers usually do not have translators for other languages. Please describe exactly what actions triggered the bug, and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. For information about debugging Emacs, please read the file f:/emacs-24.0.97/etc/DEBUG. In GNU Emacs 24.0.97.1 (i386-mingw-nt6.1.7601) of 2012-05-17 on MARVIN Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --with-gcc (4.6) --no-opt --enable-checking --cflags -ID:/devel/emacs/libs/libXpm-3.5.8/include -ID:/devel/emacs/libs/libXpm-3.5.8/src -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include -ID:/devel/emacs/libs/giflib-4.1.4-1/include -ID:/devel/emacs/libs/jpeg-6b-4/include -ID:/devel/emacs/libs/tiff-3.8.2-1/include -ID:/devel/emacs/libs/gnutls-3.0.9/include' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: JPN value of $XMODIFIERS: nil locale-coding-system: cp932 default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-y C-j x r e p o r t < return> Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark set Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail regexp-opt rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date japan-util tooltip ediff-hook vc-hooks lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win w32-vars tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process multi-tty emacs) -- Kazuhiro Ito From unknown Wed Sep 10 06:21:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 May 2012 12:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kazuhiro Ito Cc: 11513@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 11513-submit@debbugs.gnu.org id=B11513.13374314867879 (code B ref 11513); Sat, 19 May 2012 12:45:01 +0000 Received: (at 11513) by debbugs.gnu.org; 19 May 2012 12:44:46 +0000 Received: from localhost ([127.0.0.1]:33790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVj1a-000232-8L for submit@debbugs.gnu.org; Sat, 19 May 2012 08:44:46 -0400 Received: from mtaout21.012.net.il ([80.179.55.169]:43974) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVj1E-00022X-Uj for 11513@debbugs.gnu.org; Sat, 19 May 2012 08:44:44 -0400 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0M4900400SIJSI00@a-mtaout21.012.net.il> for 11513@debbugs.gnu.org; Sat, 19 May 2012 15:42:55 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M49004ROSNJNU40@a-mtaout21.012.net.il>; Sat, 19 May 2012 15:42:55 +0300 (IDT) Date: Sat, 19 May 2012 15:42:57 +0300 From: Eli Zaretskii In-reply-to: <20120519120231.7181D2C037@msa104.auone-net.jp> X-012-Sender: halo1@inter.net.il Message-id: <83havcz6i6.fsf@gnu.org> References: <20120518210617.D4D181E0043@msa101.auone-net.jp> <83obpkzjhs.fsf@gnu.org> <20120519120231.7181D2C037@msa104.auone-net.jp> X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sat, 19 May 2012 21:02:21 +0900 > From: Kazuhiro Ito > Cc: 11513@debbugs.gnu.org > > 1. Launch other Windows application (e.g. explorer, Command Prompt). > 2. Start Emacs with -Q option. > 3. Move Emacs frame to make it to overlap other application window(s) > with mouse drag. > 4. Yank the below code into *scratch* buffer. > > (let ((frame (selected-frame))) > (lower-frame frame) > (sleep-for 5) > (raise-frame frame)) > > 5. Evaluate it with C-j. > 6. Keep away from keyboard and mouse until Emacs finishes evaluation. > > Result: Emacs frame is behind other application window(s). > > Expected result: Emacs frame is in front of other application > window(s). Thanks. I get the expected result on my system, with the latest pretest binary. The only differences I could think of that could explain why we get different results are (1) I built the pretest myself (will try the binary you used later); and (2) some Windows configuration changes, either on your system or on mine, that make our systems behave differently. Would other Windows users please try reproducing this problem on their machines? From unknown Wed Sep 10 06:21:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows Resent-From: martin rudalics Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 May 2012 12:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Kazuhiro Ito , 11513@debbugs.gnu.org Received: via spool by 11513-submit@debbugs.gnu.org id=B11513.13374322568948 (code B ref 11513); Sat, 19 May 2012 12:58:01 +0000 Received: (at 11513) by debbugs.gnu.org; 19 May 2012 12:57:36 +0000 Received: from localhost ([127.0.0.1]:33794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVjDy-0002KG-Hx for submit@debbugs.gnu.org; Sat, 19 May 2012 08:57:35 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:43153) by debbugs.gnu.org with smtp (Exim 4.72) (envelope-from ) id 1SVjDb-0002JZ-Jx for 11513@debbugs.gnu.org; Sat, 19 May 2012 08:57:32 -0400 Received: (qmail invoked by alias); 19 May 2012 12:56:38 -0000 Received: from 62-47-34-231.adsl.highway.telekom.at (EHLO [62.47.34.231]) [62.47.34.231] by mail.gmx.net (mp016) with SMTP; 19 May 2012 14:56:38 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19D2YJ0nWZDUVsIgc4SzO2HyAsqLBKxpQ4p2zlbeM kT6M9/f4tUkGci Message-ID: <4FB79899.8040408@gmx.at> Date: Sat, 19 May 2012 14:56:57 +0200 From: martin rudalics MIME-Version: 1.0 References: <20120518210617.D4D181E0043@msa101.auone-net.jp> <83obpkzjhs.fsf@gnu.org> <20120519120231.7181D2C037@msa104.auone-net.jp> <83havcz6i6.fsf@gnu.org> In-Reply-To: <83havcz6i6.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > Would other Windows users please try reproducing this problem on their > machines? Not reproducible on Windows XP. Tested with release and trunk, both built by myself. martin From unknown Wed Sep 10 06:21:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 19 May 2012 13:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: kzhr@d1.dion.ne.jp, 11513@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 11513-submit@debbugs.gnu.org id=B11513.133743526813285 (code B ref 11513); Sat, 19 May 2012 13:48:02 +0000 Received: (at 11513) by debbugs.gnu.org; 19 May 2012 13:47:48 +0000 Received: from localhost ([127.0.0.1]:33828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVk0a-0003SE-9F for submit@debbugs.gnu.org; Sat, 19 May 2012 09:47:48 -0400 Received: from mtaout22.012.net.il ([80.179.55.172]:48120) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVk0W-0003Rx-Qy for 11513@debbugs.gnu.org; Sat, 19 May 2012 09:47:46 -0400 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M4900B00VI57900@a-mtaout22.012.net.il> for 11513@debbugs.gnu.org; Sat, 19 May 2012 16:47:11 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4900AN2VMNQX90@a-mtaout22.012.net.il>; Sat, 19 May 2012 16:47:11 +0300 (IDT) Date: Sat, 19 May 2012 16:47:13 +0300 From: Eli Zaretskii In-reply-to: <4FB79899.8040408@gmx.at> X-012-Sender: halo1@inter.net.il Message-id: <83ehqgz3j2.fsf@gnu.org> References: <20120518210617.D4D181E0043@msa101.auone-net.jp> <83obpkzjhs.fsf@gnu.org> <20120519120231.7181D2C037@msa104.auone-net.jp> <83havcz6i6.fsf@gnu.org> <4FB79899.8040408@gmx.at> X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sat, 19 May 2012 14:56:57 +0200 > From: martin rudalics > CC: Kazuhiro Ito , 11513@debbugs.gnu.org > > > Would other Windows users please try reproducing this problem on their > > machines? > > Not reproducible on Windows XP. Tested with release and trunk, both > built by myself. Thanks for testing. From unknown Wed Sep 10 06:21:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 May 2012 19:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: kzhr@d1.dion.ne.jp, 11513@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 11513-submit@debbugs.gnu.org id=B11513.133762760727115 (code B ref 11513); Mon, 21 May 2012 19:14:01 +0000 Received: (at 11513) by debbugs.gnu.org; 21 May 2012 19:13:27 +0000 Received: from localhost ([127.0.0.1]:37601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SWY2p-00073I-HM for submit@debbugs.gnu.org; Mon, 21 May 2012 15:13:27 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:44216) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SWY2m-000733-Js for 11513@debbugs.gnu.org; Mon, 21 May 2012 15:13:25 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0M4D00200ZAH9V00@a-mtaout20.012.net.il> for 11513@debbugs.gnu.org; Mon, 21 May 2012 22:12:38 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4E002FH0126Y40@a-mtaout20.012.net.il>; Mon, 21 May 2012 22:12:38 +0300 (IDT) Date: Mon, 21 May 2012 22:12:46 +0300 From: Eli Zaretskii In-reply-to: <4FB79899.8040408@gmx.at> X-012-Sender: halo1@inter.net.il Message-id: <83sjetxs9d.fsf@gnu.org> References: <20120518210617.D4D181E0043@msa101.auone-net.jp> <83obpkzjhs.fsf@gnu.org> <20120519120231.7181D2C037@msa104.auone-net.jp> <83havcz6i6.fsf@gnu.org> <4FB79899.8040408@gmx.at> X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Sat, 19 May 2012 14:56:57 +0200 > From: martin rudalics > CC: Kazuhiro Ito , 11513@debbugs.gnu.org > > > Would other Windows users please try reproducing this problem on their > > machines? > > Not reproducible on Windows XP. Tested with release and trunk, both > built by myself. It's a very elusive problem. I managed to reproduce it on 1 system out of 3 to which I have constant access, and even that only for a few minutes and under some conditions. E.g., when lowering the frame left only the left side of the Emacs frame visible, the bug would manifest itself; whereas when its right side was visible, it won't. And once I reshuffled the other windows a bit, the bug disappeared and I couldn't reproduce it anymore. Do you get the faulty behavior consistently? If so, what's your value of this Registry key: HKEY_CURRENT_USER\Control Panel\Desktop\UserPreferencesMask Anyway, back to the discussion, I notice that: . The documentation of SetForegroundWindow (http://msdn.microsoft.com/en-us/library/windows/desktop/ms633539%28v=vs.85%29.aspx) lists quite a few of conditions under which the function will succeed; are you sure at least one of them was true when you tried? can you look at the value of 'retval' after the function returns without bringing the frame to the foreground? . This page: http://stackoverflow.com/questions/1544179/what-are-the-differences-between-bringwindowtotop-setforegroundwindow-setwindo seems to tell that BringWindowToTop might fail as well, if it is applied to a child window. What does this mean in terms of Emacs frames? . There are quite a few discussions about this that Google picks up, and most of them clearly say that using BringWindowToTop isn't sufficient, either. From unknown Wed Sep 10 06:21:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows Resent-From: Kazuhiro Ito Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 May 2012 10:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: martin rudalics , 11513@debbugs.gnu.org Received: via spool by 11513-submit@debbugs.gnu.org id=B11513.133777020328774 (code B ref 11513); Wed, 23 May 2012 10:51:01 +0000 Received: (at 11513) by debbugs.gnu.org; 23 May 2012 10:50:03 +0000 Received: from localhost ([127.0.0.1]:40402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SX98k-0007U3-V3 for submit@debbugs.gnu.org; Wed, 23 May 2012 06:50:03 -0400 Received: from msa103.auone-net.jp ([61.117.18.163]:38911) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SX98g-0007TW-2v for 11513@debbugs.gnu.org; Wed, 23 May 2012 06:50:00 -0400 Received: from GUNGNIR.med.osaka-cu.ac.jp (unknown [114.179.36.76]) by msa103.auone-net.jp (au one net msa) with ESMTP id CAA5A34803A; Wed, 23 May 2012 19:49:06 +0900 (JST) Date: Wed, 23 May 2012 19:48:59 +0900 From: Kazuhiro Ito In-Reply-To: <83sjetxs9d.fsf@gnu.org> References: <20120518210617.D4D181E0043@msa101.auone-net.jp> <83obpkzjhs.fsf@gnu.org> <20120519120231.7181D2C037@msa104.auone-net.jp> <83havcz6i6.fsf@gnu.org> <4FB79899.8040408@gmx.at> <83sjetxs9d.fsf@gnu.org> 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.7600) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Message-Id: <20120523104906.CAA5A34803A@msa103.auone-net.jp> X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) At Mon, 21 May 2012 22:12:46 +0300, Eli Zaretskii wrote: > It's a very elusive problem. I managed to reproduce it on 1 system > out of 3 to which I have constant access, and even that only for a few > minutes and under some conditions. E.g., when lowering the frame left > only the left side of the Emacs frame visible, the bug would manifest > itself; whereas when its right side was visible, it won't. And once I > reshuffled the other windows a bit, the bug disappeared and I couldn't > reproduce it anymore. > > Do you get the faulty behavior consistently? raise-frame always make the unexpected result when Emacs frame is the foreground window (I mean Emacs frame is colored as active window) and behind of other application window(s). And, as I described previously, If Emacs frame is not the foreground window raise-frame correctly works. > If so, what's your value of this Registry key: > HKEY_CURRENT_USER\Control Panel\Desktop\UserPreferencesMask Key's value is '98 12 07 80 12 00 00 00'. > . The documentation of SetForegroundWindow > (http://msdn.microsoft.com/en-us/library/windows/desktop/ms633539%28v=vs.85%29.aspx) > lists quite a few of conditions under which the function will > succeed; are you sure at least one of them was true when you tried? > can you look at the value of 'retval' after the function returns > without bringing the frame to the foreground? I believe that my test case qualifies some of conditions and I confirmed SetForegroundWindow returns 1 even when the unexpected result has been made. > . This page: > http://stackoverflow.com/questions/1544179/what-are-the-differences-between-bringwindowtotop-setforegroundwindow-setwindo > > seems to tell that BringWindowToTop might fail as well, if it is > applied to a child window. What does this mean in terms of Emacs > frames? I don't know exactly, but I think a child window is a windows created with WS_CHILD style. In Emacs, w32_createscrollbar would make scroll bar as a child window. -- Kazuhiro Ito From unknown Wed Sep 10 06:21:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 May 2012 16:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kazuhiro Ito Cc: rudalics@gmx.at, 11513@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 11513-submit@debbugs.gnu.org id=B11513.133779010428688 (code B ref 11513); Wed, 23 May 2012 16:22:01 +0000 Received: (at 11513) by debbugs.gnu.org; 23 May 2012 16:21:44 +0000 Received: from localhost ([127.0.0.1]:40836 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SXEJj-0007Se-9C for submit@debbugs.gnu.org; Wed, 23 May 2012 12:21:43 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:59766) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SXEJg-0007SR-C7 for 11513@debbugs.gnu.org; Wed, 23 May 2012 12:21:41 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0M4H00B00HC9K400@a-mtaout20.012.net.il> for 11513@debbugs.gnu.org; Wed, 23 May 2012 19:20:44 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4H00B1BHEKF730@a-mtaout20.012.net.il>; Wed, 23 May 2012 19:20:44 +0300 (IDT) Date: Wed, 23 May 2012 19:20:57 +0300 From: Eli Zaretskii In-reply-to: <20120523104906.CAA5A34803A@msa103.auone-net.jp> X-012-Sender: halo1@inter.net.il Message-id: <83aa0yyil2.fsf@gnu.org> References: <20120518210617.D4D181E0043@msa101.auone-net.jp> <83obpkzjhs.fsf@gnu.org> <20120519120231.7181D2C037@msa104.auone-net.jp> <83havcz6i6.fsf@gnu.org> <4FB79899.8040408@gmx.at> <83sjetxs9d.fsf@gnu.org> <20120523104906.CAA5A34803A@msa103.auone-net.jp> X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Wed, 23 May 2012 19:48:59 +0900 > From: Kazuhiro Ito > Cc: martin rudalics , 11513@debbugs.gnu.org > > > Do you get the faulty behavior consistently? > > raise-frame always make the unexpected result when Emacs frame is > the foreground window (I mean Emacs frame is colored as active window) > and behind of other application window(s). And, as I described > previously, If Emacs frame is not the foreground window raise-frame > correctly works. But the default behavior on Windows is that a window that is lowered loses its focus. You need to click into it to get focus there. So how come a lowered window still has focus for you? From unknown Wed Sep 10 06:21:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 May 2012 16:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "'Eli Zaretskii'" , "'Kazuhiro Ito'" Cc: 11513@debbugs.gnu.org Received: via spool by 11513-submit@debbugs.gnu.org id=B11513.133779114830330 (code B ref 11513); Wed, 23 May 2012 16:40:02 +0000 Received: (at 11513) by debbugs.gnu.org; 23 May 2012 16:39:08 +0000 Received: from localhost ([127.0.0.1]:40841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SXEaa-0007t9-6h for submit@debbugs.gnu.org; Wed, 23 May 2012 12:39:08 -0400 Received: from rcsinet15.oracle.com ([148.87.113.117]:35823) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SXEaX-0007se-Mh for 11513@debbugs.gnu.org; Wed, 23 May 2012 12:39:06 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q4NGc7gD032441 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 23 May 2012 16:38:08 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q4NGc60Y006086 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 May 2012 16:38:07 GMT Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q4NGc5w7013451; Wed, 23 May 2012 11:38:06 -0500 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 23 May 2012 09:38:05 -0700 From: "Drew Adams" References: <20120518210617.D4D181E0043@msa101.auone-net.jp><83obpkzjhs.fsf@gnu.org><20120519120231.7181D2C037@msa104.auone-net.jp><83havcz6i6.fsf@gnu.org> <4FB79899.8040408@gmx.at><83sjetxs9d.fsf@gnu.org><20120523104906.CAA5A34803A@msa103.auone-net.jp> <83aa0yyil2.fsf@gnu.org> Date: Wed, 23 May 2012 09:38:04 -0700 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <83aa0yyil2.fsf@gnu.org> Thread-Index: Ac05ACIwpFwH82+KThO7jEFUxZ2kagAAZDFQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-Spam-Score: -6.9 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) > But the default behavior on Windows is that a window that is lowered > loses its focus. You need to click into it to get focus there. Really? Pick your favorite release, e.g. Emacs 23.3 or the latest Emacs 24 pretest, and do this: emacs -Q C-x 5 2 Move a frame if necessary, so they overlap. M-: (lower-frame) The frame with the focus, where you typed `M-:', is lowered (moved to the back), but it still has the input focus (is still selected). `M-x' and other input show up in its minibuffer, and its title bar is highlighted to indicate that it is selected. So I don't understand what you mean. It sounds like what you are saying contradicts what I see. From unknown Wed Sep 10 06:21:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows Resent-From: Kazuhiro Ito Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 May 2012 06:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: rudalics@gmx.at, 11513@debbugs.gnu.org, drew.adams@oracle.com Received: via spool by 11513-submit@debbugs.gnu.org id=B11513.133783971515426 (code B ref 11513); Thu, 24 May 2012 06:09:01 +0000 Received: (at 11513) by debbugs.gnu.org; 24 May 2012 06:08:35 +0000 Received: from localhost ([127.0.0.1]:41360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SXRDu-00040k-Cz for submit@debbugs.gnu.org; Thu, 24 May 2012 02:08:34 -0400 Received: from msa104.auone-net.jp ([61.117.18.164]:58110) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SXRDp-00040Z-Mp for 11513@debbugs.gnu.org; Thu, 24 May 2012 02:08:32 -0400 Received: from GUNGNIR.med.osaka-cu.ac.jp (w0109-49-134-20-109.uqwimax.jp [49.134.20.109]) by msa104.auone-net.jp (au one net msa) with ESMTP id 184722C037; Thu, 24 May 2012 15:07:30 +0900 (JST) Date: Thu, 24 May 2012 15:04:59 +0900 From: Kazuhiro Ito In-Reply-To: <83aa0yyil2.fsf@gnu.org> References: <20120518210617.D4D181E0043@msa101.auone-net.jp> <83obpkzjhs.fsf@gnu.org> <20120519120231.7181D2C037@msa104.auone-net.jp> <83havcz6i6.fsf@gnu.org> <4FB79899.8040408@gmx.at> <83sjetxs9d.fsf@gnu.org> <20120523104906.CAA5A34803A@msa103.auone-net.jp> <83aa0yyil2.fsf@gnu.org> 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.7600) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Message-Id: <20120524060731.184722C037@msa104.auone-net.jp> X-Spam-Score: -1.9 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > > raise-frame always make the unexpected result when Emacs frame is > > the foreground window (I mean Emacs frame is colored as active window) > > and behind of other application window(s). And, as I described > > previously, If Emacs frame is not the foreground window raise-frame > > correctly works. > > But the default behavior on Windows is that a window that is lowered > loses its focus. You need to click into it to get focus there. So > how come a lowered window still has focus for you? When I run lower-frame function in Emacs frame interactively, Emacs frame is brought behind of other application window(s) but has focus. Key inputs are passed to lowered frame. I tested 4 Windows PC, and all PCs show the same behavior. -- Kazuhiro Ito From unknown Wed Sep 10 06:21:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows Resent-From: Lennart Borgman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 24 May 2012 16:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11513 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Kazuhiro Ito Cc: Eli Zaretskii , 11513@debbugs.gnu.org Received: via spool by 11513-submit@debbugs.gnu.org id=B11513.13378754005482 (code B ref 11513); Thu, 24 May 2012 16:04:02 +0000 Received: (at 11513) by debbugs.gnu.org; 24 May 2012 16:03:20 +0000 Received: from localhost ([127.0.0.1]:42150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SXaVT-0001QN-LP for submit@debbugs.gnu.org; Thu, 24 May 2012 12:03:20 -0400 Received: from mail-lpp01m010-f44.google.com ([209.85.215.44]:54515) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SXaVQ-0001Q7-Ow for 11513@debbugs.gnu.org; Thu, 24 May 2012 12:03:18 -0400 Received: by lagv3 with SMTP id v3so5737951lag.3 for <11513@debbugs.gnu.org>; Thu, 24 May 2012 09:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=jKlyYrsACGmLgXneL4/+ACYCCecd1OC2/zC5hvp2WOA=; b=Hiv1r+Osn9RCWBrkOAD0cQd7nKaZOAuj/sd9GdBa0qe97zQTZAq90IwBEwaVjR+ASW okkFnqz1lPuOoCT2V0MIaGMyKU5tEekp4LvF9ZkqekZZwWhp4bnRKmHiegK4gzcMLnTm AweULaO4SNVBcZWqWsUMjt2xyvkMvnrrnZSwicAmcPsCjcNhYMNzWSyhDT77hfAP1vOi 6xZCpPGPA1lDeFvm6bjl0pGbOr27Bw0LcA6tw0PrT5I7+WXWc+f0l20AihOALzuXPUjB UhRWUXdOwDPnfRdIgGhK/ijbWwOxWt/WnjCzsOqEJiR5vnCDrFGFUs9NDL4Qp1wbSIHY 2BIQ== Received: by 10.112.45.168 with SMTP id o8mr4575708lbm.88.1337875331274; Thu, 24 May 2012 09:02:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.41.99 with HTTP; Thu, 24 May 2012 09:01:41 -0700 (PDT) In-Reply-To: <20120524060731.184722C037@msa104.auone-net.jp> References: <20120518210617.D4D181E0043@msa101.auone-net.jp> <83obpkzjhs.fsf@gnu.org> <20120519120231.7181D2C037@msa104.auone-net.jp> <83havcz6i6.fsf@gnu.org> <4FB79899.8040408@gmx.at> <83sjetxs9d.fsf@gnu.org> <20120523104906.CAA5A34803A@msa103.auone-net.jp> <83aa0yyil2.fsf@gnu.org> <20120524060731.184722C037@msa104.auone-net.jp> From: Lennart Borgman Date: Thu, 24 May 2012 18:01:41 +0200 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.6 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) On Thu, May 24, 2012 at 8:04 AM, Kazuhiro Ito wrote: >> > raise-frame always make the unexpected result when Emacs frame is >> > the foreground window (I mean Emacs frame is colored as active window) >> > and behind of other application window(s). =C2=A0And, as I described >> > previously, If Emacs frame is not the foreground window raise-frame >> > correctly works. >> >> But the default behavior on Windows is that a window that is lowered >> loses its focus. =C2=A0You need to click into it to get focus there. =C2= =A0So >> how come a lowered window still has focus for you? > > When I run lower-frame function in Emacs frame interactively, Emacs > frame is brought behind of other application window(s) but has focus. > Key inputs are passed to lowered frame. =C2=A0I tested 4 Windows PC, and > all PCs show the same behavior. The same happens for me. On the other hand the doc string for lower-frame does not say that the frame should loose focus. From unknown Wed Sep 10 06:21:10 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Kazuhiro Ito Subject: bug#11513: closed (Re: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows) Message-ID: References: <83fwak1ahe.fsf@gnu.org> <20120518210617.D4D181E0043@msa101.auone-net.jp> X-Gnu-PR-Message: they-closed 11513 X-Gnu-PR-Package: emacs Reply-To: 11513@debbugs.gnu.org Date: Mon, 28 May 2012 17:30:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1338226202-11988-1" This is a multi-part message in MIME format... ------------=_1338226202-11988-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #11513: 24.1.50; raise-frame never raise the foreground window on Windows which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 11513@debbugs.gnu.org. --=20 11513: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D11513 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1338226202-11988-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 11513-done) by debbugs.gnu.org; 28 May 2012 17:29:56 +0000 Received: from localhost ([127.0.0.1]:46861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SZ3lT-00036t-W1 for submit@debbugs.gnu.org; Mon, 28 May 2012 13:29:56 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:60457) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SZ3l8-00036N-QF for 11513-done@debbugs.gnu.org; Mon, 28 May 2012 13:29:54 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0M4Q00A00TT7NQ00@a-mtaout20.012.net.il> for 11513-done@debbugs.gnu.org; Mon, 28 May 2012 20:28:10 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4Q0091ITUXL5I0@a-mtaout20.012.net.il>; Mon, 28 May 2012 20:28:09 +0300 (IDT) Date: Mon, 28 May 2012 20:28:13 +0300 From: Eli Zaretskii Subject: Re: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows In-reply-to: <20120524060731.184722C037@msa104.auone-net.jp> X-012-Sender: halo1@inter.net.il To: Kazuhiro Ito Message-id: <83fwak1ahe.fsf@gnu.org> References: <20120518210617.D4D181E0043@msa101.auone-net.jp> <83obpkzjhs.fsf@gnu.org> <20120519120231.7181D2C037@msa104.auone-net.jp> <83havcz6i6.fsf@gnu.org> <4FB79899.8040408@gmx.at> <83sjetxs9d.fsf@gnu.org> <20120523104906.CAA5A34803A@msa103.auone-net.jp> <83aa0yyil2.fsf@gnu.org> <20120524060731.184722C037@msa104.auone-net.jp> X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11513-done Cc: rudalics@gmx.at, 11513-done@debbugs.gnu.org, drew.adams@oracle.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) > Date: Thu, 24 May 2012 15:04:59 +0900 > From: Kazuhiro Ito > Cc: rudalics@gmx.at, 11513@debbugs.gnu.org, drew.adams@oracle.com > > > > raise-frame always make the unexpected result when Emacs frame is > > > the foreground window (I mean Emacs frame is colored as active window) > > > and behind of other application window(s). And, as I described > > > previously, If Emacs frame is not the foreground window raise-frame > > > correctly works. > > > > But the default behavior on Windows is that a window that is lowered > > loses its focus. You need to click into it to get focus there. So > > how come a lowered window still has focus for you? > > When I run lower-frame function in Emacs frame interactively, Emacs > frame is brought behind of other application window(s) but has focus. > Key inputs are passed to lowered frame. I tested 4 Windows PC, and > all PCs show the same behavior. Sorry, I was confused. You are right, the focus isn't lost. Anyway, I don't think it is a good idea to modify the reaction to the WM_EMACS_SETFOREGROUND message, because it is also used by x-focus-frame, which is not supposed to raise the frame to the top of the Z-order, unless it is strictly necessary. And if the frame is already a foreground frame, raising it isn't necessary. So instead I introduced a new message, WM_EMACS_BRINGTOTOP, and used that in raise-frame. The diffs are below (installed as revision 108409 on the trunk). Thanks. I'm closing this bug report. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-05-28 07:13:45 +0000 +++ src/ChangeLog 2012-05-28 17:22:40 +0000 @@ -1,3 +1,17 @@ +2012-05-28 Eli Zaretskii + + * w32term.c (my_bring_window_to_top): New function. + (x_raise_frame): Use handle returned by DeferWindowPos, which + could be different from the original one. Call + my_bring_window_to_top instead of my_set_foreground_window. + (Bug#11513) + + * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP + by calling BringWindowToTop. + + * w32term.h (WM_EMACS_BRINGTOTOP): New message. + (WM_EMACS_END): Increase by one. + 2012-05-28 Paul Eggert * bidi.c (bidi_mirror_char): Put eassert before conversion to int. === modified file 'src/w32fns.c' --- src/w32fns.c 2012-05-25 18:19:24 +0000 +++ src/w32fns.c 2012-05-28 17:22:40 +0000 @@ -3663,6 +3663,7 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARA case WM_EMACS_SHOWWINDOW: return ShowWindow ((HWND) wParam, (WPARAM) lParam); + case WM_EMACS_BRINGTOTOP: case WM_EMACS_SETFOREGROUND: { HWND foreground_window; @@ -3680,6 +3681,8 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARA foreground_thread = 0; retval = SetForegroundWindow ((HWND) wParam); + if (msg == WM_EMACS_BRINGTOTOP) + retval = BringWindowToTop ((HWND) wParam); /* Detach from the previous foreground thread. */ if (foreground_thread) === modified file 'src/w32term.c' --- src/w32term.c 2012-05-18 08:36:50 +0000 +++ src/w32term.c 2012-05-28 17:22:40 +0000 @@ -3492,6 +3492,12 @@ my_destroy_window (struct frame * f, HWN (WPARAM) hwnd, 0); } +static void +my_bring_window_to_top (HWND hwnd) +{ + SendMessage (hwnd, WM_EMACS_BRINGTOTOP, (WPARAM) hwnd, 0); +} + /* Create a scroll bar and return the scroll bar vector for it. W is the Emacs window on which to create the scroll bar. TOP, LEFT, WIDTH and HEIGHT are the pixel coordinates and dimensions of the @@ -5600,24 +5606,27 @@ x_raise_frame (struct frame *f) HDWP handle = BeginDeferWindowPos (2); if (handle) { - DeferWindowPos (handle, - FRAME_W32_WINDOW (f), - HWND_TOP, - 0, 0, 0, 0, - SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); - - DeferWindowPos (handle, - GetForegroundWindow (), - FRAME_W32_WINDOW (f), - 0, 0, 0, 0, - SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); - - EndDeferWindowPos (handle); + handle = DeferWindowPos (handle, + FRAME_W32_WINDOW (f), + HWND_TOP, + 0, 0, 0, 0, + SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); + if (handle) + { + handle = DeferWindowPos (handle, + GetForegroundWindow (), + FRAME_W32_WINDOW (f), + 0, 0, 0, 0, + SWP_NOSIZE | SWP_NOMOVE | + SWP_NOACTIVATE); + if (handle) + EndDeferWindowPos (handle); + } } } else { - my_set_foreground_window (FRAME_W32_WINDOW (f)); + my_bring_window_to_top (FRAME_W32_WINDOW (f)); } UNBLOCK_INPUT; === modified file 'src/w32term.h' --- src/w32term.h 2012-01-19 07:21:25 +0000 +++ src/w32term.h 2012-05-28 17:22:40 +0000 @@ -576,7 +576,8 @@ do { \ #define WM_EMACS_HIDE_CARET (WM_EMACS_START + 18) #define WM_EMACS_SETCURSOR (WM_EMACS_START + 19) #define WM_EMACS_PAINT (WM_EMACS_START + 20) -#define WM_EMACS_END (WM_EMACS_START + 21) +#define WM_EMACS_BRINGTOTOP (WM_EMACS_START + 21) +#define WM_EMACS_END (WM_EMACS_START + 22) #define WND_FONTWIDTH_INDEX (0) #define WND_LINEHEIGHT_INDEX (4) ------------=_1338226202-11988-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 18 May 2012 21:07:39 +0000 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 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 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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 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 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 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 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 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) Date: Sat, 19 May 2012 06:06:09 +0900 From: Kazuhiro Ito To: bug-gnu-emacs@gnu.org Subject: 24.1.50; raise-frame never raise the foreground window on Windows User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.1.50 (i386-mingw-nt6.1.7601) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Message-Id: <20120518210617.D4D181E0043@msa101.auone-net.jp> 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-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) 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 ------------=_1338226202-11988-1--