We reuse the same global dispatcher object (allocated in
wxFDIODispatcher::Get()) for the sockets created in different threads, so it's
perfectly possible for its methods to be called concurrently and this happens
even in our own socket streams unit tests.
Protect against concurrent modification of the select sets and m_maxFD. This
fixes sporadic Travis build failures such as the one at
https://travis-ci.org/wxWidgets/wxWidgets/jobs/110757281 for example and
probably even worse bugs too.
If setting sash position to a value that cannot be satisfied due to
minimum size constraints, wxSplitterWindow would continue endlessly
trying and failing to set it, causing constant CPU use on OS X. This was
because delayed sash setting was invoked from idle handler and if it
failed, the code would repeat the same action again and again.
Instead, perform this delayed setting from OnSize handler. If setting
sash position failed in the first place, it must have been due to too
small size of the window. Therefore it's pointless to try again until
the size changes.
An old check - used for reasons that no longer apply - was preventing
correct rendering of wxToolBar background in wxMSW. Fix this by removing
the obsolete check.
See #9666 for the original reason for the check.
This file was mistakenly removed from the list of wxOSX headers in
602ea92143.
And don't install wx/osx/core/stdpaths.h which doesn't exist any longer (see
abe10b8c00).
Closes#17381.
Ensure that the correct parent is used when no parent is explicitly specified
by calling GetParentForModalDialog().
This generalizes baff0c942b (see #17384) to the
rest of the modal dialogs (wxMessageDialog already did this).
Closes#17146.
Don't optimize the required length as this is a tiny gain resulting in big
problems with the strings containing surrogates for which the actual result is
shorter than the length returned, resulting in extra NUL bytes at the end of
the converted buffer.
This is similar to 3410aa372f (see #16298) but
for UTF-32 and not UTF-16.
Closes#17070.
Use the same GetParentForModalDialog() method as for the normal dialogs to
find the parent to use for this native dialog and ensure that it is shown
modally even if no parent is explicitly specified when constructing it.
Closes#17384.
Use wxConvWhateverWorks when converting the command line given as a string to
individual arguments: we already used wxSafeConvertWX2MB() when converting the
arguments specified as an array, but not here.
Closes#16206.
These functions were almost but not quite identical to it:
wxSafeConvertMB2WX() tried the current locale encoding before UTF-8 while
wxConvWhateverWorks tries UTF-8 first and then the current locale encoding.
The latter behaviour is more correct as valid UTF-8 could be misinterpreted as
some legacy multibyte encoding otherwise, so get rid of this difference and
just forward these functions to wxConvWhateverWorks.
This ensures that we can create output files with Unicode names even when
they're not representable in the current locale encoding, notably when the
current locale has never been changed and is still the default "C" one, not
supporting anything else other than 7 bit ASCII.
Credits for the new class name go to Woody Allen.
Fall back to UTF-8 rather than not outputting anything at all if the string is
not representable in the current locale encoding.
Even if we did try to handle this error by setting failbit, chances of anybody
checking for it (especially on e.g. std::cout) were very low and the only
possible workaround in practice would have been attempting to output the
string in UTF-8 anyhow, so just do it ourselves.
See #17358.
Ensure that we do output the string contents even if we have to encode it in
UTF-8 instead of the current locale encoding -- this is still better than not
outputting anything at all.
Closes#17358.
Disable more libraries and use --disable-optimize instead of --enable-debug
(also for MinGW) as we don't really need debug information in these builds and
not generating it might make things faster.
Include wx/msw/uxtheme.h even when wxUSE_UXTHEME == 0 because
wxUxThemeEngine::GetIfActive() and MARGINS struct are still used even then in
anybutton.cpp and menuitem.cpp respectively.
If a class not using "override" for its other, not wx-related, virtual methods
included wxDECLARE_EVENT_TABLE() with wxOVERRIDE inside it, it resulted in a
clang -Winconsistent-missing-override warning per each virtual method without
it which was very annoying.
Avoid it by not using wxOVERRIDE in this macro and explicitly disabling the
-Winconsistent-missing-override for the methods inside it in case the rest of
the class does use "override".
Notice that this also required rearranging the order of the declarations in
this macro to ensure that a semicolon is still required after it.
Closes https://github.com/wxWidgets/wxWidgets/pull/217
For ComCtl32 prior to 6.0 all text labels in wxListCtrl need to be re-assigned when new wxImageList is set in order to position them correctly within the control.
ComCtl32 prior to 6.0 doesn't support images with alpha channel so if we have 32-bit icon with transparency we need to convert it to a wxBitmap and then add this bitmap to wxImageList. If required, bitmap with alpha channel will be converted to the mask in wxImageList::Add.
This symbol is tested using "#if", so it should be always defined and there is
no need for testing whether this is the case.
Moreover, doing this useless check triggers warning C4574 (which is disabled
by default, but it's useful enough to enable it explicitly) with VC14 about
using "#ifdef" with a symbol defined as 0.
1. Override wxWindow::GetContentScaleFactor() to use gdk_window_get_scale_factor()
when available, and to use correct scale (1.0) otherwise, as wxDC::GetPPI()
(used by overridden method) is not properly implemented for wxGTK
2. Record scale in wxBitmap(wxImage&) ctor and wxBitmap::CreateScaled()
3. Adjust cairo scale for drawing bitmap, and (inversely) for drawing on bitmap
These tests don't seem to be sound, it's possible for one second or more to
pass between the two calls to GetTimes() and it's apparently possible for the
access time on the symlink to not change (due to /tmp being mounted with
"noatime" option perhaps?), resulting in Travis CI build failures.
It doesn't make sense to use any fallbacks when converting to/from UTF-8 and
this wasn't even done consistently as only wxSafeConvertWX2MB() used
MAP_INVALID_UTF8_TO_OCTAL, but not wxSafeConvertMB2WX().
More importantly, UTF-8 conversion can never fail for a valid Unicode string,
so there is no need for any fall backs.