Commit Graph
100 Commits
Author SHA1 Message Date
Vadim Zeitlin b7f3bd9d70 Merge branch 'msw-esc-handling'
Change Esc handling in wxMSW to happen after IME and native controls.

See #27148.
2026-10-04 01:48:45 +02:00
Vadim Zeitlin de18a6d808 Don't handle Esc specially in wxTextEntry auto-complete code
This is not necessary any longer after the changes of the parent commit.

This is a partial revert of 59bdee5558 (Fix handling of Esc while an
auto-complete drop down is open in wxMSW., 2014-03-08), see #13945.
2026-10-03 14:51:43 +02:00
Vadim Zeitlin 058ce47c60 Handle Esc later in wxMSW to avoid stealing it prematurely
Generating wxEVT_CHAR_HOOK for "Esc" presses from the keyboard hook
resulted in multiple problems with IME (see #11386 and #22473 that were
already worked around as well as still open #27145) or other controls
that need to handle "Esc" themselves (see #9102 and #13945 for which we
added the workarounds and #16059 which is still open too).

Solve all of these issues by postponing wxEVT_CHAR_HOOK generation for
this key until later, when the message is already being processed. This
should avoid all such problems at the price of not generating these
events at all in some scenarios, e.g. when a native control really wants
Esc for itself or when wx is used in a modeless dialog in a plugin DLL
and its event loop is not running.

Hopefully this shouldn't be important in practice but this change should
avoid having any more problems with various IMEs.

Closes #16059.

Closes #27145.
2026-10-03 14:51:43 +02:00
Vadim Zeitlin 2ded9fc1f2 Factor out wxSendCharHookEvent() from wxKeyboardHook()
Extract this function from the keyboard hook to allow its reuse in
upcoming commits.

No real changes yet.

This commit is best viewed ignoring whitespace-only changes.
2026-10-03 14:51:43 +02:00
Vadim Zeitlin 0dd86a53d5 Don't define wxHAS_2CHAR_NEWLINES as 0 in wxTextCtrl unit test
By convention, wxHAS_XXX symbols should be defined or not, unlike
wxUSE_XXX ones that are always defined as either 1 or 0.

Change wxHAS_2CHAR_NEWLINES definition and tests for it to follow this
rule.

No real changes.
2026-10-03 13:23:12 +02:00
Vadim Zeitlin 234504141c Don't call virtual GetLabel() from Create() in wxOSX
The recent 07590bec33 (Use preceding label as accessibility title of
controls under macOS, 2026-09-21) started calling GetLabel() from
MacPostControlCreate() which is called before the object was fully
constructed and could (and did) result in crashes due to the use of the
not yet initialized members.

Avoid this by adding a new HasAccessibilityTitle() virtual function of
wxWidgetImpl which is fully constructed by the time this function is
used and also addresses the question of whether the preceding label
should be used as this window accessibility title more precisely.

See #27060, #27140.

Closes #27142.
2026-10-03 13:15:00 +02:00
Vadim Zeitlin 67f0790c85 Avoid warning for lzma_stream initialization from clang 20+
This compiler started giving -Wnontrivial-memcall for using memset()
with non-trivially copyable type wxLZMAStream, so avoid it by using
LZMA_STREAM_INIT instead, which is meant to be used exactly for this.
2026-10-01 19:55:01 +02:00
Vadim Zeitlin cbc51e8fd4 Simplify and fix wxMiniFrame documentation
Don't claim contradictory things in consecutive lines.

See #27139.
2026-10-01 16:55:04 +02:00
Vadim Zeitlin 3c29b6f951 Merge branch 'aui-mac-drag-crash'
Fix crash when destroying AUI floating frames under Mac.

See #26264, #27125.
2026-10-01 16:23:54 +02:00
Vadim Zeitlin 5c22ec6877 Fix possible crash when destroying AUI floating frames
wxAuiFloatingFrame could receive wxEVT_SIZE during its destruction, even
if it was already hidden, and handling these events crashed due to
dereferencing dangling wxSizerItem pointers.

Fix this by overriding wxAuiFloatingFrame::Destroy() to perform the
necessary cleanup when the frame is about to be destroyed.

Add wxAuiManager::DestroyFloatingFrame() helper which makes the code say
more clearly what it does -- this is not required to fix the bug but
affects the same code, so do it in the same commit.

Also add a unit test confirming that destroying the floating frame in
various ways doesn't crash any longer.

Closes #26264.

Originally-by: alilie <alexandru.ilie@hexagon.com>
2026-09-29 17:22:25 +02:00
Vadim Zeitlin e1eb0f4bc4 Factor out wxAuiFloatingFrame::CleanUp()
Make it possible to reuse this function in the upcoming commit.

No real changes yet.
2026-09-29 17:12:11 +02:00
Vadim ZeitlinandEran Ifrah ac4cbd0c09 Fix crash when using wxGTK clipboard under WSL
Since the changes of f11053a2d3 (Fix copy/paste in wxGTK when a
clipboard manager is running, 2026-03-09) we were accumulating all
data passed to wxClipboard::AddData() because we never cleared the list
of targets in the active selection any more.

This resulted in a crash under WSL (probably due to overflowing some
implementation limits) and must have been problematic elsewhere too, so
stop doing this and do clear the list of targets before setting new
ones.

Still don't call wxClipboard::Clear() neither from AddData() nor from
SetData() to avoid reintroducing the original problem fixed by the
commit above.

See #26265, #26278.

Closes #27102.

Co-authored-by: Eran Ifrah <eran@codelite.org>
2026-09-29 15:05:58 +02:00
Vadim Zeitlin 16149b8f35 Make wxMSW clipboard functions more robust when clipboard is busy
Retry the clipboard operation if the clipboard happens to be busy
(because another application or the system is using it) just at the time
when we need it.

This should avoid spurious errors in CMake MSW CI jobs which are
probably due to the fact that multiple tests using clipboard may be
running in parallel now, but also seems to be useful for the real
applications which might run into the same problem, so fix it at the
library level rather than in the test.
2026-09-28 22:57:57 +02:00
Vadim Zeitlin 77009eaec9 Get rid of the warnings in ListCtrl::ColumnDrag test too
This amends the recent 49d8a0c6f8 (Make ListCtrl::ColumnDrag unit test
more robust, 2026-09-28) to wait for just the last event as this is all
we need for the test and we don't really need to wait for each event.
2026-09-28 22:45:20 +02:00
Vadim Zeitlin 49d8a0c6f8 Make ListCtrl::ColumnDrag unit test more robust
Try to wait for longer to avoid spurious test failures that happen quite
often in this test.
2026-09-28 18:48:03 +02:00
Vadim Zeitlin 9d231c5d1a Fix linking with monolithic wxMSW library without using manifest
This is the case for console applications and it was broken by binding
to GetWindowSubclass() import of comctl32.dll by name because it's not
present in v5 of the DLL which is used in absence of the manifest,
resulting in the executable being unable to start.

Apply a local fix to this by loading this function during run-time, when
we can be sure that we're using v6 which does export it by name (v5 only
exports it by ordinal 411).

Closes #27114.
2026-09-28 18:40:28 +02:00
Vadim Zeitlin de2186195c Merge branch 'accel-key-event'
Allow customizing priority of accelerators compared to normal key
events.

See #27106.

Closes #22625, #22630.
2026-09-28 16:36:27 +02:00
Vadim Zeitlin 776a9a2787 Add wxWidgetCocoaImpl::GetAccessibleView() to avoid code duplication
Extract code duplicated in wxWidgetCocoaImpl::SetAccessibilityLabel()
and SetAccessibilityTitleElement() into a new function.

No real changes.

See #27056, #27060.
2026-09-27 21:36:23 +02:00
Vadim Zeitlin 6172601da6 Repaint wxMSW wxListCtrl after scrolling in dark mode
In dark mode wxListCtrl draws its items itself and decides whether an
item is hot from the mouse position at the time it is painted. But when
the control scrolls, the native control moves the rows that are already
drawn instead of repainting them, and doesn't invalidate anything for
the hot item if the mouse didn't move.

Scrolling with the keyboard while the mouse is over the control
therefore leaves a trail: the row drawn as hot keeps its highlight at
its new position, and the row that is now under the mouse is drawn as
hot too, so every row that passes under the mouse stays highlighted.

Refresh the control when a message that can scroll it did change the
top item.

Closes #27112.

Signed-off-by: Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
2026-09-27 21:18:55 +02:00
Vadim Zeitlin 2136fb6e4a Merge branch 'cmake-change-gtk-toolkit' of github.com:MaartenBent/wxWidgets
CMake: Fix changing from GTK3 to GTK2 toolkit.

See #27116.
2026-09-27 21:16:24 +02:00
Vadim Zeitlin 16c3a76875 Rebake after adding tests/controls/dirctrltest.cpp
This should have been part of c87d669946 (Preserve wxGenericDirCtrl
hidden default path, 2026-07-09).

See #27033.
2026-09-27 16:07:26 +02:00
Vadim Zeitlin abef7a0a21 Merge branch 'osx-dnd-utf'
Fix text drag-and-drop regression in wxOSX.

See #27107.
2026-09-27 15:29:43 +02:00
Vadim Zeitlin e36f2b449b Merge branch 'msw-build-warnings' of github.com:MaartenBent/wxWidgets
Fix MSW build warnings with wxDEBUG_LEVEL==0 and build with C++ < 17.

See #27113.
2026-09-27 15:27:23 +02:00
Vadim Zeitlin 82f0bc1824 Add labels to improve wxRibbonGallery items accessibility
Gallery items have just a bitmap, an ID and the application's client
data, so there is nothing a screen reader can announce for them and they
are read as "list item 3 of 39", which is useless.

Add Append(bitmap, id, label) and Set/GetItemLabel() and use the label
as the accessible name of the item. The label is not drawn, as the items
of a gallery are bitmaps by design, it only exists to be announced. It
could also be used for tooltips later, which the items don't have
either.

The ribbon sample already knows the names of the colours it puts in its
galleries, so it passes them as the labels now, which also makes them a
useful test case.

Closes #27100.
2026-09-27 01:48:55 +02:00
Vadim Zeitlin 4cb7aaffa9 Merge branch 'LunaSVGDocs' of github.com:Blake-Madden/wxWidgets
Fix docs and CMake for wxUSE_LUNASVG option.

See #27089.
2026-09-27 01:48:55 +02:00
Vadim Zeitlin 38227a3f4a Merge branch 'RibbonReader2' of github.com:Blake-Madden/wxWidgets
Add screen reader support to the ribbon under MSW.

See #27075.
2026-09-27 01:48:55 +02:00
Vadim Zeitlin 2a9d034f5f Add unit test for wxEVT_ACCELERATOR_KEY
Now that it's implemented in all ports, commit the test which should
pass everywhere.
2026-09-26 23:57:58 +02:00
Vadim Zeitlin e5ac9e8826 Implement configurable accelerators support for wxQt
Use the new API, i.e. call ClaimsKeyBeforeAccelerator() and send
wxEVT_ACCELERATOR_KEY, in wxQt too.

Update wxComboBox to override ClaimsKeyBeforeAccelerator() too.
Note that wxTextCtrl and wxSpinCtrl don't need to be modified because
they already do this in the base class.

This actually simplifies the existing code as we don't need
wxWindow::m_processingShortcut any more.
2026-09-26 23:57:58 +02:00
Vadim Zeitlin b337ad2841 Factor out QtFillKeyEvent() from QtHandleKeyEvent()
No real changes, just refactor to allow reusing QtHandleKeyEvent() in
the upcoming commit.
2026-09-26 23:57:58 +02:00
Vadim Zeitlin 5ca0f8aa73 Implement configurable accelerators support for wxOSX
Use the new API, i.e. call ClaimsKeyBeforeAccelerator() and send
wxEVT_ACCELERATOR_KEY, in wxOSX too, whenever possible, i.e. not for
Cmd-Letter used by the menu items as we never get key events for them at
all.

This probably could be worked around by overriding performKeyEquivalent:
but for now leave it like this because hopefully there should be no
conflict between menu accelerators and standard text editing keys as
Cmd+C etc act on the focused window anyhow by default, so the behaviour
should be already correct anyhow.
2026-09-26 23:57:58 +02:00
Vadim Zeitlin 1043551376 Allow customizing priority of accelerators and normal key events
When deciding whether a key press should trigger an accelerator or be
handled by the currently focused window different ports behaved
differently, with wxGTK always prioritizing the focused window and the
other ports giving priority to the accelerator, and neither of them
allowed customizing this.

Change this now by introducing 2 ways to do it: first, a window can
override new ClaimsKeyBeforeAccelerator() virtual function to specify
which keys it wants to handle itself, even if they correspond to an
accelerator. And second, send wxEVT_ACCELERATOR_KEY event which can be
handled by the application, typically centrally in its wxFrame-derived
class, to decide if it wants some accelerator that it defines to not
steal the key from the window or, on the contrary, to always do it, even
if the window overrides ClaimsKeyBeforeAccelerator() as wxTextCtrl does.

Note that while ClaimsKeyBeforeAccelerator() replaces some uses of
wxMSW-specific MSWShouldPreProcessMessage(), but it's still needed to
prevent the key getting eaten by IsDialogMessage().

This is not a backwards-compatible change as it changes the default
wxGTK behaviour, but it is now compatible with the other ports and can
be easily customized if necessary.

This commit only implements this for wxMSW and wxGTK, other ports will
be updated too soon.
2026-09-26 23:57:58 +02:00
Vadim Zeitlin 22d708b641 Fix regression in drag-and-dropping text in wxOSX
Changes of 7148a49c6d (Map wxDF_TEXT to text in UTF-8 encoding in wxOSX,
2026-06-06) were incomplete and left wxDataFormat::SetId() inconsistent
with GetFormatForType() for wxDF_TEXT, which resulted in producing
UTF-16 text when asked for "public.utf8-plain-text" as is the case when
drag-and-dropping text to the Terminal.

Fix this by simply mapping kUTTypeUTF8PlainText to wxDF_TEXT here too.

Closes #26972.
2026-09-26 23:50:54 +02:00
Vadim Zeitlin e9841e122e Make text in bottom part of the dnd sample visible in dark mode
The sample hardcodes white background for the frame, but the default
text colour in dark mode is also white, which made it invisible.

Fix this by hardcoding the text colour too.
2026-09-26 23:46:04 +02:00
Vadim Zeitlin a30884694b Extract keys used for text editing into a portable function
The list of the keys which are used for editing the text and which
shouldn't be taken by the accelerators using the same keys existed only
in wxMSW and only as a function taking a MSG, move it to the common code
as wxTextEntryBase::IsUsedForEditing() taking wxKeyEvent, as it is going
to be needed by the other ports too in the upcoming commits.

Note that this also slightly changes wxMSW behaviour because the keys
producing printable characters, as well as Backspace, are now considered
as being used for editing too and so are not passed to the accelerators
any longer, which seems more correct as typing text in a control
shouldn't trigger the accelerators using the same keys.
2026-09-26 19:40:55 +02:00
Vadim Zeitlin 881d0f0461 Implement wxAcceleratorTable::GetEntry() in all ports
It was previously available only in the generic version which was used
by wxGTK and wxUniv, add it to the other ports too as it's going to be
needed in the upcoming commit.

In wxMSW this required storing the accelerators, as it is simpler than
converting them back from the native HACCEL and more consistent with the
other ports that already did this.
2026-09-26 19:30:40 +02:00
Vadim Zeitlin de0c03d5ab Add wxMenuBar::FindItemForAccelKey() and unit test for it
This function will be used in the upcoming commits, for now just add it
and a simple test showing that it works as intended.
2026-09-26 19:00:15 +02:00
Vadim Zeitlin 833dcf56f9 Add const wxWindow::GetAcceleratorTable() overload
This will allow const member functions to call GetAcceleratorTable()
without const_casts.
2026-09-25 18:21:23 +02:00
Vadim Zeitlin fb1258f87d Extract existing code into wxAcceleratorEntry::MatchesEvent()
Add the new function checking if a (key) event and wxAcceleratorEntry
correspond to the same key combination.

This was already used in the generic wxAccelerator implementation and
wxOSX and will be used in the other ports too soon, so move this code
into common function.

It can also be useful for the applications, so document it as well.
2026-09-25 03:20:14 +02:00
Vadim Zeitlin 9515455a9b Merge branch 'httpbin-more-robust'
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK UTF-8 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxQt (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxX11 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK 2 (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK gcc 7 static compatible 3.0 (push) Canceled after 0s
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxDFB (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Canceled after 0s
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Canceled after 0s
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Canceled after 0s
CMake builds / MSW/MSVC wxMSW (push) Canceled after 0s
CMake builds / MSW/Clang wxMSW (push) Canceled after 0s
CMake builds / macOS latest wxOSX Ninja (push) Canceled after 0s
CMake builds / macOS 14 wxOSX Xcode (push) Canceled after 0s
CMake builds / macOS 14 wxIOS (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 5.15 (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 6.10 (push) Canceled after 0s
Mac builds / wxMac ARM ASAN not compatible (push) Canceled after 0s
Mac builds / wxMac Universal C++14 (push) Canceled after 0s
Mac builds / wxiOS Simulator on Silicon Mac (push) Canceled after 0s
Mac builds / wxiOS (push) Canceled after 0s
Mac builds / wxMac Intel C++17 (push) Canceled after 0s
Mac Xcode builds / iOS Simulator static (push) Canceled after 0s
Mac Xcode builds / macOS dynamic Release (push) Canceled after 0s
Mac Xcode builds / iOS static Debug (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Release x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Debug Win32 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Release arm64 (push) Canceled after 0s
MSW builds / wxMSW vs2026 DLL Release x64 (push) Canceled after 0s
MSW cross-builds / wxMSW 64 bits not compatible (push) Canceled after 0s
MSW cross-builds / wxMSW/Univ (push) Canceled after 0s
MSW cross-builds / wxMSW 32 bits (push) Canceled after 0s
Code Checks / Check Spelling (push) Canceled after 0s
Code Checks / Check Whitespace (push) Canceled after 0s
Code Checks / Check Mixed EOL (push) Canceled after 0s
Code Checks / Check C++ Style (push) Canceled after 0s
Code Checks / Check All Headers In allheaders.h (push) Canceled after 0s
Update Documentation / Update Online Documentation (push) Canceled after 0s
Try to make launching go-httpbin more robust.

See #27065.
2026-09-25 00:09:27 +02:00
Vadim Zeitlin e582cc465f Suppress errors if SDL3 is not found
This avoids

CMake Warning at build/cmake/init.cmake:710 (find_package):
  By not providing "FindSDL3.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "SDL3", but
  CMake did not find one.
  ...

which is not just useless but also misleading because FindSDL3.cmake
doesn't exist (only config mode is supported by SDL3).

See #26773.

Closes #27062.
2026-09-25 00:08:49 +02:00
Vadim Zeitlin 8f82bf6edf Merge branch 'ime-control'
Provide some control over IME and use it to fix wxGrid when using IME.

See #27026.
2026-09-25 00:05:20 +02:00
Vadim Zeitlin 1afd6fba71 Merge branch 'msw-non-bmp-keys'
Add support for handling characters outside of BMP to wxMSW.

See #27016.
2026-09-25 00:04:20 +02:00
Vadim Zeitlin 73ec763a2d Merge branch 'dark-mode-cleanup' of github.com:stevecor/wxWidgets
Minor wxMSW dark mode code cleanup.

See #27073.
2026-09-24 23:58:30 +02:00
Vadim Zeitlin 3f60ae43c0 Document that MDI windows don't appear correctly in dark mode
Not only they don't have the expected dark appearance, but the child MDI
frame buttons don't appear at all, making them unusable.

See #27077.
2026-09-24 23:52:15 +02:00
Vadim Zeitlin 14e2f80f9a Avoid spurious errors from wxUILocale::GetPreferredUILanguages()
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK UTF-8 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxQt (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxX11 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK 2 (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK gcc 7 static compatible 3.0 (push) Canceled after 0s
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxDFB (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Canceled after 0s
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Canceled after 0s
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Canceled after 0s
CMake builds / MSW/MSVC wxMSW (push) Canceled after 0s
CMake builds / MSW/Clang wxMSW (push) Canceled after 0s
CMake builds / macOS latest wxOSX Ninja (push) Canceled after 0s
CMake builds / macOS 14 wxOSX Xcode (push) Canceled after 0s
CMake builds / macOS 14 wxIOS (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 5.15 (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 6.10 (push) Canceled after 0s
Mac builds / wxMac ARM ASAN not compatible (push) Canceled after 0s
Mac builds / wxMac Universal C++14 (push) Canceled after 0s
Mac builds / wxiOS Simulator on Silicon Mac (push) Canceled after 0s
Mac builds / wxiOS (push) Canceled after 0s
Mac builds / wxMac Intel C++17 (push) Canceled after 0s
Mac Xcode builds / iOS Simulator static (push) Canceled after 0s
Mac Xcode builds / macOS dynamic Release (push) Canceled after 0s
Mac Xcode builds / iOS static Debug (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Release x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Debug Win32 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Release arm64 (push) Canceled after 0s
MSW builds / wxMSW vs2026 DLL Release x64 (push) Canceled after 0s
MSW cross-builds / wxMSW 64 bits not compatible (push) Canceled after 0s
MSW cross-builds / wxMSW/Univ (push) Canceled after 0s
MSW cross-builds / wxMSW 32 bits (push) Canceled after 0s
Code Checks / Check Spelling (push) Canceled after 0s
Code Checks / Check Whitespace (push) Canceled after 0s
Code Checks / Check Mixed EOL (push) Canceled after 0s
Code Checks / Check C++ Style (push) Canceled after 0s
Code Checks / Check All Headers In allheaders.h (push) Canceled after 0s
Update Documentation / Update Online Documentation (push) Canceled after 0s
The registry key used by this function under MSW can be absent (at least
when using Wine), but this is not really an error, so don't log it.

Closes #27067.
2026-09-22 23:23:38 +02:00
Vadim Zeitlin f07dfda9d3 Merge branch 'wxToolBar-background' of github.com:stevecor/wxWidgets
Improve wxToolBar dark mode button background drawing in wxMSW.

See #27064.
2026-09-22 23:18:46 +02:00
Vadim Zeitlin a16da69037 Merge branch 'generic-treectrl-getbestclientwidth'
Fix best size computation in wxGenericTreeCtrl and several bugs
discovered while working on this.

See #27043.
2026-09-22 23:03:06 +02:00
Vadim Zeitlin 3b1bd2a67f Merge branch 'webrequest-curl-real-fix'
Fix bug in wxGTK event loop implementation responsible for
wxWebRequestCURL bugs.

See #27041.
2026-09-22 23:00:40 +02:00
Vadim Zeitlin 2f618c4724 Use random port for go-httpbin to listen on instead of always 8081
At least in macOS CI jobs something can be listening on 8081, making the
CI run fail when this happens, so choose a port randomly and try a few
adjacent ports if the random port doesn't work.

This should hopefully avoid spurious CI failures when go-httpbin can't
start.
2026-09-22 20:21:22 +02:00
Vadim Zeitlin 0811c8dabb Fix redirecting go-httpbin output to httpbin.log
Redirection order matters and it was wrong, resulting in stderr going
into the CI log and httpbin.log remaining empty.
2026-09-22 20:18:25 +02:00
Vadim Zeitlin 82a190a871 Disable wxWebRequest tests if httpbin couldn't be installed
"go install" sporadically fails to get go-httpbin, avoid failing the CI
run if this happens.

This is not ideal because if it starts always failing, the tests could
get broken without anybody noticing, but it's just too annoying
otherwise.
2026-09-22 20:16:35 +02:00
Vadim Zeitlin 14c0a846f8 Return early from httpbin_launch() if there is nothing to do
No real changes, just restructure the shell function to avoid having too
much nesting in it.
2026-09-22 20:15:32 +02:00
Vadim Zeitlin cff7d78b27 Work around MSW system menu becoming invalid on Explorer restart
Force creating the system menu to ensure that its handle belongs to this
process and not to Explorer, for example, as it is apparently owned by
the process which calls GetSystemMenu() first.

Closes #26799.
2026-09-22 12:57:14 +02:00
Vadim Zeitlin 68bbf85eb3 Allow restarting label editing in wxMSW multi-selection wxTreeCtrl
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK UTF-8 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxQt (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxX11 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK 2 (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK gcc 7 static compatible 3.0 (push) Canceled after 0s
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxDFB (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Canceled after 0s
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Canceled after 0s
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Canceled after 0s
CMake builds / MSW/MSVC wxMSW (push) Canceled after 0s
CMake builds / MSW/Clang wxMSW (push) Canceled after 0s
CMake builds / macOS latest wxOSX Ninja (push) Canceled after 0s
CMake builds / macOS 14 wxOSX Xcode (push) Canceled after 0s
CMake builds / macOS 14 wxIOS (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 5.15 (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 6.10 (push) Canceled after 0s
Mac builds / wxMac ARM ASAN not compatible (push) Canceled after 0s
Mac builds / wxMac Universal C++14 (push) Canceled after 0s
Mac builds / wxiOS Simulator on Silicon Mac (push) Canceled after 0s
Mac builds / wxiOS (push) Canceled after 0s
Mac builds / wxMac Intel C++17 (push) Canceled after 0s
Mac Xcode builds / iOS Simulator static (push) Canceled after 0s
Mac Xcode builds / macOS dynamic Release (push) Canceled after 0s
Mac Xcode builds / iOS static Debug (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Release x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Debug Win32 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Release arm64 (push) Canceled after 0s
MSW builds / wxMSW vs2026 DLL Release x64 (push) Canceled after 0s
MSW cross-builds / wxMSW 64 bits not compatible (push) Canceled after 0s
MSW cross-builds / wxMSW/Univ (push) Canceled after 0s
MSW cross-builds / wxMSW 32 bits (push) Canceled after 0s
Code Checks / Check Spelling (push) Canceled after 0s
Code Checks / Check Whitespace (push) Canceled after 0s
Code Checks / Check Mixed EOL (push) Canceled after 0s
Code Checks / Check C++ Style (push) Canceled after 0s
Code Checks / Check All Headers In allheaders.h (push) Canceled after 0s
Update Documentation / Update Online Documentation (push) Canceled after 0s
In a tree control with wxTR_MULTIPLE style, a click on the already
selected item doesn't start in-place editing if the control had lost
focus since the previous click, as such a click is supposed to just
restore the focus to the control and nothing else.

However the in-place editor itself takes the focus when it is shown,
so this flag remained set after the end of any label edit and the next
click on the item was silently swallowed instead of starting editing
it again, i.e. two clicks were needed to rename the item once more.

Don't set the flag when losing focus to our own editor then, but do
set it from the EN_KILLFOCUS handler if the editor loses focus to
another window, so that clicking back into the control still doesn't
start editing. Also check whether the editor is open in the mouse
click handler itself, as the click dismissing it shouldn't start a new
edit either, which used to be ensured by the same flag.

Assisted-by: Claude Opus 5
2026-09-22 02:45:12 +02:00
Vadim Zeitlin e32af73ffc Wait for longer in wxTreeCtrl::SelectItemMultiInteractive test
This test sporadically fails in GitHub Actions CI jobs, so try
increasing the timeouts used in it in the hope that it will help.
2026-09-22 02:40:21 +02:00
Vadim Zeitlin 621ee93962 Merge branch 'RibbonReader' of github.com:Blake-Madden/wxWidgets
Add keyboard navigation to Ribbon.

See #27046.
2026-09-21 23:14:42 +02:00
Vadim Zeitlin f387863363 Use GetScrollbarSize() instead of wxSYS_HSCROLL_[XY]
When determining the size of a window, GetScrollbarSize() should be used
instead of using the metrics values because the function takes into
account the case of overlay scrollbars, which are used by default with
GTK 3, unlike the metric value.

Also update the documentation to recommend doing this.
2026-09-21 16:46:55 +02:00
Vadim Zeitlin 417785fbab Fix GetScrollbarSize() in wxGTK when scrollbar-spacing is non-0
It is 0 in the default theme with GTK 3, but may be potentially non-0
even in it too and it's 3 by default with GTK 2, so GetScrollbarSize()
didn't return the correct result there.

Make it work in all cases by ensuring that GetScrollbarSize() and
DoGetClientSize() agree.
2026-09-21 16:46:54 +02:00
Vadim Zeitlin e50c794cac Extract wxGetScrollbarSpacing() function from wxGTK wxWindow
No real changes, just factor out this function to allow reusing it in
the upcoming commit.
2026-09-21 16:46:54 +02:00
Vadim Zeitlin 86415be2a3 Fix returning wrong value of wxGenericListCtrl::GetCountPerPage()
The value could have been cached for the size which has changed since it
was computed, making it wrong.

In practice, this resulted in a failure in "ListCtrl::Visible" unit test
in wxGTK when GTK_OVERLAY_SCROLLING=0 was set. This happened because the
initial window size was computed assuming that the scrollbars would be
shown (with overlay scrollbars we never reserve any space for them) and
the value of lines fitting per page became wrong later when it turned
out that no scrollbars were necessary.

The test passes both with and without GTK_OVERLAY_SCROLLING=0 now.
2026-09-21 16:46:54 +02:00
Vadim Zeitlin 1b775d77dd Fix passing wrong flags to wxEventLoopSourceHandler in wxQt
wxQtEventLoopSource ctor passed the file descriptor instead of flags to
the base class ctor expecting the latter.
2026-09-21 14:08:50 +02:00
Vadim Zeitlin 75b1f8ae6f Add a unit test exercising now fixed bugs in wxWebRequestCURL
The new tests check for the problems that resulted in crashes or hangs
before but work correctly now.

See #24885, #27040.
2026-09-21 14:08:50 +02:00
Vadim Zeitlin 9175212991 Revert hack in wxWebRequestCURL not needed any more
This reverts 4e0fca8ab9 (Fix crash when connection is refused in
wxWebRequestCURL, 2024-10-27) which is not needed any longer after the
underlying bug in wxGTK event loop has been fixed.

See #24885.
2026-09-21 01:57:14 +02:00
Vadim Zeitlin d42bc799f0 Don't notify already destroyed wxEventLoopSourceHandler in wxGTK
It doesn't make sense to continue reporting any events on a source that
has been destroyed, it doesn't need them any more and we could crash
using now dangling pointers and, worse, we could wrongly process the
notifications for a new source reusing the same FD.

This was the root source of multiple problems in wxWebRequestCURL and
could also cause them elsewhere.
2026-09-21 01:57:14 +02:00
Vadim Zeitlin 535a7bb56c Merge branch 'fix-static-init-problems'
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK UTF-8 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxQt (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxX11 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK 2 (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK gcc 7 static compatible 3.0 (push) Canceled after 0s
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxDFB (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Canceled after 0s
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Canceled after 0s
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Canceled after 0s
CMake builds / MSW/MSVC wxMSW (push) Canceled after 0s
CMake builds / MSW/Clang wxMSW (push) Canceled after 0s
CMake builds / macOS latest wxOSX Ninja (push) Canceled after 0s
CMake builds / macOS 14 wxOSX Xcode (push) Canceled after 0s
CMake builds / macOS 14 wxIOS (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 5.15 (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 6.10 (push) Canceled after 0s
Mac builds / wxMac ARM ASAN not compatible (push) Canceled after 0s
Mac builds / wxMac Universal C++14 (push) Canceled after 0s
Mac builds / wxiOS Simulator on Silicon Mac (push) Canceled after 0s
Mac builds / wxiOS (push) Canceled after 0s
Mac builds / wxMac Intel C++17 (push) Canceled after 0s
Mac Xcode builds / iOS Simulator static (push) Canceled after 0s
Mac Xcode builds / macOS dynamic Release (push) Canceled after 0s
Mac Xcode builds / iOS static Debug (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Release x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Debug Win32 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Release arm64 (push) Canceled after 0s
MSW builds / wxMSW vs2026 DLL Release x64 (push) Canceled after 0s
MSW cross-builds / wxMSW 64 bits not compatible (push) Canceled after 0s
MSW cross-builds / wxMSW/Univ (push) Canceled after 0s
MSW cross-builds / wxMSW 32 bits (push) Canceled after 0s
Code Checks / Check Spelling (push) Canceled after 0s
Code Checks / Check Whitespace (push) Canceled after 0s
Code Checks / Check Mixed EOL (push) Canceled after 0s
Code Checks / Check C++ Style (push) Canceled after 0s
Code Checks / Check All Headers In allheaders.h (push) Canceled after 0s
Update Documentation / Update Online Documentation (push) Canceled after 0s
Fix static initialization problems.

See #27039.

Closes #27038.
2026-09-20 22:24:19 +02:00
Vadim Zeitlin 2816bee1a5 Use wxKeyEvent::GetUnicodeChar() instead of GetUnicodeKey()
The new function works correctly for the events carrying non-BMP
characters under MSW too, so use it everywhere in wx own code.
2026-09-20 22:18:37 +02:00
Vadim Zeitlin 81ea3c8854 Handle characters outside of BMP in wxRichTextCtrl under MSW
Change wxRichTextEvent::m_char to be of type wxUniChar and not wxChar.
This is mildly backwards-incompatible but the break is arguably worth
not adding some new GetUnicodeCharacter().
2026-09-20 22:17:37 +02:00
Vadim Zeitlin f4af4d5307 Handle characters outside of BMP in wxStyledTextCtrl under MSW
Pass wxUniChar to ScintillaWX::DoAddChar() to handle supplementary
characters in wxStyledTextCtrl when they don't fit into wxChar, as under
MSW.
2026-09-20 22:12:52 +02:00
Vadim Zeitlin 9bf5a10d99 Pass wxUniChar to wxVListBoxComboPopup::HandleKey()
wxChar can't hold all possible characters under MSW, so prefer using
wxUniChar even if it's not clear if this have any practical benefits in
this particular case.
2026-09-20 22:12:27 +02:00
Vadim Zeitlin 6b4a5fd64c Add support for non-BMP characters in wxKeyEvent in wxMSW
Recombine the 2 WM_CHAR messages we receive for high and low surrogate
pair into a single Unicode character which can be retrieved using the
new wxKeyEvent::GetUnicodeChar() member function.

Update documentation and comments to recommend using the new function
instead of GetUnicodeKey().

Also update the keyboard sample to use it to be able to show events for
supplementary characters under MSW.

Closes #25135.
2026-09-20 21:46:44 +02:00
Vadim Zeitlin 82f2d9bddb Add wxWindow::SendAfterCharEvent()
This trivial helper can be used from wxComboBox too, which will be
useful for the upcoming commits.

No real changes yet.
2026-09-20 21:40:55 +02:00
Vadim Zeitlin dbf58d2748 Always initialize wxKeyEvent::m_rawCode and m_rawFlags
They are supposed to be initialized from platform-specific code, but
don't leave them with garbage values if they are somehow not.
2026-09-20 21:40:55 +02:00
Vadim Zeitlin 1e2e4d794d Initialise wxKeyEvent members in their declarations
No real changes, just make it clear what values are various members
initialized with.
2026-09-20 21:40:55 +02:00
Vadim Zeitlin d9b2e44f37 Disable IME in generic wxDataViewCtrl
Don't show IME when pressing keys in wxDataViewCtrl, this is useless
and confusing because it doesn't accept text input.

This fixes a similar problem to that of #24558 for wxGrid.
2026-09-20 21:34:22 +02:00
Vadim Zeitlin eb685ad058 Disable IME when the current wxGrid cell doesn't support text input
Some cells may be editable but not accept text input, e.g.
wxGridCellBoolEditor handles some keys but only to set/clear/toggle the
checkbox it shows, and the IME should not be shown for them.

Avoid adding a new wxGridCellEditor::AcceptsTextInput() virtual function
by reusing the existing IsAcceptedKey() to probe for text input support:
we decide that if "a" is a valid key, then any text can be entered.

If this hack turns out to be too limiting or surprising, we can always
add AcceptsTextInput() later.

See #24558.
2026-09-20 21:24:12 +02:00
Vadim Zeitlin ff5a4e1af1 Fix using wxStandardPaths during static initialization phase
Static gs_stdPaths variable may not be initialized yet at this stage and
so an invalid wxStandardPaths object could be created.

Fix this by simply making this global variable static in the only
function using it -- it doesn't need to be global at all and this
ensures that it's initialized before use.
2026-09-20 19:09:24 +02:00
Vadim Zeitlin b03f1b57a1 Make wxConvFile safe to use during static initialization phase
wxConvFileName may not be initialized yet and there is nothing we can do
about this because it has to remain a simple variable to allow setting
it.

However we can change wxConvFile and wxFNCONV to use wxGetFileNameConv()
accessor function which ensures that we initialize wxConvFileName before
using it at least via these functions.

Also update a couple of direct references to wxConvFileName in the code
which might conceivably be used at this stage.
2026-09-20 19:07:50 +02:00
Vadim Zeitlin 10c4a5611a Merge branch 'test-races' of github.com:LegalizeAdulthood/wxWidgets
Stabilize parallel CTest runs,

See #26868.
2026-09-20 18:43:47 +02:00
Vadim Zeitlin fd094ccb79 Use std::unique_ptr<> in wxURI unit tests
No real changes, just get rid of manual "delete" calls.
2026-09-20 18:26:24 +02:00
Vadim Zeitlin 801f91d8ab Merge branch 'fix-fmt-uchar-msw'
Fix formatting wxUniChar outside of BMP under MSW.

See #27023.
2026-09-20 17:51:08 +02:00
Vadim Zeitlin 068588b2f7 Provide a way to position IME window
Add wxWindow::UpdateInputMethodCursorRect() which can be used to let the
IME know where to place its window and use it in wxGrid to show it near
the cell being edited.

See #24558.
2026-09-20 02:49:35 +02:00
Vadim Zeitlin 4a80ac3caa Make wxGTK wxScrolled::GetViewStart() behave as the generic version
Update the scroll position before scrolling in wxGTK to make it
consistent with the other ports.

Add a unit test checking that all ports behave consistently.
2026-09-20 02:32:07 +02:00
Vadim Zeitlin a9390a6035 Prevent IME from being used for read-only wxGrid cells
Use the recently added wxWindow::EnableInputMethod() to disable IME for
readonly cells.

Closes #24558.
2026-09-20 02:32:07 +02:00
Vadim Zeitlin cc43fa9e22 Add wxWindow::EnableInputMethod() for disabling IME
Implement it in wxMSW, wxGTK and wxOSX.

This will be used to prevent IME window from appearing for windows that
currently don't accept keyboard input even if they accept focus.
2026-09-20 02:32:07 +02:00
Vadim Zeitlin c9d12fc211 Add wxIMCContext RAII helper wrapping HIMC
Make ImmGetContext()/ReleaseContext() safer to use.

No real changes.
2026-09-19 20:31:12 +02:00
Vadim Zeitlin 76e685fd86 Move IMM function wrappers used in wxMSW into a class
No real changes, just collect all functions in a single class to make it
easier to add more of them.
2026-09-19 20:19:41 +02:00
Vadim Zeitlin b01632cf3b Implement wxAnimation::Get{FrameCount,Delat,Frame}() in wxGTK
Iterate over the animation manually to find the frame we need.

Update the sample to allow showing individual animation frames.

Closes #27009.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2026-09-19 12:57:54 +02:00
Vadim Zeitlin fd21446a7d Fix handling of non-ASCII characters in UTF-8 build
Don't consider "C" locale to be UTF-8 except in UTF-8-only build where
it needs to be done to allow the program to run at all.

This fixes a bug when wx CRT wrappers get broken by creating and
destroying wxLocale: initially functions such as wxSnprintf() handle
non-ASCII characters correctly because wxLocaleIsUtf8 is initially
false, so they use wide char functions. But creating and destroying
(any) wxLocale results in wxUpdateLocaleIsUtf8() being called and if the
locale was "C" (as it is by default), it sets wxLocaleIsUtf8 to true
meaning that wxSnprintf() etc now use narrow character functions that
don't handle non-ASCII characters and just fail for them.
2026-09-19 12:19:12 +02:00
Vadim Zeitlin dc601c13ad Ensure that the tests use UTF-8 locale in UTF-8-only build
This is a requirement of this build: it doesn't work correctly in any
other locale, including the default "C" one.
2026-09-18 19:47:53 +02:00
Vadim Zeitlin 593e5d1321 Fix formatting non-BMP wxUniChars using wx functions under MSW
Previously wxString::Format("%c", wxUniChar{0x1F600}) produced broken
"\uF600" under MSW because this was all that fit into a wchar_t there
which can only contain 16-bits. And using "%d" or "%x" was broken in the
same way, as wxArgNormalizer<wxUniChar> always used wx_truncate_cast()
to wchar_t which is not lossless when sizeof(wchar_t)==2.

Fix this with the following horrible/ingenuous/crazy (choose your own
adjective) hack: because we can't fit supplementary Unicode characters
into a wchar_t, don't even try doing it and instead inject the bytes
representing the character into the format string itself (suitable
padded/aligned depending on the formatting flags) and replace the
format specifier used for wxUniChar with "%.0d" and feed it 0, which
ensures that no output is produced for it.

This can be done with surprisingly little amount of changes and should
be completely transparent to any code not formatting wxUniChars outside
of the BMP -- while such code will now behave correctly, instead of
silently producing wrong output as before, under MSW too.

Note that we do this unconditionally, i.e. without preprocessor checks
for SIZEOF_WCHAR_T, even if old code worked when it was 4, because using
the same code under all platforms should make finding and fixing bugs in
it simpler and also because this code is already hairy enough to not
need any extra complications.
2026-09-18 18:04:16 +02:00
Vadim Zeitlin cc729694f0 Add wxFormatString::Preprocess() and use it instead of Validate()
No real changes yet, just add a function with a name indicating that it
can do more than just validate the format string (because it will soon)
and call it instead of Validate().
2026-09-18 18:04:14 +02:00
Vadim Zeitlin 54b55ed92d Merge branch 'MSW-fswatcher' of github.com:sethhillbrand/wxWidgets
Fix the remaining races in MSW file watcher and keep watching if a
directory is removed.

See #27012.
2026-09-16 23:14:55 +02:00
Vadim Zeitlin 21a11df9b7 Merge branch 'persist-dpi'
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK UTF-8 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxQt (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxX11 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK 2 (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK gcc 7 static compatible 3.0 (push) Canceled after 0s
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxDFB (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Canceled after 0s
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Canceled after 0s
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Canceled after 0s
CMake builds / MSW/MSVC wxMSW (push) Canceled after 0s
CMake builds / MSW/Clang wxMSW (push) Canceled after 0s
CMake builds / macOS latest wxOSX Ninja (push) Canceled after 0s
CMake builds / macOS 14 wxOSX Xcode (push) Canceled after 0s
CMake builds / macOS 14 wxIOS (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 5.15 (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 6.10 (push) Canceled after 0s
Mac builds / wxMac ARM ASAN not compatible (push) Canceled after 0s
Mac builds / wxMac Universal C++14 (push) Canceled after 0s
Mac builds / wxiOS Simulator on Silicon Mac (push) Canceled after 0s
Mac builds / wxiOS (push) Canceled after 0s
Mac builds / wxMac Intel C++17 (push) Canceled after 0s
Mac Xcode builds / iOS Simulator static (push) Canceled after 0s
Mac Xcode builds / macOS dynamic Release (push) Canceled after 0s
Mac Xcode builds / iOS static Debug (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Release x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Debug Win32 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Release arm64 (push) Canceled after 0s
MSW builds / wxMSW vs2026 DLL Release x64 (push) Canceled after 0s
MSW cross-builds / wxMSW 64 bits not compatible (push) Canceled after 0s
MSW cross-builds / wxMSW/Univ (push) Canceled after 0s
MSW cross-builds / wxMSW 32 bits (push) Canceled after 0s
Code Checks / Check Spelling (push) Canceled after 0s
Code Checks / Check Whitespace (push) Canceled after 0s
Code Checks / Check Mixed EOL (push) Canceled after 0s
Code Checks / Check C++ Style (push) Canceled after 0s
Code Checks / Check All Headers In allheaders.h (push) Canceled after 0s
Update Documentation / Update Online Documentation (push) Canceled after 0s
Handle restoring settings saved by persistent objects after DPI change.

Closes #18752.

See #27006.
2026-09-16 00:43:14 +02:00
Vadim Zeitlin 5a2a673d60 Fix updating saved splitter position on DPI change
While the current and minimum positions were updated, the saved last
split position was not, so unsplitting the splitter, changing the DPI
and splitting it again wouldn't use the correct position for the new
DPI.

Also rescale m_requestedSashPosition if it's valid even if it's not
clear whether this can happen or not.
2026-09-14 14:03:23 +02:00
Vadim Zeitlin 8a78656005 Account for DPI in wxPersistentSplitter too
Rescale the saved splitter position if the DPI has changed when
restoring it by using {Save,Restore}Coord().
2026-09-14 14:03:23 +02:00
Vadim Zeitlin a02e4dac14 Fix restoring wrong last split position in wxPersistentSplitter
This was broken since f24b3d5483 (Save last wxSplitterWindow position
before it was unsplit, 2024-02-12) which accidentally used the wrong
lastSplitPos component when restoring.
2026-09-14 14:03:23 +02:00
Vadim Zeitlin c2d78e955a Account for DPI in wxPersistentDataViewCtrl too
Just use {Save,Restore}Coord() to restore the columns widths instead of
{Save,Restore}Value() to rescale the saved values if necessary.

Add a unit test checking that this works as expected.
2026-09-14 14:03:23 +02:00
Vadim Zeitlin 2a992cfac7 Factor out SavePersistenceTestDVC() in wxPersistDVC unit test
Make the code creating a wxDVC and saving it available in a reusable
function to allow calling it from another place in the upcoming commit.

No real changes, this is a pure refactoring.
2026-09-14 02:39:45 +02:00
Vadim Zeitlin 3cdb10d42d Save DPI in wxPersistentTLW to handle DPI change correctly
Add support at wxPersistentWindow level for saving the DPI at which the
window coordinates were saved to allow rescaling the values by the ratio
of this DPI to the current one if the DPI has changed between saving and
restoring.

This allows keeping the same proportional size of the window after DPI
change on the platforms not using DPI-independent pixels (such as wxMSW)
too by just using the new {Save,Restore}Coord() functions instead of
{Save,Restore}Value() for any quantities that need to be scaled.

Do this for wxPersistentTLW to update the window size to remain
proportionally the same after DPI change.
2026-09-14 02:39:45 +02:00
Vadim Zeitlin feea732352 Merge branch 'textfile-fsync'
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK UTF-8 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxQt (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxX11 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK 2 (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK gcc 7 static compatible 3.0 (push) Canceled after 0s
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxDFB (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Canceled after 0s
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Canceled after 0s
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Canceled after 0s
CMake builds / MSW/MSVC wxMSW (push) Canceled after 0s
CMake builds / MSW/Clang wxMSW (push) Canceled after 0s
CMake builds / macOS latest wxOSX Ninja (push) Canceled after 0s
CMake builds / macOS 14 wxOSX Xcode (push) Canceled after 0s
CMake builds / macOS 14 wxIOS (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 5.15 (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 6.10 (push) Canceled after 0s
Mac builds / wxMac ARM ASAN not compatible (push) Canceled after 0s
Mac builds / wxMac Universal C++14 (push) Canceled after 0s
Mac builds / wxiOS Simulator on Silicon Mac (push) Canceled after 0s
Mac builds / wxiOS (push) Canceled after 0s
Mac builds / wxMac Intel C++17 (push) Canceled after 0s
Mac Xcode builds / iOS Simulator static (push) Canceled after 0s
Mac Xcode builds / macOS dynamic Release (push) Canceled after 0s
Mac Xcode builds / iOS static Debug (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Release x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Debug Win32 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Release arm64 (push) Canceled after 0s
MSW builds / wxMSW vs2026 DLL Release x64 (push) Canceled after 0s
MSW cross-builds / wxMSW 64 bits not compatible (push) Canceled after 0s
MSW cross-builds / wxMSW/Univ (push) Canceled after 0s
MSW cross-builds / wxMSW 32 bits (push) Canceled after 0s
Code Checks / Check Spelling (push) Canceled after 0s
Code Checks / Check Whitespace (push) Canceled after 0s
Code Checks / Check Mixed EOL (push) Canceled after 0s
Code Checks / Check C++ Style (push) Canceled after 0s
Code Checks / Check All Headers In allheaders.h (push) Canceled after 0s
Update Documentation / Update Online Documentation (push) Canceled after 0s
Call fsync() in wxTextFile::Commit() to ensure we don't lose data.

See #27001.
2026-09-13 14:45:19 +02:00