Commit Graph

73445 Commits

Author SHA1 Message Date
Vadim Zeitlin
7649d4cb72 Replace macOS 10.15 runners with macOS 11 ones
10.15 is being phased out by GitHub, so switch to the still supported
runner platform version.

Closes #22698.

(cherry picked from commit 4e26568f9727936d3c84b1f3689086f07ff71878)
2023-05-06 18:54:17 +02:00
Vadim Zeitlin
68392f8a43 Avoid deprecation warnings for gha-setup-vsdevenv action
Switch to a local fork of the action using node 16 and latest
actions/core package as both are necessary to avoid getting deprecation
warnings.

(cherry picked from commit f044e5cab348d687c81d905949b9c6c9f2ce9422)
2023-05-06 18:53:43 +02:00
Vadim Zeitlin
d57fe1e562 Fix editing cells without values in wxGTK wxDataViewCtrl
Do not hide cells without values at GTK level, as this makes them not
only appear as blank (which is fine), but also prevents them from being
edited, which is not, as the user should be able to enter values into
the previously empty cells.

This fixes regression introduced back in 74e1c444fa (Don't show bogus
value when there are none in wxGTK wxDVC neither, 2021-12-01).

Note that this also undoes the changes of 8aefedcb45 (Remove duplicated
HasValue() call from wxGTK wxDataViewCtrl code, 2022-05-08) and
HasValue() is called twice again now, but this is less of a problem than
wrong behaviour fixed by this commit and we can address it later, e.g.
by passing the cell value to PrepareForItem() instead of retrieving it
inside it, if it turns out to be really worth it.

See #23523.

(cherry picked from commit 821c2a07fe2b29c283e11f25b184e3d6d9a17013)
2023-05-05 15:27:27 +02:00
Lauri Nurmi
285c49bf8a Support wxDP_DROPDOWN mode for native date pickers on macOS
According to Apple's documentation, the presentsCalendarOverlay property
is supported in macOS 10.15.4 and later.

See #23520.

(cherry picked from commit 9f94f4069c51023ddd215bee5a62046e0183f5df)
2023-05-05 15:26:33 +02:00
Vadim Zeitlin
8fca356094 Fix wxProtocolError::ReadLine() if the socket was closed
Don't hang forever in this case but just return an error immediately.

This notably fixes hanging in wxFTP::GetFilesList() as the socket it
used for retrieving the list of files was always closed by the server
after sending the full list, but we kept trying reading from it.

See #23519, #23521.

(cherry picked from commit c1a27f3beb4b9b37ef237a7db860f9a056442377)
2023-05-05 15:25:27 +02:00
Vadim Zeitlin
89dc204bb6 Merge branch '3.2-fix-ansi' into 3.2
Fix non-Unicode build and add a CI workflow testing it.

See #23515.
2023-05-04 20:59:51 +02:00
Vadim Zeitlin
a5cfd0ed4d Skip wxListCtrl column drag test in wxMSW non-Unicode build
This probably indicates a real problem in wxMSW, but it's not worth
spending time on fixing it in non-Unicode build, so just disable the
test.
2023-05-04 19:06:12 +02:00
Vadim Zeitlin
29f55f4e29 Disable wxMenu unit test requiring Unicode in non-Unicode build
Japanese translations can't be used without Unicode support, so skip
this test.
2023-05-04 18:46:42 +02:00
Vadim Zeitlin
e9a0f96498 Don't run regex unit tests in non-Unicode build
These tests rely on Unicode support and fail without it.
2023-05-04 18:36:24 +02:00
Vadim Zeitlin
7a8331c11f Skip tests failing without Unicode in string unit test
There might be a bug somewhere here, but as long as it affects
non-Unicode build only, it's not worth spending time on.
2023-05-04 18:36:24 +02:00
Vadim Zeitlin
0c23908f13 Avoid harmless unused parameter warning in non-Unicode build
Suppress a warning about another unused parameter in formatting unit
test.
2023-05-04 01:22:07 +02:00
Vadim Zeitlin
9c1fa393b0 Make wxGCC_ONLY_WARNING_SUPPRESS really gcc-specific
This macro was still used with clang because it also predefines
__GNUC__, contradicting its name and purpose, as it was always identical
to just wxGCC_WARNING_SUPPRESS.

Only make it do something for gcc now and nothing for clang.

