Apple clang now enables the warning suppressed by this macro by default,
so it becomes important to suppress it for this compiler as well and not
just gcc.
Rename the macro to remove "GCC" prefix which doesn't make sense any
more now that this macro is not only for gcc.
This avoids warnings in the test suite when building in macOS 15 GitHub
Actions image using newer Apple clang.
Because the corresponding native controls don't support modifying their
items in place, wxChoice and wxListBox had to remove the item and add it
back, which was quite expensive, so it's better to avoid this if the
item doesn't change at all.
The original fix applied in 95a47a88a9 (Make Window::Refresh test more
robust under Mac, 2026-07-23) was unfortunately lost when 8003fd68a4
(Fix Window::Refresh unit test under wxGTK now, 2026-07-24) was applied
soon after. And this fix wasn't sufficiently robust anyhow as a single
wxYield() might not have been enough.
Really wait for the initial repaint of both the parent and all children
before running this test to hopefully avoid problems in this test in the
future under all platforms.
See #26726.
U+FFFF was encoded using 4 bytes instead of 3 in wxUniChar::AsUTF8(),
used by wxString in UTF-8 build, producing an invalid overlong sequence.
wxUString::utf8_str() had the same bug, but there it also wrote one byte
past the end of the buffer, as the length of the result was computed
correctly, i.e. using 3 bytes for this character, before encoding it.
Fix both comparisons and add a unit test checking the encoding of the
code points around the end of the BMP.
Fixes#25308.
Closes#27150.
These functions must take "activity" parameter as "unsigned long" and
not "int" to make their type compatible with CFRunLoopObserverCallBack
which uses CFRunLoopActivity that is defined as "unsigned long".
This fixes warnings with Apple clang 17, used in GitHub Actions macOS 15
images, which apparently enables -Wcast-function-type-mismatch by
default. And it's the right thing to do, anyhow.
Previously, wxMSW native version only sent wxEVT_LIST_ITEM_[UN]CHECKED
if the item state has really changed, while the generic version, used in
wxGTK and wxOSX, did it unconditionally and wxQt native version never
did it at all.
Make all ports behave as wxMSW, which seems like the most useful
behaviour and add a unit test checking that this behaves as expected.
Note that virtual controls still always send the events in all ports, as
they work as notifications for the model in their case, and a new test
checks that this is the case in all ports (except wxQt which doesn't
support them).
Implement native pre-edit handling for wxGTK and Cocoa using Scintilla's
tentative input support.
Use a private text input client bridge to complete Cocoa
NSTextInputClient and support GTK pre-edit callbacks without changing
the public API or existing class ABI.
Inline composition is now the default on GTK and Cocoa, existing code
may call SetIMEInteraction(wxSTC_IME_WINDOWED) to retain the previous
behaviour.
While composition is active under wxGTK, the IM context is given first
access to key events, as keys such as Enter and Backspace confirm or
edit the pre-edit text and must not be handled as normal key events.
Rolling the pre-edit text back relies on tentative undo actions being
recorded, so windowed interaction is used while undo collection is
disabled.
Document platform defaults and add regression tests for composition,
UTF-16 ranges, replacement ranges, virtual space, undo, and mode
switching.
Closes#26228.
Closes#26757.
In dark mode we redrew all the items when setting the column width to
"automatic" size which made it very slow compared to light mode.
Just don't do it in this case, as it's completely unnecessary.
This brings the time for autosizing 10 columns with 500 items down from
~9s to ~250ms which is almost the same as in light mode.
Closes#24011.
Clamp an inherited default day to the last valid day of the parsed
month/year when ParseFormat() replaces the year or month but not the
day, so a Feb 29 default no longer creates an invalid non-leap date.
Add a regression for parsing a year with a Feb 29 default date.
Fixes#14058.
Closes#27135.
Destruction-time queries for controls are expected, so they shouldn't
assert. It is difficult to reproduce the assert, seems to require random
timing with the IME service while closing a ribbon, but using a silent
pointer check will remove the wxCHECK assert that can randomly happen.
Closes#27147.
When wxDEPRECATED_MSG() uses __declspec(deprecated) internally, and not
the standard [[deprecated]] attribute as it does for newer MSVC
versions, the compiler warns about any mention of the deprecated class
even if it's not being really used, so suppress the unwanted warnings
about it.
They do what they say for all supported compilers, i.e. currently MSVC,
gcc and clang, and using these macros is simpler and shorter than using
compiler-specific macros for each compiler.
Define similar macros for MSVC as we already had for gcc and clang for
consistency and because they are arguably less ugly than directly using
pragmas in the code.
Use them instead of manually disabling warnings.
No real changes.
Get rid of black borders around the fields and gaps between them.
Fixes#25521.
Fixes#23621.
Closes#27098.
Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
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.
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.
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.
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.
Compute the actual position of the URL text before clicking it instead
of using a fixed client coordinate. This keeps the test using
wxUIActionSimulator for mouse input while avoiding failures when the
fixed point doesn't land on the link text.
Also use a single wxHAS_TEXT_URL_TEST preprocessor symbol instead of
testing a complicated expression.
Closes#27143.
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.
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.
Use the current focused page when handling wxAuiNotebook child-focus
notifications so a delayed focus event from the previous page does not undo
a programmatic selection change made from an event handler.
Add a regression test covering a stale child-focus event after selection has
already moved to another page.
This commit is best viewed ignoring whitespace-only changes.
Fixes#13639.
Closes#27133.
Set the autowrap renderer DC font from the cell attribute before measuring
line heights, so small-font cells do not inherit another DC font when rows
are autosized.
Use the full spanned row or column extent when asking renderers for their
autosize measurement, and cover autowrap font and spanned-row sizing.
Fixes#14072.
Closes#27136.
Track the currently active generic wxRichToolTip popup and dismiss it
through the popup notification path before showing a new one, while
ignoring delayed duplicate dismissals for popups already queued for
destruction.
Add a GUI regression test that shows two rich tooltips in sequence.
Fixes#13954.
Closes#27134.
Clarify that wxStaticText::Wrap() operates on the plain text label and
strips formatting previously set with wxControl::SetLabelMarkup().
See #13389.
Closes#27131.
Recognize BASE HREF while parsing wxHTML pages and update the parser file
system base so subsequent relative image and page URLs resolve against it.
Add a parser regression test covering relative image loading and default page
URL opening through the updated base.
Fixes#13125.
Closes#27130.
Add interface documentation for wxActiveXEventNativeMSW, including the native
IDispatch::Invoke() fields exposed by wxActiveXEvent::GetNativeParameters()
and the lifetime of the returned event parameters.
Fixes#12410.
Closes#27129.
Only wxMSW uses a native control, recognized by screen readers, but
wxGenericListCtrl was not recognized by them at all.
Extend the private accessibility API added in the previous commit to
support table-like controls too and use in wxGenericListCtrl to let
screen readers know about its contents.
Assisted-by: Claude Opus 5.5
Co-authored-by: Quin Gillespie <trypsynth@gmail.com>
Only wxMSW uses the native wxStatusBar which is recognized by screen
readers, while wxGTK and wxOSX use the generic version which is just a
window and so was not recognized by them as being what it is at all.
Add generic (but private for now) SetAccessibleElements() function
implemented for both of them and use it from wxStatusBarGeneric to let
Orca/VoiceOver know about the status bar fields and, in wxGTK, about its
role.
Assisted-by: Claude Opus 5.5
Co-authored-by: Quin Gillespie <trypsynth@gmail.com>
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>