From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailsrv.cs.umass.edu (mailsrv.cs.umass.edu [128.119.240.136]) by sourceware.org (Postfix) with ESMTPS id 5F4763858D3C for ; Sun, 30 Oct 2022 18:35:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5F4763858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cs.umass.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.umass.edu Received: from [192.168.50.148] (c-24-62-201-179.hsd1.ma.comcast.net [24.62.201.179]) by mailsrv.cs.umass.edu (Postfix) with ESMTPSA id E63DA401C1D8; Sun, 30 Oct 2022 14:35:22 -0400 (EDT) Message-ID: <06715e64-2392-80c7-2cba-ff08a0e17726@cs.umass.edu> Date: Sun, 30 Oct 2022 14:35:22 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Reply-To: moss@cs.umass.edu Subject: Re: New Windows open behind current ones rather than in front Content-Language: en-US To: Jon Turney , The Cygwin Mailing List References: <831ebd6a-431e-9355-c8d6-8645e90e1180@dronecode.org.uk> From: Eliot Moss In-Reply-To: <831ebd6a-431e-9355-c8d6-8645e90e1180@dronecode.org.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 10/30/2022 8:21 AM, Jon Turney wrote: > On 14/10/2022 16:58, Eliot Moss wrote: >> Dear Cygwiners - >> >> I am having an issue under Windows 11 where new windows, when spawned from the command line of >> (say) Cygwin bash or WSL2 bash come up *behind* current Windows.  This behavior seems new to >> Windows 11. Anybody know a setting or technique to control / change this?  Two examples: >> >> - Spawn Word from Cygwin bash >> - Spawn okular from WSL 2 >> >> If I spawn xterm from Cygwin bash, it comes up in front, but from WSL2 bash, it comes up behind. >> My X server is the Cygwin one.  Happy to provide more details if this is not enough. > > I have seen something like this on occasion with windows created by the Cygwin X server, but that > seems to be associated with having "focus follows mouse" mode turned on. > > I'm not sure if that os some problem in the way that the X server manages the Z-order of it's > windows, or something about the way that the X server creates windows interacting with any 'focus > stealing prevention' heuristic that windows has (See 'ForegroundLockTimeout'). > > Your first example doesn't seem to involve X at all, so I guess that points towards the second > theory... Thank you, Jon! I did a little more digging and found that following these instructions to turn on Windows "Prevent windows from being automatically arranged when moved to the edge of the screen" stopped X windows from starting behind the window of the command that spawned them: Go to "Control Panel". Select "Ease of Access". Select "Change how your mouse works". Enable the checkbox: "Prevent windows from being automatically arranged when moved to the edge of the screen." It does not seem to change the "new window comes up behind Cygwin xterm bash" for new windows that are Windows programs as opposed to X programs. I wonder if this could have anything to do with how Cygwin deals with spawning non-Cygwin programs ... Best - Eliot