all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
To: 11513@debbugs.gnu.org
Subject: bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows
Date: Sat, 19 May 2012 06:06:09 +0900	[thread overview]
Message-ID: <20120518210617.D4D181E0043@msa101.auone-net.jp> (raw)

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	other threads:[~2012-05-18 21:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-18 21:06 Kazuhiro Ito [this message]
2012-05-19  8:02 ` bug#11513: 24.1.50; raise-frame never raise the foreground window on Windows 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120518210617.D4D181E0043@msa101.auone-net.jp \
    --to=kzhr@d1.dion.ne.jp \
    --cc=11513@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.