Commit graph

73103 commits

Author SHA1 Message Date
Vadim Zeitlin
f0ea00cd35 Let application determine TLW size after DPI change
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.
2022-06-24 02:49:34 +01:00
Vadim Zeitlin
b66e63e217 Fix windows becoming smaller than best size on DPI change
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.
2022-06-24 02:47:58 +01:00
Vadim Zeitlin
7497d14262 Remove the apparently unnecessary check for DPI really changing
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.
2022-06-24 00:29:55 +01:00
Vadim Zeitlin
fd68c13be3 Disable wxWebRequest tests in FreeBSD CI due to pip problems
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.
2022-06-23 23:22:49 +01:00
Vadim Zeitlin
1e98f517b0 Add configuration file for Cirrus CI to test under FreeBSD
Add a single wxGTK3 build only so far.
2022-06-23 23:22:49 +01:00
Vadim Zeitlin
8666131acf Remove inexistent USE_HELP.html from samples/help makefile
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.
2022-06-23 22:41:09 +01:00
Vadim Zeitlin
8c5df4b485 Use UTF-8 locale in Unicode formatting test
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.
2022-06-23 21:15:58 +01:00
Vadim Zeitlin
a9d3ef2539 Fix date/time format unit test under FreeBSD
Expect French date/time formats actually used there (at least under
French 13), as they're different from the ones used by glibc under
Linux.
2022-06-23 21:15:58 +01:00
Vadim Zeitlin
cffbea5a0f Don't replace multiple HOME occurrences
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).
2022-06-23 21:15:58 +01:00
Vadim Zeitlin
96a917eaa8 Fix wxFileName::ReplaceHomeDir() when HOME=="/"
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.
2022-06-23 21:15:58 +01:00
Yuri Chornoivan
62d604747e Update Ukrainian translations for 3.2.0 2022-06-23 21:14:04 +02:00
Vadim Zeitlin
5333897535 Fix compilation of wxThread::SetNameForCurrent() with older glibc
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.
2022-06-23 19:01:18 +02:00
Vadim Zeitlin
d74a4ea30d Add wxCHECK_GLIBC_VERSION() and cleanup glibc version checks
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.
2022-06-23 19:01:18 +02:00
Vadim Zeitlin
231c079c70 Install build dependencies for FreeBSD too
So far do it for GTK 3 only.
2022-06-23 15:27:19 +01:00
Vadim Zeitlin
a1f29366f0 Detect the number of CPUs under FreeBSD too
This is under done using exactly the same command as under macOS,
unsurprisingly.
2022-06-23 15:26:36 +01:00
Paul Cornett
bf6fe7f949 Fix Cairo version check
The intention was to check for 1.10, not 1.12
2022-06-22 08:01:06 -07:00
Vadim Zeitlin
ae0e4c6942 Merge branch 'update-version-3.2'
Update version to 3.2.

See #22527.
2022-06-21 23:09:48 +02:00
Vadim Zeitlin
d07d89bc6c Only use CAIRO_OPERATOR_DIFFERENCE with Cairo >= 1.10
This operator was only added in this version, so at least avoid build
errors when using older Cairo versions.
2022-06-21 23:09:12 +02:00
Ulrich Telle
d8e82946a6 Fix wxUILocaleImplUnix::GetLocalizedName() on non-Linux systems
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.
2022-06-21 14:26:50 +02:00
Lauri Nurmi
d2094440e4 Silence warnings about unused variables on SunOS
No real changes.

Closes #22556.
2022-06-21 14:24:45 +02:00
Vadim Zeitlin
1f32fe4d3b Avoid using TAB for indent in a HOWTO 2022-06-21 00:55:30 +02:00
Vadim Zeitlin
cb7cefcc87 Update the required wx versions in the sample CMakefile
Also add this file to the list of files to update.
2022-06-21 00:55:25 +02:00
Vadim Zeitlin
2a2308d5ed Update version to 3.2.0 and rebake and rerun autoconf
Update all make/project files to use 3.2.0.
2022-06-21 00:54:26 +02:00
Vadim Zeitlin
03293ae8e2 Update release documents for 3.2.0
The main change is that it's now described as the new stable release and
not a development one any more.
2022-06-21 00:54:26 +02:00
Vadim Zeitlin
434f9647dc Add change log for 3.2.0
List the changes directly instead of using Git notes for them under the
optimistic assumption that there won't be that many changes.
2022-06-21 00:54:26 +02:00
Vadim Zeitlin
b20d69685a Merge branch 'cmake-config-file' of github.com:MaartenBent/wxWidgets
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.
2022-06-21 00:07:11 +02:00
Vadim Zeitlin
c639226543 Merge branch 'dvc-model-simplify'
Simplify defining classes inheriting from wxDataViewModel.

