www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/08/14/07:10:25

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3E1B03857817
Authentication-Results: sourceware.org; dmarc=none (p=none dis=none)
header.from=dronecode.org.uk
Authentication-Results: sourceware.org; spf=none smtp.mailfrom=dronecode.org.uk
Authentication-Results: btinternet.com;
auth=pass (PLAIN) smtp.auth=jonturney AT btinternet DOT com;
bimi=skipped
X-SNCR-Rigid: 62E573CC029E90E0
X-Originating-IP: [81.153.98.171]
X-OWM-Source-IP: 81.153.98.171 (GB)
X-OWM-Env-Sender: jonturney AT btinternet DOT com
X-VadeSecure-score: verdict=clean score=0/300, class=clean
X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvfedrvdehtddgfeeiucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkffggfgfuhffvfhgjtgfgsehtkeertddtfeejnecuhfhrohhmpeflohhnucfvuhhrnhgvhicuoehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkqeenucggtffrrghtthgvrhhnpeduffejjeeifeffteehheeuleetffffjedugffhkeeiueevkedukeelhefhudefgfenucffohhmrghinhepmhhitghrohhsohhfthdrtghomhenucfkphepkedurdduheefrdelkedrudejudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopegludelvddrudeikedruddruddthegnpdhinhgvthepkedurdduheefrdelkedrudejuddpmhgrihhlfhhrohhmpehjohhnrdhtuhhrnhgvhiesughrohhnvggtohguvgdrohhrghdruhhkpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepmfgvnhghhhhithgvshgvlhhlsegtohhmtggrshhtrdhnvghtpdhrtghpthhtoheptgihghifihhnsegthihgfihinhdrtghomh
X-RazorGate-Vade-Verdict: clean 0
X-RazorGate-Vade-Classification: clean
Message-ID: <efaf327a-1fcb-e269-d7a4-74409c16b04b@dronecode.org.uk>
Date: Sun, 14 Aug 2022 12:08:25 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.12.0
Subject: Re: Cygwin/X with Win10 display scaling corrupting font display of
typed characters - Issue identified - "Solution" found
From: Jon Turney <jon DOT turney AT dronecode DOT org DOT uk>
To: Ken Whitesell <KenWhitesell AT comcast DOT net>,
The Cygwin Mailing List <cygwin AT cygwin DOT com>
References: <b56c0a7e-27f3-c165-6331-69b71b2075a5 AT comcast DOT net>
<02b8ba82-0a40-e9ea-c4e6-fe201097d957 AT comcast DOT net>
<4f4d8d34-3e30-82fe-4be2-2926da2c1c6a AT dronecode DOT org DOT uk>
<ebef1f87-1457-3068-2657-af5dfa5c484e AT comcast DOT net>
<37ce4364-d009-4280-ebf2-739b5aa6a66d AT dronecode DOT org DOT uk>
<2e8f1d16-92eb-b66e-c49e-7e38e5f07110 AT comcast DOT net>
<b5d8769c-cf7c-e654-83c0-b7f375e5f64b AT dronecode DOT org DOT uk>
In-Reply-To: <b5d8769c-cf7c-e654-83c0-b7f375e5f64b@dronecode.org.uk>
X-Spam-Status: No, score=-1192.2 required=5.0 tests=BAYES_00, FORGED_SPF_HELO,
KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_NONE,
SPF_HELO_PASS, SPF_NONE, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 27EBA1SD018234

On 05/02/2022 14:25, Jon Turney wrote:
> On 27/01/2022 03:12, Ken Whitesell wrote:
>> First, the bottom line:
>>
>> XWin.exe.manifest, line 21
>>
>> change:
>> <dpiAwareness>PerMonitorV2,PerMonitor</dpiAwareness>
>> to
>> <dpiAwareness>PerMonitor</dpiAwareness>
>>
>> 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.
> 
> Thanks for taking the time to narrow this down.  It's been very helpful.
> 
> Working through the documented effects of that [1], I was able to work 
> out that this mis-rendering is due to the non-client area scaling.
> 
> [1] See under DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 in
> https://docs.microsoft.com/en-us/windows/win32/hidpi/dpi-awareness-context
> 
> If you turn off 'Hide Root Window' from the tray menu, you can kind of 
> see what's going wrong: normally the client area of the X window is 
> exactly aligned with that in the root window, but when the non-client 
> area is rescaled by a DPI change (the title bar changes size 
> significantly), it's misaligned so that part of the X window is outside 
> the client area (and thus clipped in updates).
> 
> I think this is due to the AdjustWindowsRectEx() function not being DPI 
> aware (I guess it's always computing the non-client window rect based on 
> the processes initial DPI)
> 
> Unfortunately, from an initial look, rewriting things to use 
> AdjustWindowRectExForDpi() isn't trivial (since we need to make 'DPI of 
> the monitor this Window is going to end up on' available to it)
> 
> So for the moment, I think I'll apply your reversion (although this 
> probably comes at the cost of not scaling the window frame, the traymenu 
> and About... dialog)

I made this change in xserver 21.1.4-1.

Thanks again for tracking this down.

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019