(cherry picked from commit 44dfad47e2768447950baa544ee1a464a723cd5f)
2023-05-04 01:14:58 +02:00
Vadim Zeitlin
5279c62df5 Avoid -Wsuggest-override warnings for 2.8-compatible functions
This avoids warnings during allheaders test build with 2.8 compatibility
enabled.
2023-05-04 00:50:31 +02:00
Vadim Zeitlin
601b4f47cc Suppress -Wsuggest-attribute=format in non-Unicode build
This avoids warnings during allheaders test compilation.
2023-05-04 00:50:03 +02:00
Vadim Zeitlin
f5cccfedec Avoid ambiguity with the deprecated wxToolBar::AddTool() overload
Remove the default value for the "toggle" argument of the deprecated
AddTool() overload to ensure that code calling AddTool() with just the
ID, label and bitmap compiles even with WXWIN_COMPATIBILITY_2_8 defined.

This fixes building wrapsizer sample in this build.
2023-05-03 23:02:35 +02:00
Vadim Zeitlin
5c239e13f1 Fix wxRegKey compilation in ANSI build too
Fixing it in UTF-8 build in 52e5561ca5 (Fix wxRegKey compilation in
UTF-8 build, 2023-03-24) broke it in ANSI build, fix it too now by using
wxChar instead of always using wchar_t.
2023-05-03 22:28:01 +02:00
Vadim Zeitlin
cc46425f9f Fix non-Unicode wxMSW build after command line arguments fixes
The changes of d979a7f0d8 (Fix memory leak of command line arguments in
wxMSW, 2022-12-26) broke compilation with wxUSE_UNICODE==0 as they were
backported from master where this case isn't possible any more.

Adjust these changes to work in non-Unicode build too.

See #23082, #23516.
2023-05-03 22:10:27 +02:00
Vadim Zeitlin
38c4b48509 Test non-Unicode wxMSW build in CI workflow
This build is the one which risks getting broken the most as it's so
little used, so we must have a test for it in the CI.

Also enable 2.8 compatibility for it under assumption that people
disabling Unicode support must be working with legacy code bases.
2023-05-03 21:51:02 +02:00
Kvaz1r
9ce34a1d8f Fix showing hint in wxUniv wxTextCtrl
Correctly remove the hint when the text control is focused.

See #23511.

(cherry picked from commit 79fa753641c65019383c526ed641a7830b851daf)
2023-05-02 19:00:47 +02:00
Vadim Zeitlin
5d0a77cb59 Disable bogus gcc 13 warnings in Scintilla SplitVector
There doesn't seem anything we can do about them simply and this code
was already completely changed in the version used in master, so just
suppress them.

See #23505.
2023-05-02 18:59:50 +02:00
Vadim Zeitlin
6fdc9e42f5 Simplify wxKeyEvent generation in wxGTK a bit
Try to make the code generating key events a bit more clear and also
avoid duplicating the checks in AdjustCharEventKeyCodes() by returning
true from this function if the key code passed them.

This shouldn't result in any real changes in behaviour.

See #23452.

(cherry picked from commit 1506d46a1dc4aead2f7bc3b2fda94c3ca648047e)
2023-04-30 15:21:43 +02:00
Vadim Zeitlin
9ce295f42b Improve code in gtk_window_key_press_callback()
Don't use isalpha() in it as this was potentially incorrect, both
because the key code could be not in the supported range and because
isalpha() might return unexpected result in non C locale, and also
inconsistent with AdjustCharEventKeyCodes().

Just check that the code is in a..z or A..Z range explicitly instead.

See #23379.

(cherry picked from commit 4799785b6dfc2d4490598b447c99435105b8ebba)
2023-04-30 15:21:43 +02:00
Ivan Sorokin
87ae8d5aa7 Fix wxKeyEvent::GetKeyCode() for non-US keyboard layouts
Use the key code corresponding to the key in the US keyboard layout for
the key down/up events even when not actually using US layout, as this
is much more useful than simply returning 0 as was done before.

It also is compatible with the behaviour of the other ports.

See #17643, #23379, #23410.

(cherry picked from commit 2c0f6a2aa0c8d0650d1f856aa279ce7495925c17)
2023-04-30 15:21:43 +02:00
Vadim Zeitlin
171369203f Miscellaneous fixes for WebKit2 wxWebView backend
See #23497.

(cherry picked from commit 8d8f94da641fc95a6d5203276fa2e26abb42e9fc)
2023-04-28 16:41:29 +02:00
Kumazuma
a34e5505ef Fix discrepancy between using GDI and Direct2D in high DPI
Set DPI to 96 in RenderTargetProperties when creating HwndRenderTarget
to prevent pixel scaling.

If the value is set to zero, Direct2D sets the HwndRenderTarget's DPI to
match the window's DPI.

