An existing unit test failed in UTF-8 build because using "%c" with an
invalid character triggered an assert due to trying to encode in UTF-8
(wchar_t)-1 that vswprintf() put into the returned buffer.
Fix this by not using the buffer contents at all if the function failed.
Note that although this seems to be harmless in wchar_t build, it was
still useless there, so don't make this specific to UTF-8 build.
Destroying an iterator with a lifetime greater than that of the
associated string resulted in an invalid memory access due to using the
linked list of string iterators in the iterator dtor.
Fix this by clearing all the associated iterators when the string itself
is destroyed.
This fixes ASAN errors in wxDateTime::ParseDateTime() where "endTime"
const_iterator was destroyed after the destruction of the associated
"timestr" after successfully parsing the date.
Under MSW, where wchar_t uses UTF-16, using wxString::length() was
wrong, as it could be smaller than the actual length of the wide
character string, e.g. 1 instead of 2 for a string containing a single
surrogate character, such as U+2070D used in wxStringOutputStream::Tell
unit test.
This makes this test pass under MSW too now.
Don't declare static Cache variable inside wxString declaration itself
because it is implicitly DLL-exported, due to the use of
__declspec(dllexport) for the entire wxString class, but thread-specific
variables can't be exported, so this resulted in a compilation error.
Avoid this by using a static thread-specific variable inside GetCache(),
which had to be moved out of line.
This option can also be used under MSW, so move it to the common setup.h
instead of having it in setup.h.in only.
Also do the same thing for wxUSE_UTF8_LOCALE_ONLY, even if it's less
clear if this one is really useful in non-Unix environment.
It is apparently not safe to call gtk_events_pending() from the idle
callback, as it can result in GLib failing to properly dereference some
GSource objects.
This leads to increasingly large amounts of CPU time being spent in GLib
processing internal lists of these GSource objects. So avoid calling
gtk_events_pending(), as it is not strictly necessary because our idle
source will remain installed if wxIdleEvent::RequestMore() is used, and
if no events have arrived the idle callback will be invoked again.
Closes#23364.
See #23368.
This replaces the previously implemented wxWebViewWindowInfo.
It explicitly breaks the previous API to enable WebKitGTK
integration and to make the usage in application code less error prone.
A new event wxEVT_WEBVIEW_NEWWINDOW_FEATURES is added to allow
access to the window features and the child web view.
This function must be called to be able to re-create the EGL drawing
surface after the window layout have changed, such as after a reparent
of the canvas or of it's grandparents.
Make it suitable for use in this case by re-creating the surface if
there already was one and document this function to make it part of the
public API.
Closes#23366.
- Update parsing IPvX addresses to follow RFC and add many more tests.
- Rework authority parsing for RFC edge cases.
- Fix a couple of other extreme edge cases.
Closes#23360.
Remove _() around string which it doesn't make sense to translate in the
sockets sample.
This doesn't actually change anything as this sample doesn't use
translations in any case, but still show a good example.
Closes#23362.
Version 2.40 deprecates a few functions used in wxWebViewWebKit
implementation, resulting in new warnings breaking CI builds.
Avoid these warnings by suppressing them for now before the real
solution, involving using the new functions if they're available, can be
implemented.
See #23367.
Tab traversal from a wxPropertyGrid didn't work across wxPanel
instances or when the property grid was followed by a static control
such as wxStaticText due to implementing it "manually".
Fix this by using Navigate() to implement this instead, and just keep a
SetFocus() hack which is still needed for wxGTK.
Fixes#23354.
Closes#23358.
Since 8.0~repack-3 version of the Debian Wine package, installing wine64
doesn't create wine64 symlink any more and wine package needs to be
installed to do it, apparently due to the changes done to fix
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1029536
This resulted in the tests not running any more because we used wine64
for running them. Just use "wine" now and install wine package, as it
should still run 64-bit binaries just fine.
In 40ff38b63b wxWebView::GetNativeConfiguration() was
added which isn't suitable if multiple wxWebViewEdge instances are created with
different options (as they must share the same options). To prevent such errors
the previous method is replaced by the new class wxWebViewConfiguration which
can be shared between various wxWebView instances.
This explicitly breaks API to improve usage.
In the future the new class could also enable a good way to wrap various
common options/configurations available via native API.
We could return a wrong value from this function if two threads called
it simultaneously, as gmtoffset value could be returned without DST
adjustment in one of them. And just accessing it from two different
threads without synchronization was a data race on its own.
Fix both problems by using an atomic int for it and taking care to only
set it to the correct value.
Using sleep was not only fragile but also resulted in tons of TSAN
errors, so replace it by the similar approach to the one which was
already used to wait for the threads to start up.
This is horribly inefficient but we don't care about this in the test
and, at least, this does ensure that the threads exit before it ends.
This function could be called on an already deleted object, which could
result in a crash, and always resulted in a TSAN error.
Fix this by calling it before releasing the internal lock, which
prevents this from happening, but will result in a deadlock if this
function is overridden to do something requiring any lock held by the
thread.
This is not ideal, but still seems to be like a lesser evil.