🐛 fix the paste panel corners and menu glyphs on Windows - #5062
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #5039 (#4995). On Windows the floating button's right-click menu rendered every label as boxes, and the panel came up square with a grey rectangle showing behind its rounded content.
Menu glyphs
AWT owner-draws its heavyweight menus through the logical-font tables of
fontconfig, andPlatformFontmaps any physical family a caller sets back to the logicalsansserif, so giving the menu a CJK font changes nothing. Since JDK 18 the default encoding is UTF-8, and the Windows tables only carryUTF-8.ja,UTF-8.koandUTF-8.hisequences: Chinese falls through to the alphabetic-only default and every label renders as boxes, regardless of locale.The button menu is therefore shown as a plain Win32 menu on Windows (
CreatePopupMenu/TrackPopupMenu), which Windows draws itself with the system UI font and font linking, so any language displays.WindowsPopupMenuruns the modal menu loop on its own thread with a hidden owner window and message loop, the same pattern as the clipboard listeners, and hands the picked action back to the main dispatcher. macOS and Linux keep the AWTPopupMenu(native NSMenu on macOS). The entries are described once asNativeMenuEntryand fed to either implementation.Panel corners
The panel was a per-pixel-alpha (layered) window with the DWM transient backdrop applied. Two things break there:
DWMWA_WINDOW_CORNER_PREFERENCE(documented as "cannot ever be rounded"), so the Compose clip was the only rounding.Windows now keeps the transparent window purely for the rounded corners and no longer requests the backdrop: the panel paints its own opaque rounded card with a hairline
sectionCardBorder. This also applies on Windows 10, which previously fell back to a square opaque window.PastePanelContenttakes a smallPastePanelSurface(ACRYLIC for macOS, CARD for Windows, PLAIN for Linux) instead of the singletransparentflag. macOS and Linux behaviour is unchanged.Verification
app:compileKotlinDesktopand the paste panel tests pass.