Commit Graph

70478 Commits

Author SHA1 Message Date
Artur Wieczorek
20fc422550 Fix creating sub-bitmap of wxGraphicsBitmap (GDI+)
Retrieved sub-bitmap should have the same pixel format like
the source bitmap.
2021-02-05 23:53:28 +01:00
Artur Wieczorek
e73cb85246 Add tests of wxGraphicsBitmap 2021-02-05 23:52:29 +01:00
Artur Wieczorek
de7115b9ed Added missing references to some dynamically loaded Cairo API's 2021-02-05 23:05:50 +01:00
Artur Wieczorek
cda4e94a7b Add to ImageRGBMatcher ability to check alpha values in wxImage tests 2021-02-05 23:04:55 +01:00
Artur Wieczorek
c8a47a4313 Fix comparing wxImages in tests
Iterate through pixels instead of individual RGB components to report
proper coordinates of found mismatch.
2021-02-05 23:03:59 +01:00
Tobias Taschner
d17e8978a6 Make wxWebView::RunScript() const 2021-02-05 22:18:31 +01:00
Vadim Zeitlin
e88b55bfe1 Apply suggestions from code review 2021-02-05 22:18:30 +01:00
Tobias Taschner
d11ab7f751 Skip some unsupported tests with wxWebViewEdge 2021-02-05 22:18:30 +01:00
Tobias Taschner
2e94551f6f Clear string in wxJSON::DecodeString() to avoid unintentional appending 2021-02-05 22:18:30 +01:00
Tobias Taschner
788bef2cf2 Select Edge as the default backend on MSW
If enabled and available at runtime use the Edge backend.
This is probably more useful for most users.
2021-02-05 22:18:29 +01:00
Tobias Taschner
b351e7762d Move common wxWebView code to base class
Removes duplicate code in the various webview backends
2021-02-05 22:18:29 +01:00
Tobias Taschner
0d82348328 Add wxWebView::GetBackendVersionInfo()
Allows to get the WebView backend version if available
Currently implemented for IE, Edge and webkit2.
2021-02-05 22:18:28 +01:00
Tobias Taschner
489afb3336 Allow using a fixed version with wxWebViewEdge
A fixed version may be distributed with the application
and wxWebViewEdge::MSWSetBrowserExecutableDir() allows
it's usage with wxWebViewEdge.
2021-02-05 22:18:28 +01:00
Vadim Zeitlin
49fcd34335 Merge branch 'rerun-test-on-asan-failure'
Try to work around a spurious failure in ASAN builds on GitHub Actions.

See https://github.com/wxWidgets/wxWidgets/pull/2217
2021-02-05 21:38:42 +01:00
Vadim Zeitlin
a8d869f2c8 Merge branch 'docs/avoid-recommending-wxNewId' of https://github.com/catalinr/wxWidgets
Fixes for wxNewId() documentation.

See https://github.com/wxWidgets/wxWidgets/pull/2211
2021-02-05 21:38:16 +01:00
Vadim Zeitlin
b90cca5103 Fix ignoring docs changes in GitHub Actions CI builds
The path expression must match the full path, not just be its prefix.

