From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#23174: Windows : Emacs frame stays on top after Alt-Tab Date: Fri, 01 Apr 2016 10:02:09 +0300 Message-ID: <83r3epu80e.fsf@gnu.org> References: <56FCEB26.9070607@null.net> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1459494197 8326 80.91.229.3 (1 Apr 2016 07:03:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Apr 2016 07:03:17 +0000 (UTC) Cc: 23174@debbugs.gnu.org To: devi8@null.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Apr 01 09:03:09 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1alt6q-0003S2-Se for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Apr 2016 09:03:09 +0200 Original-Received: from localhost ([::1]:36293 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alt6q-0005XQ-FL for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Apr 2016 03:03:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alt6n-0005XK-5b for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2016 03:03:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alt6k-0004ZA-09 for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2016 03:03:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alt6j-0004Z6-SR for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2016 03:03:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1alt6j-0002l3-JR for bug-gnu-emacs@gnu.org; Fri, 01 Apr 2016 03:03:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Apr 2016 07:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23174 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23174-submit@debbugs.gnu.org id=B23174.145949414910559 (code B ref 23174); Fri, 01 Apr 2016 07:03:01 +0000 Original-Received: (at 23174) by debbugs.gnu.org; 1 Apr 2016 07:02:29 +0000 Original-Received: from localhost ([127.0.0.1]:46683 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1alt6D-0002kF-4D for submit@debbugs.gnu.org; Fri, 01 Apr 2016 03:02:29 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1alt6B-0002k4-UI for 23174@debbugs.gnu.org; Fri, 01 Apr 2016 03:02:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alt63-0004Nr-OT for 23174@debbugs.gnu.org; Fri, 01 Apr 2016 03:02:22 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alt63-0004Nm-M1; Fri, 01 Apr 2016 03:02:19 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2697 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1alt62-0002pf-Nu; Fri, 01 Apr 2016 03:02:19 -0400 In-reply-to: <56FCEB26.9070607@null.net> (devi8@null.net) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:115826 Archived-At: > From: devi8@null.net > Date: Thu, 31 Mar 2016 11:17:26 +0200 > > GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570 > > On Windows (7 Professional), after (?) switching from a Aero Desktop Theme back to a non-Aero Desktop Theme, > pressing Alt-Tab will switch application windows, but the Emacs Window ("Frame"?) will stay on the foreground, which is wrong behaviour. > Only after exiting and restarting Emacs is the correct behaviour restored again, and Alt-Tab works as expected. > > I saw some discussions on the use of SetForegroundWindow and some bug reports that might relate to this. > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=6468 > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=11513 > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=13954 > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=11513 > > In general I despise applications that use SetForegroundWindow, because almost all of them fail to do what the user wants, because of lack of knowledge of other active applications and the user's intentions. > This bug report is also an example of such behaviour. > > Why not totally remove the use of SetForegroundWindow (except maybe for sys_kill and some places that try to fix "bugs"), or at least make it customizable so that I can disable it? You may be right, but please explain how are the calls to SetForegroundWindow related to the problem you describe. IOW, please tell the details of how Alt-TAB winds up calling that API, or how the call to that API interferes with Alt-TAB. Emacs calls SetForegroundWindow in only 2 specific situations: when it was requested to direct a focus to a frame, and when it was requested to raise a frame. I don't necessarily see how is that related to the issue at hand. I also couldn't reproduce the problem, on Windows 8.1 and Emacs 24.5. Maybe I don't quite understand what you did, so please describe the recipe for reproducing the problem step by step, preferably starting with "emacs -Q".