When the DPI of the ID2D1RenderTarget is not set to 96, Direct2D
performs pixel scaling.

See #23486, #23496.

(cherry picked from commit 3a18b6ba184049485c3cf21f3bbaf4a96d53c600)
2023-04-28 16:38:48 +02:00
Vadim Zeitlin
d19acd5e11 Fix for wxLocale breaking Unicode string formatting under macOS
See #23454.

(cherry picked from commit 85e88d6af31a3bb1766503ca364f7bc1ac6573a8)
2023-04-28 15:11:25 +02:00
Dan Gudmundsson
867c720a4e Improve and document wxGLCanvas::CreateSurface()
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.

(cherry picked from commit 23ccdb23c84b6b3de74d1cd83c83d7ad01431725)
2023-04-28 15:08:35 +02:00
Khalyutin
8296145840 Fix building wxScintilla with LLVM clang under MSW
Include stdint.h and not stddef.h when using clang masquerading as MSVC.

See #23464.

Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
2023-04-20 15:46:48 +02:00
Maarten Bent
ee3f10cc00 Fix runtime exception when running application compiled with clang on Windows
It gives the following error:
The application has failed to start because its side-by-side configuration is incorrect

Fix this by specifying the xml namespace. Examples on the Microsoft website use v2, so change this too.

(cherry picked from commit eaab67dee12c72f80e2a79658be3e98619edac9c)
2023-04-20 15:39:08 +02:00
Khalyutin
ac2d5fd2a7 Fix wrong codepoint in rc file with llvm-rc
(cherry picked from commit 7b5a01d97152b6ddcd81269765131f668ddc82b5)
2023-04-20 15:39:08 +02:00
Vadim Zeitlin
8094ed5795 Correct wxDC::GetContentScaleFactor() documentation
Document that it returns the same value as GetDPIScaleFactor() wxWindow
method and _not_ the wxWindow method with the same name.

This is very confusing, but there doesn't seem to be anything to be done
about it by now.

See #23441.

Closes #23469.

(cherry picked from commit 5e7b08f9ea996fcb9e718b8dd0a5eb01b6d2e6e3)
2023-04-20 15:36:43 +02:00
Ian McInerney
1f0d84b307 Replace gtk_combo_box_text_insert_text with direct model insertion
There is a lot of overhead in the gtk_combo_box_text_insert_text
function, so adding a lot of items to a choicebox can be an expensive
operation when it is used. Instead directly access the underlying data
model and add the items to it.

Experiments show that for adding 10000 items to a wxChoice, the amount
of time spent in wxChoice::DoInsertItems for each method are:
    gtk_combo_box_text_insert_text: 6.75s
    gtk_list_store_insert_with_values: 438.2ms

(cherry picked from commit 983608c0f24bae47d7ef164a10e00baba6c66438)

See #23443.
2023-04-12 19:37:51 +02:00
utelle
4d584bd848 Fix information for some languages in the language database
Correct description and writing direction for a few languages.

This is the part of c8d2244c63 (Update language database and fix some
problems in it, 2023-04-07) from master which fixes the existing data,
without adding new languages.

See #23419.

Closes #23430.
2023-04-08 14:51:04 +02:00
Brian Nixon
5150c1a1bd Fix wxUILocale::GetPreferredUILanguages() under Windows < 10
Return the default locale name under old Windows versions instead of
always returning an empty vector and logging a spurious error.

See #23416.