See #22553.

Closes #17755.
2022-06-20 00:42:54 +02:00
Vadim Zeitlin
c92e746f66 Fix creating wxBitmap of depth 32 but without real alpha in wxMSW
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.
2022-06-20 00:42:21 +02:00
Vadim Zeitlin
b3b5c8a670 Fix wxWebResponse::GetHeader() and GetURL() in wxMSW
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.
2022-06-20 00:41:13 +02:00
Vadim Zeitlin
8872a77d66 Merge branch 'splitter-invisible-sash'
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.
2022-06-20 00:38:55 +02:00
Vadim Zeitlin
171f9ab8f4 Make wxBitmap::HasAlpha() and UseAlpha() available in all ports
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.
2022-06-20 00:38:09 +02:00
Randalphwa
09b2488577 Add support for empty call size to wxGridBagSizer XRC handler
Add empty_cellsize property.

Closes #22541.
2022-06-20 00:36:47 +02:00
Randalphwa
a0bdcc0d0f Support additional wxWizard properties in XRC
Add support for border, bitmap placement, minimum width and background.

Closes #22539.
2022-06-20 00:35:32 +02:00
Vadim Zeitlin
237f0c640e Merge branch 'unix-default-locale-fixes'
Fix handling of wxLANGUAGE_DEFAULT and other improvements in Unix
wxUILocale implementation.

See #22538.

Closes #22526.
2022-06-20 00:33:55 +02:00
Martin Srebotnjak
8e5dd5baa9 Update Slovenian translations for 3.2.0 2022-06-19 22:31:10 +02:00
James Pan
d24b6e6db6 Make zh_TW translations more consistent with zh_CN ones 2022-06-19 22:29:20 +02:00
Vadim Zeitlin
a7c09c0c3d Get default locale name from environment as a fallback
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.
2022-06-19 22:23:10 +02:00
Vadim Zeitlin
3a94ba6b1f Refactor: extract existing code into GetLocaleFromEnvironment()
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.
2022-06-19 22:22:08 +02:00
Vadim Zeitlin
fe88494966 Remove unnecessary TempLocaleSetter::m_localeId
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*.
2022-06-19 22:00:54 +02:00
Vadim Zeitlin
db588c53f2 Rename TempDefautLocaleSetter to TempLocaleSetter
Now that this class can be used to switch to any locale, having
"Default" in its name is not really appropriate any more.
2022-06-19 21:56:41 +02:00
Ulrich Telle
959b300fc0
Fix CI build error Ubuntu 18.04 wxGTK 3 with clang 2022-06-19 20:00:22 +02:00
Ulrich Telle
443c2f4339
Configure TempDefautLocaleSetter
If `locale_t` support is not available, set temporarily the locale using the locale name of this instance.
2022-06-19 13:05:45 +02:00
Ulrich Telle
e0e34fcb1f
Make TempDefaultLocaleSetter configurable
If `locale_t` support is not available, it is necessary to be able to temporarily set a specific locale, not only the default user locale.
2022-06-19 12:44:56 +02:00
Vadim Zeitlin
e0319a9dfb Always use a valid locale_t in wxUILocaleImplUnix
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.
2022-06-19 03:13:57 +02:00
Vadim Zeitlin
21945f95fc Check that _NL_LOCALE_NAME is available before using it
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.
2022-06-19 03:02:56 +02:00
Vadim Zeitlin
f1402c2fcd Simplify wxUILocaleImplUnix::InitLocaleNameAndCodeset()
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.
2022-06-19 03:00:08 +02:00
Vadim Zeitlin
37c7e2e96c Create helper TempDefautLocaleSetter class
Extract the existing code for temporarily changing the global locale
into a reusable class.

No real changes.
2022-06-19 02:58:47 +02:00
Vadim Zeitlin
1dc1e7c20e Improve inexact comment describing wxUILocaleImplUnix::m_locale
It is null not only for the default locale (i.e. the one inherited from
the environment) but also for the "C" locale when it's created
explicitly.
2022-06-19 02:37:16 +02:00
Vadim Zeitlin
20510987f9 Initialize wxUILocaleImplUnix name and codeset on demand
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.
2022-06-19 02:30:27 +02:00
Vadim Zeitlin
aedd4ca847 Add a test for wxLocale::IsAvailable(wxLANGUAGE_DEFAULT)
This must always returns true.
2022-06-19 02:13:48 +02:00