Using a const char* and a wxString in the two branches of the ternary
operator resulted in compile-time errors when using C++20 standard
since the result type of the conditional expression was ambiguous,
so add explicit conversions to fix it.
See also #19355.
Closes#25501.
Replace most 'neither' words introduced after 2b0ee48ef7
(Fix double negatives used with 'neither', 2023-11-25)
with 'either'.
All changes are to comments only.
Closes#24999.
Create file samples/samples.props which adds the DLL build directory
to MSVS PATH in <LocalDebuggerEnvironment> property.
Add file samples.props to all MSVS sample projects.
Implement it for Edge, WebKit2GTK and Chrome backends.
It doesn't seem possible to implement this for WebKit macOS backend and
IE backend doesn't support dev tools at all.
Also note that Edge backend doesn't seem to support closing the dev
tools window, so don't provide this functionality for now, even if it
could be implemented for WebKit2 and Chrome backends.
DebugOnlyLog is not needed any more since 33931b7378 (UI improvements to
WebView sample, 2024-03-19) replaced wxLogWindow, which doesn't let
trace messages through (but probably should?), with wxLogTextCtrl, which
doesn't eat the trace messages.
Also fix a memory leak introduced in the same commit: the old logger
returned by SetActiveTarget() must be destroyed.
See #24417.
Closes#24787.
For the backends that had a description string (such as Chromium), we
showed only it but not the actual version, which was a bit confusing, so
show both the version and the description, even if the latter includes
the former too.
Unfortunately the workaround in dce09c9b2a (Avoid crash on startup in
webvew sample under Wayland, 2024-04-22) broke the sample when using CEF
as we can't capture the local lambda by reference.
Fix this simply by making a copy of it instead -- this is not the most
efficient way to do it, but it doesn't really matter here and it's the
simplest one.
The workaround for wxWebViewChromium added in f5e2af9a28 (Make
wxWebViewChromium work with wxGTK3 and X11, 2023-09-02) broke
wxWebViewWebKit under Wayland as calling wxYield() inside
wxEVT_WEBVIEW_CREATED handler results in
Error flushing display: Resource temporarily unavailable
error from GTK and immediate application exit.
This is almost certainly a GTK bug and should be fixed there, see
https://gitlab.gnome.org/GNOME/gtk/-/issues/124, but for now make the
workaround even uglier to avoid it.
And get rid of SAMPLES_RPATH_FLAG and just use DYLIB_RPATH_FLAG, as it's
not at all sample-specific.
This notably allows running wxrc from the build tree without setting
LD_LIBRARY_PATH under Linux.
Closes#24384.
No real changes, just rebake all the makefiles after the addition of
wxwin.extraLdflags, which results in an extra space even when these
flags are empty in webview-chromium branch.
This should have been done in f37401dde3 (Merge branch
'webview-chromium', 2024-01-19)
This reverts commit 3d51977acf because
it's incompatible with the library names created by CMake when building
CEF directly, and not via wx CMake files.
Define WinMain() instead of main() under MSW, as we need to pass an
HINSTANCE and not argc/argv to CefMainArgs ctor there.
Also explain how to build this file.
Ensure that the sample can run using wxWebViewChromium backend out of
the box by setting things up so that it can find the CEF files. Note
that we use symlinks instead of actually copying these files, to avoid
wasting so much disk space (CEF libraries take more than 1GiB).
Just include wxWebViewChromium in the webview library if it's enabled
during the build.
There doesn't seem to be any reason to build a separate library for it,
it's not really different from the other disabled by default wxWebView
backend (Edge).
And now that we don't need to link with an extra library, there is also
no need to have a separate webview_chromium sample, so just add a
possibility to run webview sample itself using Chromium backend by
setting WX_WEBVIEW_BACKEND environment variable.
This can be useful for diagnostic purposes and looks better than "0.0"
in the webview sample.
Notice that currently we return the compile-time version and not the
run-time version that could be retrieved using cef_version_info()
because this is simpler and we shouldn't be ever using a different
version from the one we were compiled with anyhow.
Modify the sample to show the correct value of the user agent when using
WebKit backend as this got broken by calling it inside an event handler
executed later but before the idle event handler could dispatch the
result of JS executed from inside WebKit AddScriptMessageHandler()
implementation, resulting in misinterpreting this result ("{}") as the
user agent string.
The real fix is, of course, to deal with the JS execution results coming
out of order in some way.