(cherry picked from commit a242283456ffd0920a2384f6fee45d56a7ecc3a5)
2023-04-04 17:21:07 +02:00
PB
148cafdcd0 Fix memory leak in the art provider sample
The list client data must be destroyed not only when closing the
resource browser dialog (see 754f75c1cd (Fix memory leaks in artprov
sample, 2022-01-28) but also whenever the art client is changed.

See #23417, #23418.

(cherry picked from commit 02cba46643a5988db1b0e803e18e2dc1a55d1d21)
2023-04-04 17:18:33 +02:00
Scott Talbert
ca4db68006 CI: ignore CircleCI config files from all other CIs
Avoid spurious rebuilds when modifying CircleCI config files.

See #23405.

(cherry picked from commit 04326551fd05fcc97b77ff954501e871f3e8c1c5)
2023-04-04 17:18:02 +02:00
Vadim Zeitlin
ecc0b2fde3 Fix handling non-ASCII format strings in UTF-8 build
Constructing wxString from "char*" format string was wrong as it
interpreted it in the current locale encoding which could be different
from UTF-8.

(cherry picked from commit 5a9e433524020dc6b653183bdd338bb3647902a9)
2023-03-30 23:25:07 +02:00
Vadim Zeitlin
2c2d9fd909 Fix recognizing locales using UTF-8 charset
Do not assume that C locale uses UTF-8, as this is simply not true and
none of the CRT functions handle UTF-8 correctly with this locale.

Do recognize locales explicitly using UTF-8 charset as being in UTF-8.
On most Unix systems (including Linux), it didn't really matter that we
didn't do it, because we used nl_langinfo() there, but it does matter a
lot with MSVC under MSW whose CRT supports UTF-8 now, but UTF-8
functions were not used there -- do use them now.

(cherry picked from commit a1d289fe3ea74aa1c713e0f02f5fd5f83810af58)
2023-03-30 23:25:07 +02:00
Vadim Zeitlin
759331e839 Don't assert when using "%s" with invalid char in UTF-8 build
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.

(cherry picked from commit f9c109957ed286e12bc15e93f9a8da0a7b78f7f1)
2023-03-30 23:25:07 +02:00
Vadim Zeitlin
d0dd8f2af8 Fix another surrogate-related bug in UTF-8 build in wxString
This is similar to the fix in the previous commit and is needed for the
same reason.

(cherry picked from commit fab541a8ff8e62914c6dee905558ec3270d51432)
2023-03-30 23:25:07 +02:00
Vadim Zeitlin
270c0863b7 Fix using wxStringOutputStream with surrogates in UTF-8 build
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.

(cherry picked from commit aea45196ab8225e54df1828699b44b31ba48ecb9)
2023-03-30 23:25:07 +02:00
Vadim Zeitlin
90b42b9ebb Fix wxRegKey compilation in UTF-8 build
Use a macro to return a valid pointer to a wide string even in UTF-8
build, where we don't have a permanent wchar_t buffer to return a
pointer to.

(cherry picked from commit 52e5561ca539da3ce467996c7bb9b038229acb98)
2023-03-30 20:00:21 +02:00
Ian Day
2aac6d611f Fix dereferencing invalid iterator in wxString in UTF-8 build
Fix iterator going past end of string in PosLenToImpl, it can't become
end() as the end iterator can't be dereferenced.

See #23305.

(cherry picked from commit 73ad17db4ec9a48e64ed40f5020918ec9a05a8a5)
2023-03-30 19:59:20 +02:00
Vadim Zeitlin
365bea9b07 Don't try using -mthreads with clang
This option is useless with it and is, at best, ignored or, at worst,
results in errors if it happens to be used together with -Werror,
-Wunused-command-line-argument

See #23314.

Closes #23317.
2023-03-30 19:54:19 +02:00
Vadim Zeitlin
aae05406e6 Extend wxWebView test hack to all the builds
The first unit test using wxWebView sometimes fails in other builds too,
so try using the same hack as was previously used for the clang build
for them as well.

(cherry picked from commit 3ac39970b1e9c30c5d339d8a03d19d1d4fba504d)
2023-03-29 19:56:26 +02:00
Vadim Zeitlin
f9befcc720 Fix using Wine in wxMSW cross-CI workflow
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.

(cherry picked from commit 28e0a7e01debf01e8f42524b6071714b7778c6c6)
2023-03-29 13:28:04 +02:00
Maarten Bent
e1d8bc89ba CMake: Add libraries of imported targets to wx-config
Use the LOCATION_DEBUG or LOCATION_RELEASE property of an imported target (like NanoSVG)
to determine the full library path.

See #23373, #23390.

(cherry picked from commit 81029586653c662d7a6bff3cc2e0e45e417cb248)
2023-03-29 13:27:03 +02:00
Felipe
9d9aa581a6 Update Brazilian Portuguese translations for 3.2.2
(cherry picked from commit c989d3973edf54e1e00d5d00cd0a810f79b3df19)
2023-03-29 12:32:23 +02:00
Stefan Csomor
1a34b760ab Fix memory leak with extra controls in wxFileDialog on OSX
See #22173, #23304, #23376.

(cherry picked from commit da9aab645ec3e6e9a42fcb6c907ac96c633c3c05)
2023-03-29 12:30:40 +02:00
Vadim Zeitlin
6db3dba712 Don't reset wxToolBar colour on system colours change in wxMSW
If the toolbar colour had been changed from default, leave it set
instead of overwriting it with the new COLOR_BTNFACE value on system
colours change.

See #23386.

(cherry picked from commit 8cf1e75750ee01f11ce8b8c2667876a76dfdfcbb)
2023-03-29 12:29:08 +02:00