Commit Graph

71396 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
a1dd894c77 Merge branch 'appveyor-webrequest' of https://github.com/MaartenBent/wxWidgets
Fix bug in wxWebRequest data upload code in WinHTTP implementation.

See https://github.com/wxWidgets/wxWidgets/pull/2199
2021-01-31 14:08:48 +01:00
Vadim Zeitlin
4da635e2dc Simplify WaitForPaint::YieldUntilPainted()
Don't return anything from it, just warn directly -- this is what all
the existing callers did, so it's simpler if the function just does it
itself instead of forcing them to check its return value.

Also reset m_painted after yielding, so that YieldUntilPainted() could
be called again, if necessary.
2021-01-31 01:33:30 +01:00
Vadim Zeitlin
e0a927af94 Wait for wxDataViewCtrl relayout under GTK in the unit test
A single wxYield() doesn't seem to be enough, at least not when running
in GitHub Actions environment, so wait for a longer time.
2021-01-31 01:33:30 +01:00
Vadim Zeitlin
367930f57d Fix setting LSAN_OPTIONS
Export them in the step running the test, not when configuring.
2021-01-31 01:33:30 +01:00
Vadim Zeitlin
07dfc18cc0 Disable wxWebView in ASAN CI build
Running wxWebView tests with ASAN results in "ASan runtime does not come
first in initial library list" warnings and doesn't work currently, so
disable wxWebView in this build for now to have a chance of passing the
tests.

It would be better to actually fix this, of course, but this will have
to wait until later.
2021-01-31 00:11:07 +01:00
Vadim Zeitlin
fd3897c2ab Enable GUI tests for the selected builds 2021-01-30 23:16:06 +01:00
Vadim Zeitlin
f2188be471 Recognize GitHub Actions as a CI environment in the test
This is necessary to activate the existing workarounds in the GUI tests.
2021-01-30 23:16:06 +01:00
Vadim Zeitlin
bde95c388c Fix linking of the GUI test when using static libraries
We need to explicitly link with the system libraries required in this
case, as static wxwebview library doesn't pull them in (it's also better
to link with them explicitly even when using shared libraries, but in
this case linking at least still worked due to transitive dependencies).
2021-01-30 22:49:24 +01:00
Vadim Zeitlin
29030d0c05 Reformat the job names
Try to make them appear more consistently in the Actions UI.

No real changes.
2021-01-30 22:40:10 +01:00
Maarten Bent
53a05f431f Set bytes written in callback in wxWebRequestWinHTTP 2021-01-30 22:14:19 +01:00
Maarten Bent
71a64f1d20 Get pointer to write buffer only once in wxWebRequestWinHTTP 2021-01-30 22:14:19 +01:00
Maarten Bent
6082dd9eb1 Show all wxWebRequest error descriptions in test output 2021-01-30 22:14:19 +01:00
Vadim Zeitlin
bc8f766b04 Add other Linux builds using configure to GitHub Actions CI
This is almost, although not quite, the same as we do in .travis.yml.

Note that CMake builds are not supported here yet.
2021-01-30 21:42:28 +01:00
Vadim Zeitlin
9e3079a695 Define wxUSE_XVFB for GitHub CI builds too
This is used in the test code to determine whether it's running under
Xvfb.
2021-01-30 21:42:28 +01:00
Vadim Zeitlin
ce5f135141 Fix allow_warnings check
We should disallow warnings when this flag is not defined, not when it
is.
2021-01-30 21:42:28 +01:00
Vadim Zeitlin
21fc248799 Use GTK 3 by default
Don't require defining gtk_version for all matrix elements neither.
2021-01-30 21:42:28 +01:00
Vadim Zeitlin
c58dc66056 Assume gcc compiler by default
Don't require defining gcc key in all matrix elements.
2021-01-30 21:42:28 +01:00
Vadim Zeitlin
7cba593a85 Fix ignoring paths for the GitHub CI builds
This was broken in 52d63eedd2 (Don't rerun CI builds for docs-only
changes, 2021-01-28) and no builds were run at all as the result.
2021-01-30 21:42:28 +01:00
Vadim Zeitlin
0d04792116 Show full text in single line MSW wxTextCtrl if possible
A single line MSW wxTextCtrl created with a value too long to fit into
it continued showing the value only partially even if its size was
subsequently increased to allow the entire value to be shown.

This apparently happens because changing the native EDIT control size
doesn't affect its (horizontal) scroll offset. Moreover, there doesn't
seem to be any way to explicitly tell the control to update it neither,
except for changing its text.

