Don't change the window size automatically if the application handled
wxEVT_DPI_CHANGED event to allow it to choose a better size than what is
suggested by MSW itself.
Closes#19152.
Update the TLW decoration size as soon as DPI changes to ensure that
GetBestSize() returns correct value: previously it was too small when
moving the window from normal to high DPI, for example, because
GetBestSize() added the smaller, old decoration size to the best
computed client size.
And now that it works correctly, ensure that we never set the window
size to a size smaller than its best size to prevent window elements
from not fitting into the window after the DPI change.
See #18649.
We seem to be only getting WM_DPICHANGED if the DPI did really change,
so remove the check for this.
This commit is best viewed ignoring whitespace-only changes.
The situation with Python under FreeBSD is pretty weird, with system
Python being 3.7, but pip only available as py38-pip package and,
unsurprisingly, not working with python3.
This could probably be resolved somehow, but for now I just don't have
enough energy to fight with Python again, so simply don't use it.
This file was removed back in 961a1c2b39 (Remove unused Java class files
without sources from help sample, 2017-10-04) but was left in the bake-
and make-files.
Somehow this didn't create any problems with GNU make, where cp exited
with an error, but make recipe succeeded nevertheless, but it results in
a build error with BSD make.
At least under FreeBSD, vsnprintf() doesn't work with Unicode strings in
non-UTF-8 locales (but just returns EILSEQ), so set such locale before
using it.
Fix another bug in wxFileName::ReplaceHomeDir(): only replace the first
occurrence of the home directory, not all of them (or even the first one
if it appears in the middle of the string).
This is rare but can happen and the function behaved completely wrongly
in this case, so handle it explicitly.
Also disable the unit test when HOME has this value, as it assumes this
is not the case.
Check if we have glibc 2.12 before using pthread_setname_np() and fall
back on prctl(PR_SET_NAME) if we can use that.
Co-Authored-by: Lauri Nurmi <lanurmi@iki.fi>
Closes#22559.
Use this macro where possible and simplify the checks in a couple of
places where it isn't (because we're checking for an exact glibc
version).
No real changes.
On non-Linux-like systems the `_NL_*` symbols for retrieving localized
strings from a locale are typically not available, causing compile-time
errors.
We now check for Linux-like systems, and resort to accessing our own
language database otherwise.
Closes#22558.
CMake: Create a config file for use with find_package and use it for
building our own sample, as the config file has the advantage of working
with wx 3.2.0 too, unlike the existing FindwxWidgets.cmake.
See #22536.
This worked until 7e9afad53a (Add real support for monochrome bitmaps to
wxMSW, 2020-10-19) because we always created the DIB of the depth
matching the alpha presence, i.e. 32bpp only if alpha was used and 24bpp
otherwise, but since this change we can use different depths, and hence
different number of bytes per pixel, for the source and destination
pixel data and so need to account for it.
An alternative fix could be to still create 24bpp DIBs even when depth
of 32 is explicitly requested, as it was done before, but it's probably
better to respect the explicitly specified depth, even if, admittedly,
it's not really clear what, if any, effect does this have in practice.
See #22552.
Closes#22548.
These functions returned strings of wrong size, with some junk after the
end of the actual string, due to a confusion between the size of the
buffer in bytes used by the WinHTTP functions and the length of the
buffer in (wide) characters used by wxWCharBuffer.
Fix this and add a unit test checking that the expected header is
returned.
See #22549.
Closes#22181.
Make wxINVERT logical function work in at least some circumstances with
wxGTK3/X11 and use this to make wxSplitterWindow and wxSashWindow
separator visible during resizing.
See #22546.
Closes#16890.
HasAlpha() was already available in most of them, now ensure that it's
present in all of them, especially as it has a reasonable default
implementation.
UseAlpha() was only present in wxMSW and wxOSX and still remains only
implemented there, but provide at least a stub for it elsewhere as well
to avoid problems such as that of #17393.
See #22545.
Closes#17397.
If _NL_LOCALE_NAME is unavailable, set the locale name to some non-empty
string to make it at least somewhat useful -- and to avoid calling
InitLocaleNameAndCodeset() again and again.
Create a reusable function that can be used not only in
GetPreferredUILanguages() itself.
No real changes yet.
This commit is best viewed with Git --color-moved option.
We don't need to store this string, we don't need it after the ctor.
Also change the default value of an argument of wxString reference type
to be a wxString, not a const char*.
Don't attempt to optimize handling of the default and "C" locales as
this just results in bugs when using them and always use a valid
m_locale when extended locale support is available at all.
This symbol is not portable, so check for its availability before using
it.
Also avoid using wxLocaleIdent::GetName() uselessly if we're going to
overwrite it anyhow.
Use TempDefautLocaleSetter helper to change the locale if necessary and
just use our own m_locale if extended locale support is available. This
allows to reuse the existing GetLangInfo() function instead of
duplicating it here.
No real changes.
It doesn't seem necessary to always initialize them when the locale is
created, especially considering that this may have side effects if we
have to change the global locale to do it.
No real changes yet.
This commit is best viewed with Git --color-moved option.