Addresses reported flickering and rendering problems on ARM64 devices
running Windows 11 25H2 by implementing ARM64-specific rendering
defaults, build configuration fixes, and redraw optimizations.
Rendering fixes:
- Default to SC_TECHNOLOGY_DIRECTWRITERETAIN on ARM64 to preserve
back buffer between frames, avoiding blank flashes with Qualcomm
Adreno GPUs and Win11 25H2 DWM compositor changes
- Wrap MsgThemeChanged() in WM_SETREDRAW FALSE/TRUE to suppress
N intermediate repaints during heavy theme/DPI transitions
- Add WS_EX_COMPOSITED to main window on ARM64 for system-level
double-buffering
- Remove RDW_ERASE from DarkMode ListView/TreeView RedrawWindow()
calls to avoid background erase flash during theme changes
Build configuration fixes:
- Add _WIN64 preprocessor define to Scintilla, SciLexer, Lexilla
ARM64 configurations (was missing, could cause 32-bit code paths)
- Add TargetMachine=MachineARM64 to all ARM64 linker sections across
Notepad3, Scintilla, SciLexer, Lexilla projects
- Add CETCompat=false to Scintilla and SciLexer ARM64 configurations
(CET is x86/x64 only, not compatible with ARM64)
Platform code improvements:
- Add _M_ARM64 detection for GrepWin binary selection (ARM64 was
silently mapped to x64 binary via _WIN64 check)
- Add NP3_BUILD_ARM64 helper macro in TypeDefs.h for future
ARM64-specific code paths
- Document RenderingTechnology setting in Build/Notepad3.ini with
per-resolution override syntax and ARM64 troubleshooting tips
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds FontStyle enum matching DWRITE_FONT_STYLE values:
- Normal (0)
- Oblique (1)
- Italic (2)
This provides explicit API support for oblique fonts like 'Iosevka Oblique'.
Adds full range of font weights to support all DirectWrite variants:
- Thin (100), ExtraLight (200), Light (300), SemiLight (350)
- Normal (400), Medium (500)
- SemiBold (600), Bold (700), ExtraBold (800), Black (900), ExtraBlack (950)
Adds ResolveFontFace() function to properly resolve font face names like
'Cascadia Mono Light' or 'Iosevka Oblique' into DirectWrite family name
plus weight/style/stretch parameters.
Uses IDWriteGdiInterop::CreateFontFromLOGFONT() to correctly resolve
font parameters that would otherwise cause DirectWrite to fail silently.
Fixes: #4150 (Iosevka variable fonts)
Fixes: #5410 (Global Default Font not applying)
Fixes: #5455 (Cascadia Mono Light rendering)
Based on Scintilla Bug #2080 and MR #36 discussion.
Changed InvalidateStyleRedraw() to Redraw() in SetSelectionFromSerialized
to match Scintilla 5.5.8 upstream.
Note: ListBox.cxx was already at 5.5.8 parity (opaque colors, ItemHeight bitmap).
Created patches comparing NP3 implementation vs official 5.5.8:
- include/: 2 patches (Scintilla.h, ScintillaTypes.h)
- src/: 16 patches (Editor.cxx largest at 247 lines)
- win32/: 4 patches (ScintillaWin.cxx largest at 380 lines)
All 21 files with NON STD SCI PATCH markers now documented.
Upgrade procedure: copy 5.5.8, apply patches, preserve oniguruma.
The partial upgrade approach failed - Scintilla 5.5.8 src/ files have
tight coupling with win32/ that cannot be separated due to changes in
PLATFORM_ASSERT and other shared macros. Scintilla stays at 5.5.7.
Lexilla 5.4.6 upgrade remains intact.
Reverts the broken Scintilla 5.5.8 / Lexilla 5.4.6 upgrade from
commit 2e4889e82 which was inadvertently pulled during rebase.
This restores the last known working state before incremental
upgrade attempt.
- Updated Scintilla from 5.5.7 to 5.5.8
- Updated Lexilla from 5.4.5 to 5.4.6
- Preserved NP3 customizations (oniguruma regex, lexers_x, Scintilla.h patches)
- Documented all Scintilla.h NP3 patches in research doc
- Added _upgrade_backup to .gitignore
- Updated Changes.txt with upgrade entry
The show count [1] of the mouse cursor, controlled by `ShowCursor()`, is
thread-local and has an effect only when the cursor is above a window of the
same thread. On the other hand, `GetCursorInfo()` reports the asynchronous
state of the cursor, which may be outside the editor window and doesn't
reflect the show count of our thread.
So, it is incorrect to manipulate the show count according to the result of
`GetCursorInfo()`. This commit reverts relevant changes about `cursorIsHidden`
in upstream Scintilla.
When the editor window loses focus but the cursor is not above it, the system
does not send a `WM_MOUSELEAVE` notification. So we also have to recover the
cursor state in `WM_KILLFOCUS`.
This closes https://github.com/rizonesoft/Notepad3/issues/5369
[1] https://devblogs.microsoft.com/oldnewthing/20091217-00/?p=15643
Signed-off-by: LIU Hao <lh_mouse@126.com>