Co-Authored-By: PB <PBfordev@gmail.com>
2021-02-05 21:35:51 +01:00
Vadim Zeitlin
211cde11d4 Rerun the test if LeakSanitizer crashed while running it
This crash (see https://github.com/google/sanitizers/issues/1353)
happens sporadically but regularly enough to be annoying, so try to work
around it by rerunning the test and hope that it doesn't happen twice in
a row.
2021-02-05 19:14:06 +01:00
Vadim Zeitlin
53ece3c2ed Don't use pushd/popd unnecessarily
Each step executes in its own shell, so it's not necessary to restore
the previous working directory and a simple "cd" would do just fine but,
in fact, we don't even need this as we can just set the working
directory at the step level.
2021-02-05 19:07:28 +01:00
Vadim Zeitlin
1aae6e26ca Remove useless echo from GitHub CI script
"Testing" is already shown as the step title.
2021-02-05 18:56:27 +01:00
Dan Gudmundsson
93160b9667 Make non-bundled apps work on recent macOS versions
Currently non-bundled apps don't work on Catalina and Big Sur and what's
worse is that old the code makes it impossible to make it work in user
code.

Remove the old workaround, and replace it with an alternative one, which
seems to work under all supported macOS versions and is also used by
Tcl/Tk.

Closes https://github.com/wxWidgets/wxWidgets/pull/2216
2021-02-05 18:02:25 +01:00
Gary Allen
f4172b0b46 Allow overriding wxMenu::MSWCommand() in wxMSW
This can be useful to implement custom handling of WM_COMMAND for the
popup menus, so make this function virtual and document it to indicate
that it is now part of the public API.

Closes https://github.com/wxWidgets/wxWidgets/pull/2170
2021-02-05 12:04:25 +01:00
Lauri Nurmi
232d1c1156 Feed sorted output to xargs when generating wxstd.pot
The `find' command isn't generally guaranteed to output filenames in
particular order, and without sorting, the resulting .pot from identical
input files could have its source line comment entries in different order
depending on what OS and filesystem it was generated on.

Co-authored-by: VZ <vz-github@zeitlins.org>
2021-02-05 00:50:33 +02:00
Lauri Nurmi
87c56c7c1d Do not sort content of generated POT files alphabetically
Sorting is discouraged even by the GNU gettext documentation:
https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html#Output-details

Alphabetical order means related messages that are close to each other
in a source file are likely to be far far away from each other in the .po
file that a translator works on.

Sorting was added in ea8849aaf6 (updated to use msgmerge, 2000-03-07)
2021-02-04 23:01:07 +02:00
catalinr
bfa4dd01d7 Link wxNewId() with wxRegisterId() in the docs 2021-02-03 12:20:07 +02:00
catalinr
baabb37f8f Avoid recommending deprecated wxNewId in the docs 2021-02-03 12:10:37 +02:00
Paul Cornett
a571ec6fbb Fix GTK wxPrinterDC gradient fill radius
All the other implementations use the rect width/height, not the diagonal
2021-02-02 10:16:42 -08:00
Paul Cornett
55b7198e92 Remove some run-time dependencies on X11 backend with GTK3
As with Wayland, the X11 backend may not be available at run-time,
so types defined in it can't be used
2021-02-02 10:15:35 -08:00
Lauri Nurmi
3514dda407 Fix compilation with curl <7.21.6 used under CentOS 6
According to cURL documentation, the CURLOPT_ACCEPT_ENCODING symbol
was called CURLOPT_ENCODING earlier.

Closes https://github.com/wxWidgets/wxWidgets/pull/2210
2021-02-02 13:03:06 +01:00
Vadim Zeitlin
56017bfffb Merge branch 'generic-dvc-multisel-fixes'
Fix selection handling by Left/Right key handlers in generic
wxDataViewCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/2207

Closes #19068.
2021-02-02 13:01:37 +01:00
Vadim Zeitlin
a81f91114b Make --disable-sys-libs configure option less drastic
Only disable using the system libraries when a built-in version is
available, otherwise still use the system library as this seems more
useful than disabling the use of only some system libraries (liblzma and
libcurl), while still possibly depending on dozens more via GTK.

Update the documentation and remove the now unnecessary --with-libcurl
from the CI script.

Closes https://github.com/wxWidgets/wxWidgets/pull/2208
2021-02-02 13:00:58 +01:00
Vadim Zeitlin
bbd0c52440 Fix Left/Right arrows in multi-selection generic wxDataViewCtrl
They didn't reset the existing selection when used without Shift and
didn't extend the selection when used with Shift.

Fix both of these problems by reusing the existing logic from
GoToRelativeRow() and, added in this commit, GoToRow() which was
extracted from GoToRelativeRow().

Closes #19068.
2021-02-01 17:28:34 +01:00
Vadim Zeitlin
dbfa1c206e Rename and better document OnVerticalNavigation() helper function
This is not an event handler itself, so it shouldn't use "On" prefix
which is reserved, by convention, for the event handlers.

It also doesn't need wxKeyEvent, but just wxKeyboardState, so change its
signature accordingly. This will notably allow to use it from mouse
event handlers too if necessary.

No real changes.
2021-02-01 17:28:34 +01:00
Hiroshi Takey F. (hiro2233)
a291e1c004 Fix a problem with wxGetDisplay() in wxGTK/MSW build
Only define wxGetDisplay() in Unix builds.

Closes https://github.com/wxWidgets/wxWidgets/pull/2206
2021-02-01 13:30:31 +01:00
PKEuS
98d3a4ccdc Enable standard-confirming new behaviour in MSVS 201x projects
Use /Zc:throwingNew option for the compilers supporting it instead of
defaulting to compatible behaviour, which assumes that operator new can
return NULL on allocation failure, that we don't need, at least in the
release builds.

This is also slightly more efficient as it allows the compiler to avoid
generating null checks after calling new.

Closes #19069.
2021-02-01 13:26:59 +01:00
Vadim Zeitlin
e7cd875ab0 Ignore changes to more files in GitHub CI workflow
Don't bother rebuilding everything when nothing important has changed.
2021-02-01 10:48:17 +01:00
Hiroshi Takey F. (hiro2233)
7e4865c7c1 Build fixes for OpenGL support in wxGTK with Wayland
Don't try using X-specific symbols when GDK_WINDOWING_X11 is off.

Closes https://github.com/wxWidgets/wxWidgets/pull/2191
2021-02-01 10:45:26 +01:00
Vadim Zeitlin
7856a385d1 Fix parallel build of the sample when using configure
Don't add both a directory and its subdirectories to SAMPLES_SUBDIRS as
this can result in 2 sub-makes building in the same directory in
parallel: one make process recursing into sub-subdirectory from the
subdirectory and another one running directly inside it. This notably
results in recurring failures in GitHub Actions CI builds.

We still need to create makefile.in in the subdirectories containing
other samples, so add a separate SAMPLES_SUBTREES variable and use it to
collect such directories, instead of putting them into SAMPLES_SUBDIRS
itself.
2021-02-01 10:43:24 +01:00
Paul Cornett
8d1ad482b6 Fix wxStatusBar size grip layout with GTK3 2021-01-31 21:11:42 -08:00
Paul Cornett
01223d6af2 Scrolling fixes for RTL layout with GTK3
Avoid some positioning hacks, they are not needed with GTK3
2021-01-31 21:06:18 -08:00
Paul Cornett
e85f89e522 Implement wxDC mirroring for RTL layout with GTK3
Co-Authored-By: AliKet <aliket1435@gmail.com>
2021-01-31 20:59:29 -08:00
Vadim Zeitlin
79779fec1c Correct test for MSYS2/Cygwin in AppVeyor script
There is no "compiler" environment variable, use TOOLSET instead.
2021-02-01 00:51:28 +01:00
Vadim Zeitlin
b016088493 Fix replacement in setup.h done in AppVeyor builds
We can't write to the file we're reading from, so use a temporary
variable.
2021-02-01 00:50:55 +01:00
Vadim Zeitlin
d1810b0dce Remove setup0.h files
Simplify things by putting setup.h files themselves under version
control and getting rid of setup0.h ones.

The initial motivation for using separate setup0.h files was to allow
having local changes to setup.h, but with Git there is a simple way to
do it by using "git update-index --skip-worktree include/wx/msw/setup.h"
for example, so we don't really need setup0.h any more and dropping them
makes things simpler.
2021-01-31 19:02:56 +01:00
Vadim Zeitlin
fd653c7ca8 Remove obsolete entries for ignored files under misc directory
There should be no such files there since literally decades, so remove
them from .gitignore.
2021-01-31 18:48:14 +01:00
Vadim Zeitlin
550bb1e2ce Merge branch 'github-ci-more-builds'
Move Linux CI builds from Travis CI to GitHub CI.

See https://github.com/wxWidgets/wxWidgets/pull/2204
2021-01-31 17:36:37 +01:00
Vadim Zeitlin
eb00c53f5a Remove Travis CI builds that now run on GitHub CI
There is no need to run essentially the same builds on two different
services.
2021-01-31 17:34:04 +01:00
Vadim Zeitlin
584494f3b5 Skip wxDataViewCtrl unit test when using ASAN with wxGTK
Somehow ASAN reports a memory leak in this test:

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7fc54732ebc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
    #1 0x7fc546685cb8 in g_malloc ../../../glib/gmem.c:102
    #2 0x7fc543a49b41 in _gtk_rbtree_new ../../../../gtk/gtkrbtree.c:333
    #3 0x7fc543b0831a in gtk_tree_view_real_expand_row ../../../../gtk/gtktreeview.c:12922
    #4 0x7fc543b1087a in gtk_tree_view_expand_row ../../../../gtk/gtktreeview.c:12983
    #5 0x7fc5453ba344 in wxDataViewCtrl::DoExpand(wxDataViewItem const&, bool) src/gtk/dataview.cpp:5013
    #6 0x7fc5458e5a0e in wxDataViewCtrlBase::ExpandAncestors(wxDataViewItem const&) src/common/datavcmn.cpp:1297
    #7 0x7fc5453bce08 in wxDataViewCtrl::SetSelections(wxDataViewItemArray const&) src/gtk/dataview.cpp:5228
    #8 0x5557834c5745 in test controls/dataviewctrltest.cpp:178
    #9 0x5557834d688c in invoke ../3rdparty/catch/include/internal/catch_test_registry.hpp:25
    #10 0x5557831434ef in Catch::TestCase::invoke() const ../3rdparty/catch/include/internal/catch_test_case_info.hpp:176
    #11 0x55578317f10f in Catch::RunContext::invokeActiveTestCase() (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1bc10f)
    #12 0x55578317e9dd in Catch::RunContext::runCurrentTest(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1bb9dd)
    #13 0x55578317b5cc in Catch::RunContext::runTest(Catch::TestCase const&) (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1b85cc)
    #14 0x55578313c64a in Catch::runTests(Catch::Ptr<Catch::Config> const&) ../3rdparty/catch/include/internal/../catch_session.hpp:82
    #15 0x555783180e05 in Catch::Session::runInternal() (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1bde05)
    #16 0x555783180931 in Catch::Session::run() (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1bd931)
    #17 0x555783180899 in Catch::Session::run(int, char const* const*) (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1bd899)
    #18 0x55578315719a in TestApp::RunTests() test.cpp:635
    #19 0x5557831a63c7 in TestApp::OnIdle(wxIdleEvent&) (/home/runner/work/wxWidgets/wxWidgets/tests/test_gui+0x1e33c7)
    #20 0x7fc5446bbbfe in wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const src/common/appbase.cpp:654
    #21 0x7fc5446bbdba in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const src/common/appbase.cpp:666
    #22 0x7fc5449b29dd in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) src/common/event.cpp:1416
    #23 0x7fc5449b47f4 in wxEvtHandler::SearchDynamicEventTable(wxEvent&) src/common/event.cpp:1888
    #24 0x7fc5449b32be in wxEvtHandler::TryHereOnly(wxEvent&) src/common/event.cpp:1609
    #25 0x7fc5449b70a7 in wxEvtHandler::TryBeforeAndHere(wxEvent&) include/wx/event.h:3949
    #26 0x7fc5449b2f72 in wxEvtHandler::ProcessEventLocally(wxEvent&) src/common/event.cpp:1546
    #27 0x7fc5449b2ec5 in wxEvtHandler::ProcessEvent(wxEvent&) src/common/event.cpp:1519
    #28 0x555783156ef7 in TestApp::ProcessEvent(wxEvent&) test.cpp:615
    #29 0x7fc5446badef in wxAppConsoleBase::ProcessIdle() src/common/appbase.cpp:431

but only if another wxDataViewCtrl test runs after it, i.e. there is no
leak when running just this test on its own.

This doesn't seem to make sense, as wxDataViewCtrl, and hence
GtkTreeView, is destroyed at the end of the test and it shouldn't be
possible for a test running later to affect the presence or absence of a
memory leak in it, so it might be a LeakSanitizer bug, but this doesn't
help actually getting rid of it.

The only other possibility would be to suppress this leak, but this
doesn't seem ideal, as we could suppress some other real leak too, so
for now just skip this test when using ASAN.
2021-01-31 17:33:13 +01:00
Vadim Zeitlin
ef1bf6df1f Disable fast unwind on malloc in ASAN builds
This makes things much, much slower, but unfortunately seems to be the
only way to avoid memory leak reports when running the tests as without
it the suppression is not used because the stack is truncated, i.e. we
only see

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f0968253bc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
    #1 0x7f09675aacb8 in g_malloc ../../../glib/gmem.c:102

in the output when the actual stack, seen with fast_unwind_on_malloc=0, is

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f12b913bbc8 in malloc (/lib/x86_64-linux-gnu/libasan.so.5+0x10dbc8)
    #1 0x7f12b8496cd8 in g_malloc ../../../glib/gmem.c:102
    #2 0x7f12b84b0f93 in g_strdup ../../../glib/gstrfuncs.c:363
    #3 0x7f12b49adb2a in atk_bridge_adaptor_init ../atk-adaptor/bridge.c:1039
    #4 0x7f12b566d753 in _gtk_accessibility_init ../../../../gtk/a11y/gtkaccessibility.c:992
    #5 0x7f12b5821cfc in default_display_notify_cb ../../../../gtk/gtkmain.c:714
    #6 0x7f12b5589801 in g_closure_invoke ../../../gobject/gclosure.c:810
    #7 0x7f12b559d813 in signal_emit_unlocked_R ../../../gobject/gsignal.c:3742
    #8 0x7f12b55a8b9d in g_signal_emit_valist ../../../gobject/gsignal.c:3498
    #9 0x7f12b55a90d2 in g_signal_emit ../../../gobject/gsignal.c:3554
    #10 0x7f12b558e283 in g_object_dispatch_properties_changed ../../../gobject/gobject.c:1206
    #11 0x7f12b55906f1 in g_object_notify_by_spec_internal ../../../gobject/gobject.c:1299
    #12 0x7f12b55906f1 in g_object_notify ../../../gobject/gobject.c:1347
    #13 0x7f12b5dbf54f in _gdk_display_manager_add_display ../../../../gdk/gdkdisplaymanager.c:479
    #14 0x7f12b5589a55 in _g_closure_invoke_va ../../../gobject/gclosure.c:873
    #15 0x7f12b55a8b27 in g_signal_emit_valist ../../../gobject/gsignal.c:3407
    #16 0x7f12b55a9b7b in g_signal_emit_by_name ../../../gobject/gsignal.c:3594
    #17 0x7f12b5ded21a in _gdk_x11_display_open ../../../../../gdk/x11/gdkdisplay-x11.c:1803
    #18 0x7f12b5dbf377 in gdk_display_manager_open_display ../../../../gdk/gdkdisplaymanager.c:462
    #19 0x7f12b5822f6a in gtk_init_check ../../../../gtk/gtkmain.c:1109
    #20 0x7f12b5822f6a in gtk_init_check ../../../../gtk/gtkmain.c:1101
    #21 0x7f12b6fd1dad in wxApp::Initialize(int&, wchar_t**)
    ...
2021-01-31 17:33:13 +01:00
Vadim Zeitlin
2aba3ad0e1 Ignore leak from atk_bridge_adaptor_init() when using ASAN
There doesn't seem to be any way to avoid calling it or freeing
(multiple) memory blocks allocated by it.
2021-01-31 17:33:04 +01:00
Vadim Zeitlin
0718f641f5 Install more debug symbols for ASAN builds
Install glib and gtk symbols which are required to get full information
from the LeakSanitizer stack traces.
2021-01-31 17:32:34 +01:00