unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows
@ 2012-05-18 21:06 Kazuhiro Ito
  2012-05-19  8:02 ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Kazuhiro Ito @ 2012-05-18 21:06 UTC (permalink / raw)
  To: 11513

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





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-05-28 17:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-18 21:06 bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows Kazuhiro Ito
2012-05-19  8:02 ` Eli Zaretskii
2012-05-19 12:02   ` Kazuhiro Ito
2012-05-19 12:42     ` Eli Zaretskii
2012-05-19 12:56       ` martin rudalics
2012-05-19 13:47         ` Eli Zaretskii
2012-05-21 19:12         ` Eli Zaretskii
2012-05-23 10:48           ` Kazuhiro Ito
2012-05-23 16:20             ` Eli Zaretskii
2012-05-23 16:38               ` Drew Adams
2012-05-24  6:04               ` Kazuhiro Ito
2012-05-24 16:01                 ` Lennart Borgman
2012-05-28 17:28                 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).