PowerToys
PowerToys copied to clipboard
make the edge of always on top look better when the edge is thin (Windows11)
Description of the new feature / enhancement
currently when it is thin, it does not look pretty (the radius of the corner of the edge is too small):

Scenario when this would be used?
anytime using always on top
and when the thickness is set to 1px to 3px, there is an area between the corner of the window and the corner of the edge

I think the corner of the edge of AoT and the corner of the edge of the window should use the same center of circle (pardon my bad english)
Something configuration wise is off. What build of PowerToys are you on? For me this looks correct in 0.60.1 and i'm on Windows Insider build 25145. Wondering if some type of scaling or something.
Here is the corner of Edge. You should see white bleed through like yours but it hugs correctly.

/needinfo /reportbug
Hi there!
We need a bit more information to really debug this issue. Can you add a "Report Bug" zip file here? You right click on our system tray icon and just go to report bug. Then drag the zipfile from your desktop onto the GitHub comment box in this issue. Thanks! 
The other oddity is the X for closing has jaggied near the top, something is weird. The first screenshot i can't see anything that seems off, the second shot i can but like i said, i can't repro this.
I'm on powertoys 0.60.1 and on windows11 stable build 22000 PowerToysReport_2022-07-20-09-35-04.zip
The first screenshot i can't see anything that seems off,
I just meant that it doesn’t look pretty.
The other oddity is the X for closing has jaggied near the top, something is weird.
It is just because of the screenshot tool, I cannot see that on my screen, but in the screenshot, so there's no need to care about it
and when the thickness is set to 1px to 3px, there is an area between the corner of the window and the corner of the edge
I'm getting this too, happy to provide my bug report zip if needed. Bit harder to see on mine due to the colours but definitely there.

@SeraphimaZykova the display scaling (aka dpi) isn't correctly calculated for the actual radius. Notice this on my SP4 when changing from (default) 200% to 100% (with 1px thickness)
-
Aside from the radius, we should also bump the minimum thickness from 0 to 1. A few tickmarks on the slider would be nice too.
-
~Though a nit, when I (slowly) increase the thickness I see the border expanding both away from the window and below the window, with the middle staying on the window edge. I see this is intentional, but why? For me personally, I would expect thickness to move outward only.~
Aside from the radius, we should also bump the minimum thickness from 0 to 1. A few tickmarks on the slider would be nice too.
I think we should have a choise to set it to zero.
Using zero == switching the border to off
I didn't realize that.
@SeraphimaZykova I realise it's low prio, but think this is an easy fix? [dpi-aware radius; min-thinkness; centralized/outward]
I see why "The border stroke is centered on the line" and drawn double-width, but (if we use the correct values for the radius) we can remove this and draw the line fully outside of the window edges.
Suggestion to re-write as:
border-corner-radius = thickness / 2 + window-radius // (usually 8px, but do check with window)
// to draw middle of border:
border.left = window.left - thickness / 2
border.top = window.top - thickness / 2
border.right = window.right + thickness / 2
border.bottom = window.bottom + thickness / 2
// alternative (un-used)
border.width = window.width + thickness
border.height = window.height + thickness

Question:
D2D1_ROUNDED_RECT structure Even when both radiuX and radiusY are zero, the rounded rectangle is different from a rectangle., When stroked, the corners of the rounded rectangle are roundly joined, not mitered (square).
(link)
My opinion is we can use only this function (and scratch the sharp corners) because then it'll look more like the window-shadow does. I think it's much prettier :)
@SeraphimaZykova I love the way it is now! 😄