So do change its text every time its width changes, as long as it is not
visible (because visible jumps in the visible text position could be an
even worse problem than the one we're trying to solve here). This fixes
the originally reported bug at the cost of a bunch of extra calls to
DoWriteText() which should hopefully be not too expensive for single
line controls that don't typically contain that much text.

Closes #18268.
2021-01-30 20:43:14 +01:00
Vadim Zeitlin
247bb98d07 Generate Enter/Tab events even in readonly MSW wxTextCtrl
Respect wxTE_PROCESS_TAB and wxTE_PROCESS_ENTER flags even for readonly
text controls. Previously there were ignored for them due to the changes
of 080c709f70 (fix for handling TAB presses in readonly text controls,
2002-09-07), but there doesn't seem to be any good reason to do this, so
revert the changes of that commit by removing IsEditable() check from
our WM_GETDLGCODE handler.

We also need to avoid inserting TABs into readonly controls ourselves in
the default wxEVT_CHAR handler, so add a check for IsEditable() there to
compensate for the fact that these events are now received even for the
readonly controls.

This commit is best viewed ignoring whitespace-only changes.

Closes #19064.
2021-01-30 20:42:52 +01:00
Václav Slavík
8e80941183 Make refcounting actually work in wxFileSystemWatcher::Add()
The order of refcounting operations should be the opposite of what it
was: first check if the path is not watched already and only if it is
not call m_service->Add() to actually watch it. (Previously reference
count was kept track of, but m_service->Add() was always called, i.e.
the calls were repeated and unbalanced with Remove() calls.)

Remove() already has the correct order and only calls
m_service->Remove() when the path's refcount reaches zero.

This fixes a problem which was there since the original code was added
back in 76cfd1bf95 (Make wxFileSystemWatcher watch entries
reference-counted., 2012-10-15).

Closes https://github.com/wxWidgets/wxWidgets/pull/2203
2021-01-30 20:40:45 +01:00
Jouk
c65d5110aa update OpenVMS makefiles for credential dialog 2021-01-29 08:51:11 +01:00
Vadim Zeitlin
68a824da3c Fix using gethostbyxxx_r() with newer Android NDK
This might break using it with the older versions, but it's not clear
whether we still need to support them, so for now apply the simplest fix
which works with the recent NDK and we'll add configure tests later if
we really need them.

See https://github.com/wxWidgets/wxWidgets/pull/2195
2021-01-28 22:08:35 +01:00
Artur Wieczorek
914cc63d32 Fix navigating through wxPropertyGrid with wxPG_ACTION_EDIT
wxPG_ACTION_EDIT should not be considered done when wxPGProperty is
not editable (i.e. is disabled, read-only, is a wxPropertyCategory)
to prevent from blocking secondary actions (like
wxPG_ACTION_NEXT_PROPERTY) in this case.

Closes #19060.
2021-01-28 19:13:09 +01:00
Vadim Zeitlin
e7206701c5 Merge branch 'github-ci-test-webrequest'
Run wxWebRequest tests in the GitHub CI builds.

See https://github.com/wxWidgets/wxWidgets/pull/2197
2021-01-28 17:35:03 +01:00
Tobias Taschner
7532f93f7e macOS: Fix WebView print hang
At least under macOS 11 calling just runOperation: hangs, so use
runOperationModalForWindow: instead.

Closes https://github.com/wxWidgets/wxWidgets/pull/2198

Closes #19063.
2021-01-28 17:34:11 +01:00
Vadim Zeitlin
52d63eedd2 Don't rerun CI builds for docs-only changes
Avoid running the builds unnecessarily.
2021-01-28 17:33:26 +01:00
Paul Cornett
d932e89d40 Document when wxColour::IsSolid() was added 2021-01-28 07:31:36 -08:00
Paul Cornett
22349a79aa Use more accurate source for wxClientDC size with GTK3
Because GdkWindow size is updated somewhat asynchronously, it can lag behind
current window size. So get size from wxWindow instead. See #19062
2021-01-28 07:30:19 -08:00
Jouk
9d45591e15 Synchronize setup for OpenVMS with setup.h.in 2021-01-28 09:18:04 +01:00
Vadim Zeitlin
f31a064848 Install libcurl to make it available in the CI builds
It's not installed by default at least on GitHub Actions images.
2021-01-28 00:04:39 +01:00
Vadim Zeitlin
5e3464fcd6 Enable use of libcurl and test it using local httpbin instance
Libcurl was implicitly disabled by --disable-sys-libs, so enable it
explicitly to still use it.

Also install httpbin using pip to use it for wxWebRequest tests.
2021-01-27 23:58:58 +01:00