From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from resqmta-c1p-023462.sys.comcast.net (resqmta-c1p-023462.sys.comcast.net [IPv6:2001:558:fd00:56::2]) by sourceware.org (Postfix) with ESMTPS id 12BBF3858D20 for ; Thu, 27 Jan 2022 03:13:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 12BBF3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=comcast.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=comcast.net Received: from resomta-c1p-023278.sys.comcast.net ([96.102.18.240]) by resqmta-c1p-023462.sys.comcast.net with ESMTP id CvBrnyNCcRSafCvDwnWDHq; Thu, 27 Jan 2022 03:13:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1643253204; bh=cLNWc+hEWQ5DY/xqnszRoEQSeVTGhRte5g1RFpT2vrg=; h=Received:Received:Content-Type:Message-ID:Date:MIME-Version: Subject:To:From; b=VfDrPxqS8/HI2jAZbTRk63iUIMMbxvAoTOlEZUH26oJzaIyibQliBo2LlDzyVOzG5 bXDHjF7dM3CbWMW8MwpGEMngOVVbYrkfMskPXkp5bAs+wgd/Ec/MLiykw+cEglV5th vCO3CkjjKEQ8y2suOQsJt1v7BasSFVq+1DPnR9x88kgGco82INr1I7RY5JJ4+p8JuL 8BMcsYfqdCD/a0g0sWiZw4cOceRTLTjLhcm8kSZ43BJsJmmssfHkDhu4GAX2TDCJ6r kYknIRzI+dJYP38rvWC50PRHktm5HR7UtrKUQq6O6terMpdDQbE/WPTo7CD/4gy5vY JVP37Wcioozew== Received: from [IPV6:2601:541:c103:bf60:ed03:82c7:46f5:253e] ([IPv6:2601:541:c103:bf60:ed03:82c7:46f5:253e]) by resomta-c1p-023278.sys.comcast.net with ESMTPSA id CvDXnTEAbNql6CvDYnV5RW; Thu, 27 Jan 2022 03:13:00 +0000 X-Xfinity-VMeta: sc=-100.00;st=legit Message-ID: <2e8f1d16-92eb-b66e-c49e-7e38e5f07110@comcast.net> Date: Wed, 26 Jan 2022 22:12:58 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: Cygwin/X with Win10 display scaling corrupting font display of typed characters - Issue identified - "Solution" found Content-Language: en-US To: The Cygwin Mailing List References: <02b8ba82-0a40-e9ea-c4e6-fe201097d957@comcast.net> <4f4d8d34-3e30-82fe-4be2-2926da2c1c6a@dronecode.org.uk> <37ce4364-d009-4280-ebf2-739b5aa6a66d@dronecode.org.uk> From: Ken Whitesell In-Reply-To: <37ce4364-d009-4280-ebf2-739b5aa6a66d@dronecode.org.uk> X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, JMQ_SPF_NEUTRAL, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2022 03:13:29 -0000 Thank You!!! On 1/24/2022 10:02 AM, Jon Turney wrote: > On 20/01/2022 01:01, Ken Whitesell wrote: >> On 1/19/2022 2:28 PM, Jon Turney wrote: >>> On 19/01/2022 00:02, Ken Whitesell wrote: >>>> On 1/17/2022 1:29 PM, Ken Whitesell wrote: >>>>> >>>>> Is there a known solution for this? (Or is it known that there is >>>>> no solution?) >>> >>> Thanks for reporting this. >>> >>>>> Any guidance, pointers, suggestions of avenues for further >>>>> research, or other information, will all be greatly appreciated. >>>>> >>>> After more research and experimentation, it appears to be related >>>> to one of xorg-server, xorg-server-common, or xorg-server-xorg. >>>> >>>> Installing the older version 1.20.12-1 of these packages allows the >>>> windows to be moved between monitors without any issues. Upgrading >>>> to the current version 21.1.3-1 creates the problems. I'm able to >>>> replicate this behavior on two different laptops with two different >>>> external monitors. >>> >>> It seems likely that this is an unintended effect of changes in >>> xorg-server 21.1.0-1, trying to fix problems in this area (See [1]) >> >> Thanks for the references. I've read all the messages in the thread - >> I was particularly intrigued by this comment: >> >> wrt the font scaling issue, looking at the source, it seems that we >> don't re-consider the display dpi after a WM_DISPLAYCHANGE message, but >> keep on using the value determined at startup.  This is probably a bug. >> >> I'm curious enough to want to take a look at the code, but I've got >> no belief that I'm going to be able to find an answer. (I'm *not* a >> C++ programmer. I can read it and write a little of it, but that's >> about it.) I was going to start by comparing the last known-working >> version to the first known-non-working version, but given that it's a >> major release change, that's not likely going to be a useful >> approach. (I'm way out of my league here. It's probably going to take >> me a long time just to get to the point where I can even begin to >> explore this.) > > The relevant change, which tries to fix the issue identified in that > comment, and probably introduces this issue is: > > https://gitlab.freedesktop.org/jturney/xserver/-/commit/b19b6266d33f2b911dc1826ad5c03da135a39957 > > > [...] >>>> If I change the scaling from 125% to 100% on the laptop's display, >>>> the problem appears until I restart Cygwin/X. Restarting Cygwin/X >>>> shows it displaying properly, until I change the scaling again. >>> >>> I could only reproduce this problem with mis-rendering when changing >>> the scaling on the secondary monitor. >> >> Wow, I did a really poor job of writing that. I'm sorry. >> >> For clarity, just in case you were unable to interpret what I meant >> by what I wrote - >> >> At start: Laptop scaling set at 125%, second monitor at 100%. >> >> Mis-rendering occurs at start, on the second monitor only. >> >> If I change the scaling on the laptop, while the current instance of >> XWin is running - the same mis-rendering now occurs on the laptop. >> >> Interestingly enough, if I change the laptop from 125% to 100%, the >> tops are clipped as previously reported. But if I change the scaling >> from 125% to 150%, then the bottoms are clipped. (It kinda makes >> sense from what you've written.) >> >> If I then stop and restart XWin after having reset the scaling such >> that both monitors have the same setting, then the problem doesn't >> appear. > > Thanks for the clarification. > > The laptop display is the primary monitor in all cases, correct? Yes, the laptop display is the primary monitor in all cases. But, the real reason for my reply at this point is to report that I have found a solution for _my_ issue. I make no guarantees about any problems anyone else may be facing, nor can I make any statement about whether or not this causes other problems. Obligatory disclaimer: I don't really know what I'm doing here. I'm not a Windows developer, and I know just enough about cygwin to muddle my way through doing what I want to do with the help of the mailing lists and other resources. I'm not in a position to _explain_ anything. This works for me, but that's as far as I can go. First, the bottom line: XWin.exe.manifest, line 21 change: PerMonitorV2,PerMonitor to PerMonitor Some details: I managed to get to a point where I could build the packages from source and install them. I looked at the commit you referred me to, and started reverting changes, one-by-one - at least in so far as the change appeared to make sense to me. Anyway, I got to this change, and sure enough, it worked. Removing the "PerMonitorV2" solved the issue. Also, I confirmed that it's the "PerMonitorV2" that is causing the issue and not having both of them by running another test with just the "PerMonitorV2" - and that still shows the problem. References with further information if it's going to be helpful to anyone: https://docs.microsoft.com/en-us/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process and https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows