bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11513: 24.1.50; raise-frame never raise the foreground window on Win


From: Kazuhiro Ito
Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows
Date: Sat, 19 May 2012 06:06:09 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Goj┼Ź) APEL/10.8 EasyPG/1.0.0 Emacs/24.1.50 (i386-mingw-nt6.1.7601) MULE/6.0 (HANACHIRUSATO)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]