Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package scintilla for openSUSE:Factory checked in at 2023-08-04 15:03:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/scintilla (Old) and /work/SRC/openSUSE:Factory/.scintilla.new.22712 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "scintilla" Fri Aug 4 15:03:22 2023 rev:39 rq:1102213 version:5.3.6 Changes: -------- --- /work/SRC/openSUSE:Factory/scintilla/scintilla.changes 2023-06-11 19:58:26.168301573 +0200 +++ /work/SRC/openSUSE:Factory/.scintilla.new.22712/scintilla.changes 2023-08-04 15:03:32.684325933 +0200 @@ -1,0 +2,13 @@ +Wed Aug 2 23:45:58 UTC 2023 - Atri Bhattacharya <[email protected]> + +- Update to version 5.3.6: + * Redraw calltip after showing as didn't update when size of new + text exactly same as previous. Feature #1486. + * On Qt, for IMEs, update micro focus when selection changes. + This may move the location of IME popups to align with the + caret. + * On Qt, implement replacement for IMEs which may help with + actions like reconversion. This is similar to + delete-surrounding on GTK. + +------------------------------------------------------------------- Old: ---- scintilla535.tgz New: ---- scintilla536.tgz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ scintilla.spec ++++++ --- /var/tmp/diff_new_pack.rn82ya/_old 2023-08-04 15:03:33.488330944 +0200 +++ /var/tmp/diff_new_pack.rn82ya/_new 2023-08-04 15:03:33.496330995 +0200 @@ -17,8 +17,8 @@ %define so_ver 5.3 -%define _ver %{so_ver}.5 -%define tar_ver 535 +%define _ver %{so_ver}.6 +%define tar_ver 536 %define libname libscintilla5 Name: scintilla Version: %{_ver} ++++++ scintilla535.tgz -> scintilla536.tgz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/cocoa/Scintilla/Info.plist new/scintilla/cocoa/Scintilla/Info.plist --- old/scintilla/cocoa/Scintilla/Info.plist 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/cocoa/Scintilla/Info.plist 2023-07-26 07:50:44.000000000 +0200 @@ -15,7 +15,7 @@ <key>CFBundlePackageType</key> <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> <key>CFBundleShortVersionString</key> - <string>5.3.5</string> + <string>5.3.6</string> <key>CFBundleVersion</key> <string>$(CURRENT_PROJECT_VERSION)</string> <key>NSHumanReadableCopyright</key> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/cocoa/Scintilla/Scintilla.xcodeproj/project.pbxproj new/scintilla/cocoa/Scintilla/Scintilla.xcodeproj/project.pbxproj --- old/scintilla/cocoa/Scintilla/Scintilla.xcodeproj/project.pbxproj 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/cocoa/Scintilla/Scintilla.xcodeproj/project.pbxproj 2023-07-26 07:50:44.000000000 +0200 @@ -573,7 +573,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 5.3.5; + CURRENT_PROJECT_VERSION = 5.3.6; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -636,7 +636,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 5.3.5; + CURRENT_PROJECT_VERSION = 5.3.6; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; @@ -667,7 +667,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 5.3.5; + CURRENT_PROJECT_VERSION = 5.3.6; DEAD_CODE_STRIPPING = YES; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; @@ -702,7 +702,7 @@ CODE_SIGN_IDENTITY = "-"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 5.3.5; + CURRENT_PROJECT_VERSION = 5.3.6; DEAD_CODE_STRIPPING = YES; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/cppcheck.suppress new/scintilla/cppcheck.suppress --- old/scintilla/cppcheck.suppress 2023-02-07 23:11:09.000000000 +0100 +++ new/scintilla/cppcheck.suppress 2023-07-26 07:50:44.000000000 +0200 @@ -1,5 +1,6 @@ // File to suppress cppcheck warnings for files that will not be fixed. // Does not suppress warnings where an additional occurrence of the warning may be of interest. +// Configured for cppcheck 2.11 // Coding style is to use assignments in constructor when there are many // members to initialize or the initialization is complex or has comments. @@ -13,6 +14,12 @@ // Written with variable for consistency knownArgument:scintilla/src/SparseVector.h +// cppcheck 2.11 can't find system headers on Win32. +missingIncludeSystem + +// cppcheck 2.11 limits checking of complex functions unless --check-level=exhaustive +checkLevelNormal:scintilla/src/Editor.cxx + // The cast converts from 'unsigned char ' to 'char' so isn't unused. // Redundant code: Found unused cast of expression 'leadByte' constStatement:scintilla/src/Document.cxx @@ -30,31 +37,42 @@ unusedFunction:scintilla/qt/ScintillaEdit/ScintillaDocument.cpp // Doesn't understand changing dropWentOutside in Editor -knownConditionTrueFalse:scintilla/qt/ScintillaEditBase/ScintillaQt.cpp knownConditionTrueFalse:scintilla/win32/ScintillaWin.cxx +// GetData is implementing interface so shouldn't add const +constParameterPointer:scintilla/win32/ScintillaWin.cxx + +// Doesn't handle intptr_t (long long) being signed +knownConditionTrueFalse:scintilla/src/Editor.cxx +knownConditionTrueFalse:scintilla/src/EditView.cxx + +// cppcheck seems to believe that unique_ptr<T *[]>::get returns void* instead of T** +arithOperationsOnVoidPointer:scintilla/src/PerLine.cxx +arithOperationsOnVoidPointer:scintilla/src/PositionCache.cxx + +// Cppcheck wrongly assumes string_view::remove_prefix can not empty the view +knownConditionTrueFalse:scintilla/src/CallTip.cxx + // G_DEFINE_TYPE is too complex to pass to cppcheck unknownMacro:scintilla/gtk/PlatGTK.cxx // maskSmooth set depending on preprocessor allowing Wayland definition badBitmaskCheck:scintilla/gtk/ScintillaGTK.cxx -// Difficult to test accessibility so don't change -constVariable:scintilla/gtk/ScintillaGTKAccessible.cxx +// Changing events to const pointers changes signature and would require casts when hooking up +constParameterPointer:scintilla/gtk/ScintillaGTK.cxx +constParameterCallback:scintilla/gtk/ScintillaGTK.cxx -// Have no way of testing ScintillaEdit so don't fix even simple warnings -cstyleCast:scintilla/qt/ScintillaEdit/ScintillaEdit.cpp -shadowFunction:scintilla/qt/ScintillaEdit/ScintillaEdit.cpp - -// cppcheck fails emit from Qt -shadowFunction:scintilla/qt/ScintillaEditBase/ScintillaQt.cpp -shadowFunction:scintilla/qt/ScintillaEditBase/ScintillaEditBase.cpp +// Difficult to test accessibility so don't change +constParameterPointer:scintilla/gtk/ScintillaGTKAccessible.cxx +constVariableReference:scintilla/gtk/ScintillaGTKAccessible.cxx +constVariablePointer:scintilla/gtk/ScintillaGTKAccessible.cxx // moc_ files show #error as they are not built with standard context preprocessorErrorDirective:scintilla/qt/*.cpp -// moc_ files are not understood by cppcheck -noValidConfiguration +// Doesn't understand Qt slots macro +unknownMacro:scintilla/qt/ScintillaEditBase/*.h // The performance cost of by-value passing is often small and using a reference decreases // code legibility. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/doc/ScintillaDoc.html new/scintilla/doc/ScintillaDoc.html --- old/scintilla/doc/ScintillaDoc.html 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/doc/ScintillaDoc.html 2023-07-26 07:50:44.000000000 +0200 @@ -1347,7 +1347,7 @@ Coalescing treats coalescible container actions as transparent so will still only group together insertions that look like typing or deletions that look like multiple uses of the Backspace or Delete keys. </p> - + <h2 id="ChangeHistory">Change history</h2> <p>Scintilla can display document changes (modified, saved, ...) in the margin or in the text.</p> @@ -3366,114 +3366,114 @@ <tbody> <tr> <td><code>SC_CHARSET_ANSI</code></td> - <td>✓</td> - <td>✓</td> - <td>✓ (8859-1)</td></tr> + <td>✓</td> + <td>✓</td> + <td>✓ (8859-1)</td></tr> <tr> <td><code>SC_CHARSET_ARABIC</code></td> - <td>✓</td> + <td>✓</td> <td></td> - <td>✓</td></tr> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_BALTIC</code></td> - <td>✓</td> + <td>✓</td> <td></td> - <td>✓</td></tr> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_CHINESEBIG5</code></td> - <td>✓</td> + <td>✓</td> <td></td> - <td>✓</td></tr> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_DEFAULT</code></td> - <td>✓</td> - <td>✓ (8859-1)</td> - <td>✓ (8859-1)</td></tr> + <td>✓</td> + <td>✓ (8859-1)</td> + <td>✓ (8859-1)</td></tr> <tr> <td><code>SC_CHARSET_EASTEUROPE</code></td> - <td>✓</td> - <td>✓</td> - <td>✓</td></tr> + <td>✓</td> + <td>✓</td> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_GB2312</code></td> - <td>✓</td> - <td>✓</td> - <td>✓</td></tr> + <td>✓</td> + <td>✓</td> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_GREEK</code></td> - <td>✓</td> + <td>✓</td> <td></td> - <td>✓</td></tr> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_HANGUL</code></td> - <td>✓</td> - <td>✓</td> - <td>✓</td></tr> + <td>✓</td> + <td>✓</td> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_HEBREW</code></td> - <td>✓</td> + <td>✓</td> <td></td> - <td>✓</td></tr> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_JOHAB</code></td> - <td>✓</td> + <td>✓</td> <td></td> - <td>✓</td></tr> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_MAC</code></td> - <td>✓</td> + <td>✓</td> <td></td> - <td>✓</td></tr> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_OEM</code></td> - <td>✓</td> + <td>✓</td> <td></td> - <td>✓</td></tr> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_RUSSIAN</code></td> - <td>✓ (cp1251)</td> - <td>✓ (koi8-r)</td> - <td>✓ (cp1251)</td></tr> + <td>✓ (cp1251)</td> + <td>✓ (koi8-r)</td> + <td>✓ (cp1251)</td></tr> <tr> <td><code>SC_CHARSET_SHIFTJIS</code></td> - <td>✓</td> - <td>✓</td> - <td>✓</td></tr> + <td>✓</td> + <td>✓</td> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_SYMBOL</code></td> - <td>✓</td> + <td>✓</td> <td></td> - <td>✓</td></tr> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_THAI</code></td> - <td>✓</td> + <td>✓</td> <td></td> - <td>✓</td></tr> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_TURKISH</code></td> - <td>✓</td> + <td>✓</td> <td></td> - <td>✓</td></tr> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_VIETNAMESE</code></td> - <td>✓</td> + <td>✓</td> <td></td> - <td>✓</td></tr> + <td>✓</td></tr> <tr> <td><code>SC_CHARSET_OEM866</code></td> <td></td> - <td>✓ (cp866)</td> + <td>✓ (cp866)</td> <td></td></tr> <tr> <td><code>SC_CHARSET_CYRILLIC</code></td> <td></td> - <td>✓ (cp1251)</td> - <td>✓ (cp1251)</td></tr> + <td>✓ (cp1251)</td> + <td>✓ (cp1251)</td></tr> <tr> <td><code>SC_CHARSET_8859_15</code></td> <td></td> - <td>✓</td> - <td>✓</td></tr> + <td>✓</td> + <td>✓</td></tr> </tbody></table> <p><b id="SCI_STYLESETCASE">SCI_STYLESETCASE(int style, int caseVisible)</b><br /> @@ -4882,12 +4882,12 @@ rectangular and multiple selection, with IME interactions such as retrieve-surrounding or reconversion feature.</p> <table class="standard" summary="IME input method"> - <caption>IME input method support (O=present, X=absent)</caption> + <caption>IME input method support</caption> <thead align="left"> <tr> <th>IME input method</th> <th>Windows</th> - <th>Gtk</th> + <th>GTK</th> <th>Qt</th> <th>macOS</th> </tr> @@ -4895,17 +4895,17 @@ <tbody valign="top"> <tr> <th align="left"><code>SC_IME_WINDOWED</code></th> - <td>O</td> - <td>O</td> - <td>X</td> - <td>X</td> + <td>✓</td> + <td>✓</td> + <td> </td> + <td> </td> </tr> <tr> <th align="left"><code>SC_IME_INLINE</code></th> - <td>O</td> - <td>O</td> - <td>O</td> - <td>O</td> + <td>✓</td> + <td>✓</td> + <td>✓</td> + <td>✓</td> </tr> </tbody> </table> @@ -4917,7 +4917,7 @@ <tr> <th>IME interaction</th> <th>Windows</th> - <th>Gtk</th> + <th>GTK</th> <th>Qt</th> <th>macOS</th> </tr> @@ -4925,24 +4925,24 @@ <tbody valign="top"> <tr> <th align="left">Retrieve Surrounding</th> - <td>O</td> - <td>O</td> - <td>O</td> - <td>O</td> + <td>✓</td> + <td>✓</td> + <td>✓</td> + <td>✓</td> </tr> <tr> <th align="left">Reconversion</th> - <td>O</td> - <td>O</td> - <td>O</td> - <td>O</td> + <td>✓</td> + <td>✓</td> + <td>✓</td> + <td>✓</td> </tr> <tr> <th align="left">Delete Surrounding</th> - <td>O</td> - <td>O</td> - <td>X</td> - <td>O</td> + <td>✓</td> + <td>✓</td> + <td>✓</td> + <td>✓</td> </tr> </tbody> </table> @@ -4979,7 +4979,7 @@ </p> <p>Opaque selection drawing (<a class="seealso" href="#SCI_SETSELECTIONLAYER">SCI_SETSELECTIONLAYER(SC_LAYER_BASE)</a>) is not supported in bidirectional mode. - Use <code>SC_LAYER_UNDER_TEXT</code> or <code>SC_LAYER_OVER_TEXT</code> instead. + Use <code>SC_LAYER_UNDER_TEXT</code> or <code>SC_LAYER_OVER_TEXT</code> instead. </p> </div> @@ -9683,7 +9683,7 @@ <td align="center">6</td> - <td>There was only a single choice in the list and 'choose single' mode was active as set by + <td>There was only a single choice in the list and 'choose single' mode was active as set by <code> <a class="seealso" href="#SCI_AUTOCSETCHOOSESINGLE">SCI_AUTOCSETCHOOSESINGLE</a></code>. ch is 0.</td> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/doc/ScintillaDownload.html new/scintilla/doc/ScintillaDownload.html --- old/scintilla/doc/ScintillaDownload.html 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/doc/ScintillaDownload.html 2023-07-26 07:50:44.000000000 +0200 @@ -26,9 +26,9 @@ <table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0"> <tr> <td> - <font size="4"> <a href="https://www.scintilla.org/scintilla535.zip"> + <font size="4"> <a href="https://www.scintilla.org/scintilla536.zip"> Windows</a> - <a href="https://www.scintilla.org/scintilla535.tgz"> + <a href="https://www.scintilla.org/scintilla536.tgz"> GTK/Linux</a> </font> </td> @@ -42,7 +42,7 @@ containing very few restrictions. </p> <h3> - Release 5.3.5 + Release 5.3.6 </h3> <h4> Source Code @@ -50,8 +50,8 @@ The source code package contains all of the source code for Scintilla but no binary executable code and is available in <ul> - <li><a href="https://www.scintilla.org/scintilla535.zip">zip format</a> (1.4M) commonly used on Windows</li> - <li><a href="https://www.scintilla.org/scintilla535.tgz">tgz format</a> (1.3M) commonly used on Linux and compatible operating systems</li> + <li><a href="https://www.scintilla.org/scintilla536.zip">zip format</a> (1.4M) commonly used on Windows</li> + <li><a href="https://www.scintilla.org/scintilla536.tgz">tgz format</a> (1.3M) commonly used on Linux and compatible operating systems</li> </ul> Instructions for building on both Windows and Linux are included in the readme file. <h4> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/doc/ScintillaHistory.html new/scintilla/doc/ScintillaHistory.html --- old/scintilla/doc/ScintillaHistory.html 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/doc/ScintillaHistory.html 2023-07-26 07:50:44.000000000 +0200 @@ -582,6 +582,43 @@ </table> <h2>Releases</h2> <h3> + <a href="https://www.scintilla.org/scintilla536.zip">Release 5.3.6</a> + </h3> + <ul> + <li> + Released 26 July 2023. + </li> + <li> + Redraw calltip after showing as didn't update when size of new text exactly same as + previous. + <a href="https://sourceforge.net/p/scintilla/feature-requests/1486/">Feature #1486</a>. + </li> + <li> + On Win32 fix reverse arrow cursor when scaled. + <a href="https://sourceforge.net/p/scintilla/bugs/2382/">Bug #2382</a>. + </li> + <li> + On Win32 hide cursor when typing if that system preference has been chosen. + <a href="https://sourceforge.net/p/scintilla/bugs/2333/">Bug #2333</a>. + </li> + <li> + On Win32 and Qt, stop aligning IME candidate window to target. + It is now always aligned to start of composition string. + This undoes part of feature #1300. + <a href="https://sourceforge.net/p/scintilla/feature-requests/1488/">Feature #1488</a>, + <a href="https://sourceforge.net/p/scintilla/bugs/2391/">Bug #2391</a>, + <a href="https://sourceforge.net/p/scintilla/feature-requests/1300/">Feature #1300</a>. + </li> + <li> + On Qt, for IMEs, update micro focus when selection changes. + This may move the location of IME popups to align with the caret. + </li> + <li> + On Qt, implement replacement for IMEs which may help with actions like reconversion. + This is similar to delete-surrounding on GTK. + </li> + </ul> + <h3> <a href="https://www.scintilla.org/scintilla535.zip">Release 5.3.5</a> </h3> <ul> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/doc/index.html new/scintilla/doc/index.html --- old/scintilla/doc/index.html 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/doc/index.html 2023-07-26 07:50:44.000000000 +0200 @@ -9,7 +9,7 @@ <meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" /> <meta name="Description" content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." /> - <meta name="Date.Modified" content="20230531" /> + <meta name="Date.Modified" content="20230726" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style type="text/css"> .logo { @@ -60,8 +60,8 @@ GTK, and macOS</font> </td> <td width="40%" align="right"> - <font color="#FFCC99" size="3"> Release version 5.3.5<br /> - Site last modified May 31 2023</font> + <font color="#FFCC99" size="3"> Release version 5.3.6<br /> + Site last modified July 26 2023</font> </td> <td width="20%"> @@ -76,12 +76,11 @@ </tr> </table> <ul id="versionlist"> + <li>Version 5.3.6 improves cursor behaviour on Win32 and IME support on Win32 and Qt.</li> <li>Version 5.3.5 improves IME support on Win32 and Qt.</li> <li>Version 5.3.4 adds multithreaded wrapping.</li> <li>Version 5.3.3 fixes minor bugs in APIs and platform layers.</li> <li>Version 5.3.2 adds SCI_REPLACETARGETMINIMAL to modify text without marking unchanged start and end text in change history.</li> - <li>Version 5.3.1 can represent invisible text with a character to simplify editing and provide summarized views.</li> - <li>Version 5.3.0 adds change history.</li> </ul> <ul id="menu"> <li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/gtk/PlatGTK.cxx new/scintilla/gtk/PlatGTK.cxx --- old/scintilla/gtk/PlatGTK.cxx 2023-03-08 03:37:29.000000000 +0100 +++ new/scintilla/gtk/PlatGTK.cxx 2023-07-26 07:50:44.000000000 +0200 @@ -370,7 +370,7 @@ pango_context_set_base_dir(contextMeasure.get(), direction); pango_cairo_context_set_font_options(contextMeasure.get(), fontOptions); pango_context_set_language(contextMeasure.get(), language); - + return contextMeasure; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/gtk/ScintillaGTK.cxx new/scintilla/gtk/ScintillaGTK.cxx --- old/scintilla/gtk/ScintillaGTK.cxx 2023-03-08 03:37:29.000000000 +0100 +++ new/scintilla/gtk/ScintillaGTK.cxx 2023-07-26 07:50:44.000000000 +0200 @@ -541,7 +541,7 @@ } void ScintillaGTK::SizeRequest(GtkWidget *widget, GtkRequisition *requisition) { - ScintillaGTK *sciThis = FromWidget(widget); + const ScintillaGTK *sciThis = FromWidget(widget); requisition->width = 1; requisition->height = 1; GtkRequisition child_requisition; @@ -1168,7 +1168,7 @@ // On GTK, unlike other platforms, modifying scrollbars inside some events including // resizes causes problems. Deferring the modification to a lower priority (125) idle // event avoids the problems. This code did not always work when the priority was - // higher than GTK's resize (GTK_PRIORITY_RESIZE=110) or redraw + // higher than GTK's resize (GTK_PRIORITY_RESIZE=110) or redraw // (GDK_PRIORITY_REDRAW=120) idle tasks. scrollBarIdleID = gdk_threads_add_idle_full(priorityScrollBar, [](gpointer pSci) -> gboolean { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/qt/ScintillaEdit/ScintillaDocument.cpp new/scintilla/qt/ScintillaEdit/ScintillaDocument.cpp --- old/scintilla/qt/ScintillaEdit/ScintillaDocument.cpp 2022-10-12 03:48:46.000000000 +0200 +++ new/scintilla/qt/ScintillaEdit/ScintillaDocument.cpp 2023-07-26 07:50:44.000000000 +0200 @@ -182,7 +182,7 @@ } QByteArray ScintillaDocument::get_char_range(int position, int length) { - Document *doc = static_cast<Document *>(pdoc); + const Document *doc = static_cast<Document *>(pdoc); if (position < 0 || length <= 0 || position + length > doc->Length()) return QByteArray(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/qt/ScintillaEdit/ScintillaEdit.pro new/scintilla/qt/ScintillaEdit/ScintillaEdit.pro --- old/scintilla/qt/ScintillaEdit/ScintillaEdit.pro 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/qt/ScintillaEdit/ScintillaEdit.pro 2023-07-26 07:50:44.000000000 +0200 @@ -13,7 +13,7 @@ CONFIG += lib_bundle CONFIG += c++1z -VERSION = 5.3.5 +VERSION = 5.3.6 SOURCES += \ ScintillaEdit.cpp \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/qt/ScintillaEditBase/ScintillaEditBase.cpp new/scintilla/qt/ScintillaEditBase/ScintillaEditBase.cpp --- old/scintilla/qt/ScintillaEditBase/ScintillaEditBase.cpp 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/qt/ScintillaEditBase/ScintillaEditBase.cpp 2023-07-26 07:50:44.000000000 +0200 @@ -542,6 +542,17 @@ sqt->view.imeCaretBlockOverride = false; preeditPos = -1; // reset not to interrupt Qt::ImCursorRectangle. + const int rpLength = event->replacementLength(); + if (rpLength != 0) { + // Qt has called setCommitString(). + // Make room for the string to sit in. + const int rpStart = event->replacementStart(); + const Scintilla::Position rpBase = sqt->CurrentPosition(); + const Scintilla::Position start = sqt->pdoc->GetRelativePositionUTF16(rpBase, rpStart); + const Scintilla::Position end = sqt->pdoc->GetRelativePositionUTF16(start, rpLength); + sqt->pdoc->DeleteChars(start, end - start); + } + if (!event->commitString().isEmpty()) { const QString &commitStr = event->commitString(); const int commitStrLen = commitStr.length(); @@ -600,14 +611,6 @@ #endif sqt->view.imeCaretBlockOverride = true; } - - // Set Candidate window position again at imeCaret when target input. - const bool targetAny = std::any_of(imeIndicator.begin(), imeIndicator.end(), [](int i) noexcept { - return i == IndicatorTarget; - }); - if (targetAny) - preeditPos = sqt->CurrentPosition(); - sqt->EnsureCaretVisible(); } sqt->ShowCaretAtCurrentPosition(); @@ -712,6 +715,9 @@ break; case Notification::UpdateUI: + if (FlagSet(scn.updated, Update::Selection)) { + updateMicroFocus(); + } emit updateUi(scn.updated); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/qt/ScintillaEditBase/ScintillaEditBase.pro new/scintilla/qt/ScintillaEditBase/ScintillaEditBase.pro --- old/scintilla/qt/ScintillaEditBase/ScintillaEditBase.pro 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/qt/ScintillaEditBase/ScintillaEditBase.pro 2023-07-26 07:50:44.000000000 +0200 @@ -12,7 +12,7 @@ CONFIG += lib_bundle CONFIG += c++1z -VERSION = 5.3.5 +VERSION = 5.3.6 SOURCES += \ PlatQt.cpp \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/src/CellBuffer.cxx new/scintilla/src/CellBuffer.cxx --- old/scintilla/src/CellBuffer.cxx 2022-10-12 03:48:46.000000000 +0200 +++ new/scintilla/src/CellBuffer.cxx 2023-07-26 07:50:44.000000000 +0200 @@ -170,7 +170,7 @@ return static_cast<POS>(pos); } - // line_from_pos_cast(): return 32-bit or 64-bit value as Sci::Line + // line_from_pos_cast(): return 32-bit or 64-bit value as Sci::Line // This avoids warnings from Visual C++ Code Analysis and shortens code static constexpr Sci::Line line_from_pos_cast(POS line) noexcept { return static_cast<Sci::Line>(line); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/src/ChangeHistory.cxx new/scintilla/src/ChangeHistory.cxx --- old/scintilla/src/ChangeHistory.cxx 2022-10-12 03:48:46.000000000 +0200 +++ new/scintilla/src/ChangeHistory.cxx 2023-07-26 07:50:44.000000000 +0200 @@ -209,7 +209,7 @@ } startRun = endRun; } - + for (Sci::Position positionDeletion = 0; positionDeletion <= length;) { const EditionSetOwned &editions = deleteEdition.ValueAt(positionDeletion); if (editions) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/src/Editor.cxx new/scintilla/src/Editor.cxx --- old/scintilla/src/Editor.cxx 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/src/Editor.cxx 2023-07-26 07:50:44.000000000 +0200 @@ -910,7 +910,7 @@ } Point Editor::PointMainCaret() { - return LocationFromPosition(sel.Range(sel.Main()).caret); + return LocationFromPosition(sel.RangeMain().caret); } /** @@ -3273,7 +3273,7 @@ if ((selt == Selection::SelTypes::none) && sel.MoveExtends()) { selt = !sel.IsRectangular() ? Selection::SelTypes::stream : Selection::SelTypes::rectangle; } - SelectionPosition caretToUse = sel.Range(sel.Main()).caret; + SelectionPosition caretToUse = sel.RangeMain().caret; if (sel.IsRectangular()) { if (selt == Selection::SelTypes::none) { caretToUse = (direction > 0) ? sel.Limits().end : sel.Limits().start; @@ -3297,7 +3297,7 @@ // Calculate new caret position and call SetSelection(), which will ensure whole lines are selected. const SelectionPosition posNew = MovePositionSoVisible( PositionUpOrDown(caretToUse, direction, -1), direction); - SetSelection(posNew, sel.Range(sel.Main()).anchor); + SetSelection(posNew, sel.RangeMain().anchor); } else { InvalidateWholeSelection(); if (!additionalSelectionTyping || (sel.IsRectangular())) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/src/Editor.h new/scintilla/src/Editor.h --- old/scintilla/src/Editor.h 2023-03-08 03:37:29.000000000 +0100 +++ new/scintilla/src/Editor.h 2023-07-26 07:50:44.000000000 +0200 @@ -699,7 +699,7 @@ AutoSurface(const Editor *ed) : surf(ed->CreateMeasurementSurface()) { } - AutoSurface(SurfaceID sid, Editor *ed, std::optional<Scintilla::Technology> technology = {}) : + AutoSurface(SurfaceID sid, const Editor *ed, std::optional<Scintilla::Technology> technology = {}) : surf(ed->CreateDrawingSurface(sid, technology)) { } // Deleted so AutoSurface objects can not be copied. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/src/PerLine.cxx new/scintilla/src/PerLine.cxx --- old/scintilla/src/PerLine.cxx 2023-02-07 23:11:09.000000000 +0100 +++ new/scintilla/src/PerLine.cxx 2023-07-26 07:50:44.000000000 +0200 @@ -540,7 +540,7 @@ int LineTabstops::GetNextTabstop(Sci::Line line, int x) const noexcept { if (line < tabstops.Length()) { - TabstopList *tl = tabstops[line].get(); + const TabstopList *tl = tabstops[line].get(); if (tl) { for (const int i : *tl) { if (i > x) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/src/ScintillaBase.cxx new/scintilla/src/ScintillaBase.cxx --- old/scintilla/src/ScintillaBase.cxx 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/src/ScintillaBase.cxx 2023-07-26 07:50:44.000000000 +0200 @@ -515,6 +515,7 @@ CreateCallTipWindow(rc); ct.wCallTip.SetPositionRelative(rc, &wMain); ct.wCallTip.Show(); + ct.wCallTip.InvalidateAll(); } void ScintillaBase::CallTipClick() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/test/simpleTests.py new/scintilla/test/simpleTests.py --- old/scintilla/test/simpleTests.py 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/test/simpleTests.py 2023-07-26 07:50:44.000000000 +0200 @@ -598,7 +598,7 @@ self.ed.SetSel(3, 3) # Duplicates the second line containing 'b' self.ed.LineDuplicate() - # Same as above but end of duplicated line is \r\n + # Same as above but end of duplicated line is \r\n self.assertEquals(self.ed.Contents(), b"1\nb\r\nb\n2") def testTransposeLines(self): @@ -2419,7 +2419,7 @@ self.assertEquals(self.ed.SelectionHidden, True) self.ed.HideSelection(False) # Restore self.assertEquals(self.ed.SelectionHidden, False) - + class TestIndices(unittest.TestCase): def setUp(self): self.xite = Xite.xiteFrame diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/version.txt new/scintilla/version.txt --- old/scintilla/version.txt 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/version.txt 2023-07-26 07:50:44.000000000 +0200 @@ -1 +1 @@ -535 +536 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/win32/HanjaDic.cxx new/scintilla/win32/HanjaDic.cxx --- old/scintilla/win32/HanjaDic.cxx 2022-03-31 02:47:19.000000000 +0200 +++ new/scintilla/win32/HanjaDic.cxx 2023-07-26 07:50:44.000000000 +0200 @@ -99,7 +99,7 @@ IHanjaDic *instance = nullptr; hr = CoCreateInstance(CLSID_HanjaDic, nullptr, CLSCTX_INPROC_SERVER, IID_IHanjaDic, - (LPVOID *)&instance); + reinterpret_cast<LPVOID *>(&instance)); if (SUCCEEDED(hr) && instance) { HJinterface.reset(instance); hr = instance->OpenMainDic(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/win32/PlatWin.cxx new/scintilla/win32/PlatWin.cxx --- old/scintilla/win32/PlatWin.cxx 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/win32/PlatWin.cxx 2023-07-26 07:50:44.000000000 +0200 @@ -167,6 +167,9 @@ using GetScaleFactorForMonitorSig = HRESULT(WINAPI *)(HMONITOR, DEVICE_SCALE_FACTOR *); GetScaleFactorForMonitorSig fnGetScaleFactorForMonitor = nullptr; +using GetThreadDpiAwarenessContextSig = DPI_AWARENESS_CONTEXT(WINAPI *)(); +GetThreadDpiAwarenessContextSig fnGetThreadDpiAwarenessContext = nullptr; + using SetThreadDpiAwarenessContextSig = DPI_AWARENESS_CONTEXT(WINAPI *)(DPI_AWARENESS_CONTEXT); SetThreadDpiAwarenessContextSig fnSetThreadDpiAwarenessContext = nullptr; @@ -175,6 +178,7 @@ fnGetDpiForWindow = DLLFunction<GetDpiForWindowSig>(user32, "GetDpiForWindow"); fnGetSystemMetricsForDpi = DLLFunction<GetSystemMetricsForDpiSig>(user32, "GetSystemMetricsForDpi"); fnAdjustWindowRectExForDpi = DLLFunction<AdjustWindowRectExForDpiSig>(user32, "AdjustWindowRectExForDpi"); + fnGetThreadDpiAwarenessContext = DLLFunction<GetThreadDpiAwarenessContextSig>(user32, "GetThreadDpiAwarenessContext"); fnSetThreadDpiAwarenessContext = DLLFunction<SetThreadDpiAwarenessContextSig>(user32, "SetThreadDpiAwarenessContext"); using GetDpiForSystemSig = UINT(WINAPI *)(void); @@ -393,7 +397,7 @@ return monitor; } -int GetDeviceScaleFactorWhenGdiScalingActive(HWND hWnd) noexcept { +float GetDeviceScaleFactorWhenGdiScalingActive(HWND hWnd) noexcept { if (fnAreDpiAwarenessContextsEqual) { PLATFORM_ASSERT(fnGetWindowDpiAwarenessContext && fnGetScaleFactorForMonitor); if (fnAreDpiAwarenessContextsEqual(DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED, fnGetWindowDpiAwarenessContext(hWnd))) { @@ -401,10 +405,10 @@ const HMONITOR hMonitor = MonitorFromWindowHandleScaling(hRootWnd); DEVICE_SCALE_FACTOR deviceScaleFactor; if (S_OK == fnGetScaleFactorForMonitor(hMonitor, &deviceScaleFactor)) - return (static_cast<int>(deviceScaleFactor) + 99) / 100; // increase to first integral multiple of 1 + return deviceScaleFactor / 100.f; } } - return 1; + return 1.f; } std::shared_ptr<Font> Font::Allocate(const FontParameters &fp) { @@ -2778,56 +2782,102 @@ ::InvalidateRect(HwndFromWindowID(wid), &rcw, FALSE); } -namespace { - -void FlipBitmap(HBITMAP bitmap, int width, int height) noexcept { - HDC hdc = ::CreateCompatibleDC({}); - if (hdc) { - HBITMAP prevBmp = SelectBitmap(hdc, bitmap); - ::StretchBlt(hdc, width - 1, 0, -width, height, hdc, 0, 0, width, height, SRCCOPY); - SelectBitmap(hdc, prevBmp); - ::DeleteDC(hdc); - } -} - -} - HCURSOR LoadReverseArrowCursor(UINT dpi) noexcept { - HCURSOR reverseArrowCursor {}; + class CursorHelper { + public: + ICONINFO info{}; + BITMAP bmp{}; + bool HasBitmap() const noexcept { + return bmp.bmWidth > 0; + } - bool created = false; - HCURSOR cursor = ::LoadCursor({}, IDC_ARROW); + CursorHelper(const HCURSOR cursor) noexcept { + Init(cursor); + } + ~CursorHelper() { + CleanUp(); + } - if (dpi != uSystemDPI) { - const int width = SystemMetricsForDpi(SM_CXCURSOR, dpi); - const int height = SystemMetricsForDpi(SM_CYCURSOR, dpi); - HCURSOR copy = static_cast<HCURSOR>(::CopyImage(cursor, IMAGE_CURSOR, width, height, LR_COPYFROMRESOURCE | LR_COPYRETURNORG)); - if (copy) { - created = copy != cursor; - cursor = copy; + CursorHelper &operator=(const HCURSOR cursor) noexcept { + CleanUp(); + Init(cursor); + return *this; + } + + bool MatchesSize(const int width, const int height) noexcept { + return bmp.bmWidth == width && bmp.bmHeight == height; } - } - ICONINFO info; - if (::GetIconInfo(cursor, &info)) { - BITMAP bmp {}; - if (::GetObject(info.hbmMask, sizeof(bmp), &bmp)) { - FlipBitmap(info.hbmMask, bmp.bmWidth, bmp.bmHeight); + HCURSOR CreateFlippedCursor() noexcept { + if (info.hbmMask) + FlipBitmap(info.hbmMask, bmp.bmWidth, bmp.bmHeight); if (info.hbmColor) FlipBitmap(info.hbmColor, bmp.bmWidth, bmp.bmHeight); info.xHotspot = bmp.bmWidth - 1 - info.xHotspot; - reverseArrowCursor = ::CreateIconIndirect(&info); + return ::CreateIconIndirect(&info); } - ::DeleteObject(info.hbmMask); - if (info.hbmColor) - ::DeleteObject(info.hbmColor); + private: + void Init(const HCURSOR &cursor) noexcept { + if (::GetIconInfo(cursor, &info)) { + ::GetObject(info.hbmMask, sizeof(bmp), &bmp); + PLATFORM_ASSERT(HasBitmap()); + } + } + + void CleanUp() noexcept { + if (info.hbmMask) + ::DeleteObject(info.hbmMask); + if (info.hbmColor) + ::DeleteObject(info.hbmColor); + info = {}; + bmp = {}; + } + + static void FlipBitmap(const HBITMAP bitmap, const int width, const int height) noexcept { + HDC hdc = ::CreateCompatibleDC({}); + if (hdc) { + HBITMAP prevBmp = SelectBitmap(hdc, bitmap); + ::StretchBlt(hdc, width - 1, 0, -width, height, hdc, 0, 0, width, height, SRCCOPY); + SelectBitmap(hdc, prevBmp); + ::DeleteDC(hdc); + } + } + }; + + HCURSOR reverseArrowCursor {}; + + const int width = SystemMetricsForDpi(SM_CXCURSOR, dpi); + const int height = SystemMetricsForDpi(SM_CYCURSOR, dpi); + + DPI_AWARENESS_CONTEXT oldContext = nullptr; + if (fnAreDpiAwarenessContextsEqual && fnAreDpiAwarenessContextsEqual(fnGetThreadDpiAwarenessContext(), DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED)) { + oldContext = fnSetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); + PLATFORM_ASSERT(oldContext != nullptr); + } + + const HCURSOR cursor = static_cast<HCURSOR>(::LoadImage({}, IDC_ARROW, IMAGE_CURSOR, width, height, LR_SHARED)); + if (cursor) { + CursorHelper cursorHelper(cursor); + + if (cursorHelper.HasBitmap() && !cursorHelper.MatchesSize(width, height)) { + const HCURSOR copy = static_cast<HCURSOR>(::CopyImage(cursor, IMAGE_CURSOR, width, height, LR_COPYFROMRESOURCE | LR_COPYRETURNORG)); + if (copy) { + cursorHelper = copy; + ::DestroyCursor(copy); + } + } + + if (cursorHelper.HasBitmap()) { + reverseArrowCursor = cursorHelper.CreateFlippedCursor(); + } } - if (created) { - ::DestroyCursor(cursor); + if (oldContext) { + fnSetThreadDpiAwarenessContext(oldContext); } + return reverseArrowCursor; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/win32/PlatWin.h new/scintilla/win32/PlatWin.h --- old/scintilla/win32/PlatWin.h 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/win32/PlatWin.h 2023-07-26 07:50:44.000000000 +0200 @@ -46,7 +46,7 @@ HMONITOR MonitorFromWindowHandleScaling(HWND hWnd) noexcept; UINT DpiForWindow(WindowID wid) noexcept; -int GetDeviceScaleFactorWhenGdiScalingActive(HWND hWnd) noexcept; +float GetDeviceScaleFactorWhenGdiScalingActive(HWND hWnd) noexcept; int SystemMetricsForDpi(int nIndex, UINT dpi) noexcept; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/win32/ScintRes.rc new/scintilla/win32/ScintRes.rc --- old/scintilla/win32/ScintRes.rc 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/win32/ScintRes.rc 2023-07-26 07:50:44.000000000 +0200 @@ -4,8 +4,8 @@ #include <windows.h> -#define VERSION_SCINTILLA "5.3.5" -#define VERSION_WORDS 5, 3, 5, 0 +#define VERSION_SCINTILLA "5.3.6" +#define VERSION_WORDS 5, 3, 6, 0 VS_VERSION_INFO VERSIONINFO FILEVERSION VERSION_WORDS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scintilla/win32/ScintillaWin.cxx new/scintilla/win32/ScintillaWin.cxx --- old/scintilla/win32/ScintillaWin.cxx 2023-05-31 01:32:12.000000000 +0200 +++ new/scintilla/win32/ScintillaWin.cxx 2023-07-26 07:50:44.000000000 +0200 @@ -333,6 +333,8 @@ bool capturedMouse; bool trackedMouseLeave; + BOOL typingWithoutCursor; + bool cursorIsHidden; SetCoalescableTimerSig SetCoalescableTimerFn; unsigned int linesPerScroll; ///< Intellimouse support @@ -362,7 +364,10 @@ static ATOM scintillaClassAtom; static ATOM callClassAtom; - int deviceScaleFactor = 1; + float deviceScaleFactor = 1.f; + int GetFirstIntegralMultipleDeviceScaleFactor() const noexcept { + return static_cast<int>(std::ceil(deviceScaleFactor)); + } #if defined(USE_D2D) ID2D1RenderTarget *pRenderTarget; @@ -445,6 +450,7 @@ void SetMouseCapture(bool on) override; bool HaveMouseCapture() override; void SetTrackMouseLeaveEvent(bool on) noexcept; + void HideCursorIfPreferred() noexcept; void UpdateBaseElements() override; bool PaintContains(PRectangle rc) override; void ScrollText(Sci::Line linesToMove) override; @@ -470,7 +476,7 @@ void AddToPopUp(const char *label, int cmd = 0, bool enabled = true) override; void ClaimSelection() override; - void GetIntelliMouseParameters() noexcept; + void GetMouseParameters() noexcept; void CopyToGlobal(GlobalMemory &gmUnicode, const SelectionText &selectedText); void CopyToClipboard(const SelectionText &selectedText) override; void ScrollMessage(WPARAM wParam); @@ -551,6 +557,8 @@ capturedMouse = false; trackedMouseLeave = false; + typingWithoutCursor = false; + cursorIsHidden = false; SetCoalescableTimerFn = nullptr; linesPerScroll = 0; @@ -718,14 +726,15 @@ } } else { - drtp.dpiX = 96.f * deviceScaleFactor; - drtp.dpiY = 96.f * deviceScaleFactor; + const int integralDeviceScaleFactor = GetFirstIntegralMultipleDeviceScaleFactor(); + drtp.dpiX = 96.f * integralDeviceScaleFactor; + drtp.dpiY = 96.f * integralDeviceScaleFactor; drtp.pixelFormat = D2D1::PixelFormat(DXGI_FORMAT_UNKNOWN, D2D1_ALPHA_MODE_UNKNOWN); D2D1_HWND_RENDER_TARGET_PROPERTIES dhrtp {}; dhrtp.hwnd = hw; - dhrtp.pixelSize = ::GetSizeUFromRect(rc, deviceScaleFactor); + dhrtp.pixelSize = ::GetSizeUFromRect(rc, integralDeviceScaleFactor); dhrtp.presentOptions = (technology == Technology::DirectWriteRetain) ? D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS : D2D1_PRESENT_OPTIONS_NONE; @@ -770,7 +779,7 @@ c = static_cast<Window::Cursor>(cursorMode); } if (c == Window::Cursor::reverseArrow) { - ::SetCursor(reverseArrowCursor.Load(dpi)); + ::SetCursor(reverseArrowCursor.Load(static_cast<UINT>(dpi * deviceScaleFactor))); } else { wMain.SetCursor(c); } @@ -1260,6 +1269,7 @@ } view.imeCaretBlockOverride = false; + HideCursorIfPreferred(); if (lParam & GCS_RESULTSTR) { AddWString(imc.GetCompositionString(GCS_RESULTSTR), CharacterSource::ImeResult); @@ -1314,11 +1324,6 @@ const Sci::Position imeCaretPosDoc = pdoc->GetRelativePositionUTF16(currentPos, imeEndToImeCaretU16); MoveImeCarets(-currentPos + imeCaretPosDoc); - - if (std::find(imeIndicator.begin(), imeIndicator.end(), IndicatorTarget) != imeIndicator.end()) { - // set candidate window left aligned to beginning of target string. - SetCandidateWindowPos(); - } } } @@ -1580,6 +1585,7 @@ break; case WM_MOUSEMOVE: { + cursorIsHidden = false; // to be shown by ButtonMoveWithModifiers const Point pt = PointFromLParam(lParam); // Windows might send WM_MOUSEMOVE even though the mouse has not been moved: @@ -1693,6 +1699,7 @@ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam); case WM_CHAR: + HideCursorIfPreferred(); if (((wParam >= 128) || !iscntrl(static_cast<int>(wParam))) || !lastKeyDownConsumed) { wchar_t wcs[3] = { static_cast<wchar_t>(wParam), 0 }; unsigned int wclen = 1; @@ -2005,7 +2012,7 @@ ctrlID = ::GetDlgCtrlID(HwndFromWindow(wMain)); UpdateBaseElements(); // Get Intellimouse scroll line parameters - GetIntelliMouseParameters(); + GetMouseParameters(); ::RegisterDragDrop(MainHWND(), &dt); break; @@ -2063,10 +2070,12 @@ case WM_SETCURSOR: if (LOWORD(lParam) == HTCLIENT) { - POINT pt; - if (::GetCursorPos(&pt)) { - ::ScreenToClient(MainHWND(), &pt); - DisplayCursor(ContextCursor(PointFromPOINT(pt))); + if (!cursorIsHidden) { + POINT pt; + if (::GetCursorPos(&pt)) { + ::ScreenToClient(MainHWND(), &pt); + DisplayCursor(ContextCursor(PointFromPOINT(pt))); + } } return TRUE; } else { @@ -2089,7 +2098,7 @@ #endif UpdateBaseElements(); // Get Intellimouse scroll line parameters - GetIntelliMouseParameters(); + GetMouseParameters(); InvalidateStyleRedraw(); break; @@ -2327,6 +2336,14 @@ trackedMouseLeave = on; } +void ScintillaWin::HideCursorIfPreferred() noexcept { + // SPI_GETMOUSEVANISH from OS. + if (typingWithoutCursor && !cursorIsHidden) { + ::SetCursor(NULL); + cursorIsHidden = true; + } +} + void ScintillaWin::UpdateBaseElements() { struct ElementToIndex { Element element; int nIndex; }; const ElementToIndex eti[] = { @@ -3008,7 +3025,7 @@ // Move IME Window to current caret position IMContext imc(MainHWND()); const Point pos = PointMainCaret(); - COMPOSITIONFORM CompForm; + COMPOSITIONFORM CompForm {}; CompForm.dwStyle = CFS_POINT; CompForm.ptCurrentPos = POINTFromPoint(pos); @@ -3175,13 +3192,14 @@ return rcSize; // MS API says reconv structure to be returned. } -void ScintillaWin::GetIntelliMouseParameters() noexcept { +void ScintillaWin::GetMouseParameters() noexcept { // This retrieves the number of lines per scroll as configured in the Mouse Properties sheet in Control Panel ::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &linesPerScroll, 0); if (!::SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &charsPerScroll, 0)) { // no horizontal scrolling configuration on Windows XP charsPerScroll = (linesPerScroll == WHEEL_PAGESCROLL) ? 3 : linesPerScroll; } + ::SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &typingWithoutCursor, 0); } void ScintillaWin::CopyToGlobal(GlobalMemory &gmUnicode, const SelectionText &selectedText) { @@ -3630,7 +3648,7 @@ surfaceWindow->Init(ps.hdc, hWnd); } else { #if defined(USE_D2D) - const int scaleFactor = sciThis->deviceScaleFactor; + const int scaleFactor = sciThis->GetFirstIntegralMultipleDeviceScaleFactor(); // Create a Direct2D render target. D2D1_HWND_RENDER_TARGET_PROPERTIES dhrtp {};
