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

From: Eli Zaretskii <[email-masked]>
Date: Sat, 19 May 2012 11:02:23 +0300

> Date: Sat, 19 May 2012 06:06:09 +0900
> From: Kazuhiro Ito <[email-masked]>
> 
> 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.