We can't rely on HasSelection() returning true immediately after calling
SelectAll() because this operation (as almost all the other ones) is
asynchronous with WebKit and might not have completed yet when we check
for the selection existence.
There doesn't seem to be any way to wait for its completion, so just
poll the selection state for some time before deciding that it hasn't
been updated. In practice, just a couple of ms is enough on a normal
machine, but wait up to 50ms on Travis just to be on the safe side.
Note that to reliably reproduce the problem locally it's enough to run
"taskset 1 ./test_gui -c Selection WebView", i.e. pin both the main and
WebKit processes to the same CPU.
wxCmpNatural() had "inline" function specifier in a .cpp file
which made the function inaccessible outside that file in static builds.
Fix this by removing "inline", the function character is such that the
overhead by a function call should have negligible impact on its
performance.
Closes https://github.com/wxWidgets/wxWidgets/pull/2050Closes#18919.
This is a micro-optimization after the previous commit: don't call
FindToolByPositionWithPacking() at all rather than calling it and then
ignoring its result if wxAUI_TB_NO_TOOLTIPS style is set.
This commit is best viewed ignoring whitespace.
And use it to get HiDPI support wherever we use GtkImage. This extends and
consolidates support for custom drawing of images which has already been added
somewhat redundantly in several places.
We should use platform-specific functions to convert coordinates to take
into account all transformations applied to wxDC (also with transform
matrix).
Closes#18916.
Generic wxDC::DeviceToLogical{X|Y}() and wxDC::LogicalToDevice{X|Y}()
functions don't take into account transformations applied with
wxDC::SetTransformMatrix() so conversion results are invalid if wxDC is
transformed with both e.g. wxDC::SetUserScale() and
wxDC::SetTransformMatrix().
We need to implement functions in wxDCImpl and its platform-specific
derivates to do this conversion with taking into account all applied
transformations.
See #18916.
1) Link with the wayland-egl library, but do so only if we determine that we
have Wayland support in the GDK backend with a compile test.
2) Provide a way to force disable the EGL backend.
* adding native font descriptor serialization = v2
* remove common xml prefix from serialized string
* Update src/osx/carbon/font.cpp
Co-authored-by: VZ <vz-github@zeitlins.org>
* Update src/osx/carbon/font.cpp
Co-authored-by: VZ <vz-github@zeitlins.org>
* static string via accessor
* striping off xml preamble unconditionally
if we use a different format in the future, we will have to increase our version number
* applying italic directly to the font descriptor
thus preserving attributes in the native font descriptor which we don’t store explicitly yet
* Adding support for preserving font width
Although we don’t express this in the public API yet, we try to preserve eg condensed, when changing the font width
* Adding reference, bug fix
double checked the font weight constants,
Co-authored-by: VZ <vz-github@zeitlins.org>
This fixes another problem similar to the one fixed in be1854c617 (Avoid
UI functions in non-main thread in wxGStreamerMediaBackend, 2020-09-02)
and does it in a similar way: SetupXOverlay(), which calls gdk_flush(),
was called from gst_bus_sync_callback() which is executed in the worker
thread, so use CallAfter() to call it from the main thread later.
In aa2cd42206 (Report video size changes to the media backend,
2016-02-22), a couple of calls to NotifyMovieSizeChanged() were added,
presumably for a good reason. Unfortunately, NotifySizeChanged() makes
UI calls on wxGTK, so this resulted in UI calls happening on a non-main
thread because many of GStreamer's callbacks occur on arbitrary threads.
This is bad because it caused random X11 crashes.
Fix this by calling NotifyMovieSizeChanged() with CallAfter().
Closes https://github.com/wxWidgets/wxWidgets/pull/2042