In particular this fixes reported size in some situations where
SetSize() has been called before decoration size is known.
See #23041
(cherry picked from commit 08301b1b4ae6b54ee0f0a5dc6eb1f4468635954d)
Add support for more keys to this function, which previously only
supported the modifiers.
See #23195, #23198.
(cherry picked from commit 228bae0d91739fb3d405d9d6801e998ea55bad31)
Don't reallocate wxPGGlobalVars if it's somehow already allocated when
wxPGGlobalVarsClassManager::OnInit() is called: this is not supposed to
happen but it does when wxPython redoes the modules initialization after
loading another module.
See #23165.
Move "alpha" initialization inside the conditional to ensure that it's
calculated correctly, as it was apparently hoisted out of the loop due
to an optimizer bug otherwise.
This commit is best viewed with Git --color-moved option.
See #23164.
(cherry picked from commit e51bc7365904b0fc3a35038457c907e2f6c08eb0)
This is a fix for the changes of the previous commit repairing handling
of arrow keys in the text controls after it.
See #23151.
(cherry picked from commit 6eb6c52bee43eb38a211f4760f35187be9815198)
This fixes CVE-2022-37434 (which shouldn't normally affect the use of
zlib in wxWidgets but it still seems better to not have it than to
have).
See #22919.
(cherry picked from commit b4f1ae68b5961e0a309b10f9114be6a55a7f1a21)
Normally the GTK message dialogs have non-selectable text, but that also
means users can't copy the text. This can be inconvenient if the dialog
is used for error messages, since then the error message can't be
copied.
Instead, make the text labels used in the GTK message dialog selectable
to fix that.
See #23039.
(cherry picked from commit a8ea3eda116ae895446fc720943702f0c9c52b90)
Avoid using glibc specific defines when using musl, which does not
provide glibc-only enum members such as _NL_ADDRESS_LANG_NAME.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
See #23050.
(cherry picked from commit 1faf1796b23b2503296d9b1e9ad39047d633f8c9)
Use a workaround to ensure the image is not distorted due to using a
wrong scale.
See #23042.
(cherry picked from commit 83e47a6be33190f5a0974dc52fc38c44840660e1)
This is a cherry pick of the merge commit 5845312825 (Merge branch
'generic-listctrl-hidpi-images', 2022-10-26) from master including the
following commits:
* Support high DPI bitmaps in wxGenericListCtrl.
* Rename variable to have a less confusing name.
* Add wxDrawImageBitmap() helper and use it in wx{List,Tree}Ctrl.
* Don't duplicate same code for small icon, list and report modes.
See #22907, #22916.
This is a cherry pick of the merge commit 4f6aa5aee9 (Merge branch
'print-preview-hidpi', 2023-01-15) from master comprising the following
commits:
* Use correct size for SVG art provider bitmaps in high DPI.
* Use wxBitmapBundle for print preview frame buttons.
* Really DPI-independent size from GetNativeDIPSizeHint() in wxMSW.
* Fix using art provider on secondary monitor with standard DPI.
See #23127, #23131.
Don't make the window size at least equal to GetBestSize() when the DPI
changes as this could result in it becoming far too big, e.g. if it
contains any controls whose current size is significantly smaller than
their best size, as could be the case for just about any control using
scrollbars and notably wxListCtrl.
Instead amend the changes of b66e63e (Fix windows becoming smaller than
best size on DPI change, 2022-06-24) to only do this for the windows
using sizers as we can determine the minimal acceptable size for them
and we really shouldn't shrinking them beneath it.
See #23091, #23134.
(cherry picked from commit 0ccf6813d2154b68622a12664fef588145fee208)
Check both HKCU and HKLM registry hives.
See #23172.
(cherry picked from commit ab12443d0f5460da5c121be7d17d52460e40dfe3
after modifying it to use a function instead of a lambda).
Restrict the hack disabling the use of build system pkg-config files
added in 893ebbab0c (Disable use of build system pkg-config files when
cross-compiling, 2020-12-13) to the case of using non-host-prefixed
pkg-config script and cross-compiling to non-Linux targets, as we're
very unlikely to have the correct .pc files installed on the build
system, but do use pkg-config in the other cases, as we do want to use
the system-provided .pc files then.
This is a combined cherry-pick of d6ddfe87e1 (Disable build system
pkg-config when cross-compiling to non-Linux, 2022-11-30), 7899850496
(Do use host-specific pkg-config when cross-compiling, 2022-12-15) and
b0056f8ce5 (Re-re-enable using pkg-config when targeting Linux systems,
2023-01-25) from master.
See #22886, #23037, #23171.
For some reason, the margin was only used in wxGTK ever since it was
added back in ccdbdc8936 (Added native selection rectangle drawing.,
2006-11-11) even though it came with a comment saying that this
should be done for all platforms.
Finally do this now to make the list look better under e.g. macOS.
See #23155.
(cherry picked from commit b6071fc6c65efd2922e54c8dd916432739c12988)
Using wxClientDC can actually be worse than useless with wxGTK3 as not
only it does nothing when used under Wayland, but it may also draw at
the wrong position when using X11 with some WMs, notably Openbox or
fvwm.
Simply don't use at all with wxGTK3, it should be never needed there, to
fix the painting artifacts that it created.
See #23135.
(cherry picked from commit 12497372fc01a512c0d392ec612b2359206c80c7)
At least with g++ 10, but presumably with other versions too, the
compiler still predefines __has_cpp_attribute(deprecated) even when
using it with -std=c++98 or similar option, but it does not accept this
attribute unless it's actually using C++11 or higher, resulting in
compilation errors.
Simply avoid defining wxHAS_DEPRECATED_ATTR when not using C++11 to fix
this.
This fixes compilation with C++98 compiler after the changes of
25c5f57f0b (Initialize atoms used in wxGTK wxDataObject on demand,
2022-12-06).
See #23018.
When recreating a wxComboBox, as sometimes needs to be done when adding
a new bitmap to wxBitmapComboBox, for example, we should only disable it
if the old combobox itself was disabled, not if (any of) its parent(s)
were disabled, but IsEnabled() returned true even in this case.
Use IsThisEnabled() instead to ensure that we only disable the new
combobox if necessary.
See #23132.
(cherry picked from commit 8e604926c3a726c93b2df2c162be57b94a10cb61)
Correct path for x64 wxrc.exe file which prevented it from being
included in the vc14x_x64_Dev archive.
See #23122.
(cherry picked from commit 70667fc8ab012fc4ab63d187062e5a28834dc5fc)
Provide more information about application manifest, High DPI support,
and contents of wx/msw/wx.rc file.
Use the correct file extension for docs/msw/winxp.md.
See #23116.
(cherry picked from commit 42c2cb9936c7341f365afef1466aa5181df18261)
Crazily enough, this seems to have been broken ever since a324a7bccf
(Added GSocket for Unix [...], 1999-07-22) which removed the call to
GetPushback(true) from Peek(), making its "peek" parameter unused until
now.
Restore this call in order to return the correct data from the internal
buffer even if the socket has been closed since the last read.
This fixes wxURI tests as the new test HTTP server returns smaller
response which can be typically read entirely at once.
(cherry picked from commit 001fbe120f54c141db950137fc00e29fb56c6f16)
This requires an image accessible via HTTP (and not HTTPS) but we don't
have any such working URLs any longer since the recent change on
www.wxwidgets.org.
Still make it possible to test this manually by predefining an
environment variable containing the URL.
(cherry picked from commit 2b5bb6217d9bc9076c283e785f3b8fa43c05e109)
http://www.wxwidgets.org/ now redirects even image assets to HTTPS all
of a sudden.
(cherry picked from commit b5d7112583446074ee24a800b54be9a6af9e2de0)
Explicitly cast wxNumberFormatter::GetDecimalSeparator() to int before
comparing it with int keycode.
Master contains a better fix for this problem (see #23103), but this one
is simpler and works also in non-Unicode build.
See #23101.
Even though this function is private, the ABI checker script still
complains if it is removed, so restore it, even if it doesn't do
anything any longer after the changes of the grandparent commit.
The buffer size includes the trailing NUL, but we shouldn't make it part
of the string contents as it's not really part of the data at all.
The next commit will add a test verifying that retrieving an URL from
clipboard now gets the right string, without an extra trailing NUL, i.e.
fixes a bug similar to #22928 but in wxGTK.
As with the grandparent commit, this commit is a modified version of the
master one accepting non-NUL-terminated strings too for compatibility.
See #23018.
(cherry picked from commit c93c346adcd0f7cb443f6e8307aed6ccb59637af)
This allows to avoid having to call PrepareFormats() manually which was
not only verbose, but also error-prone as proved by the fact that
wxURLDataObject used wxTextURIListDataObject which used g_fileAtom in
its ctor without calling PrepareFormats() first and meant that this
class didn't work correctly unless some other wxDataObject had been
created before it.
See #23018.
(cherry picked from commit a577af1ca656e1f7060cbe47ce7ac92162e87386)
Fix a long-standing bug in wxMSW wxTextDataObject which returned the
size including the trailing NUL from its GetDataSize() and used the same
convention in GetData(), but didn't account for this NUL being included
into the buffer passed to SetData().
This was partially compensated by also passing the wrong (too small)
buffer size when calling SetData() from wxIDataObject, but still
resulted in problems when using SetData() with the length returned from
GetDataSize(), as done in wxDataViewCtrl code.
Fix this by now always considering NUL part of the buffer (as this is
the platform convention, i.e. all CF_TEXT data on the system clipboard
must include the trailing NUL) and taking it into account when
determining the buffer size in wxIDataObject.
This change is not fully backwards-compatible as it breaks any code
calling SetData() directly, as e.g. wxURLDataObject in wxMSW itself did,
so document it as such, but it's still worth making it as there doesn't
seem to be any other way of fixing the problem described in the linked
issue and direct calls to SetData() should be rare as simpler SetText()
should be used instead.
Also add a unit test for wxTextDataObject and extend the existing test
of wxURLDataObject.
This commit is a modified version of the master one as it still accepts
non-NUL terminated strings too, for compatibility, so it shouldn't break
any existing code.
See #22928, #23018.
(cherry picked from commit d737d98d278a43ef4b16a756f3115bbf65962358)
Use the correct scaling factor when creating the bitmap in
wxWindowsArtProvider, otherwise the bitmap was wrongly rescaled again
when actually using it.
It still seems wrong to always use the primary display scaling here, but
we just don't have any window to use in this code and at least it is
consistent and works when primary display scaling is not 100% now.
See #23031, #23038.
(cherry picked from commit 5a23fd7a6e3ea70f168645f575d59b3007e3635f)
When inheriting from std::streambuf, as is the case by default, and
creating wxTextCtrl in the application (as is common) and destroying it
in the library (as is even more so, as it's typically done when the
parent window is destroyed), having inline constructor but not inline
destructor apparently results in std::locale, which is part of
std::streambuf, to be allocated and destroyed using different heaps or
something similar when using TDM-GCC libstdc++, as destroying
std::locale inside the library corrupts the heap and results in crashes
when the next std::locale object is destroyed -- i.e. creating, and then
destroying, more than one wxTextCtrl results in a crash.
Work around this by moving the constructors out of line, as this is
sufficient to avoid the problem, even if it's exact causes are not
exactly clear.
This commit is best viewed with Git --color-moved option.
See #22639, #22735.
(cherry picked from commit 70c5ec6effb73330d025f8c4e9951c1ef582bfc6)
Use the same hack already used for wxEntryReal() before to define a
MSW-specific wxEntryCleanup() which frees the memory allocated by
::CommandLineToArgvW() after performing the common cleanup.
Also refactor the code dealing with them to avoid having different
wxArgs variables in wxBase and wxCode, which was almost certainly
unintentional and definitely very confusing. Now we keep just a single
wxArgs in wxBase and provide access to it from wxCore via the exported
functions.
See #23081, #23082.
(cherry picked from commit 3edc2982890246797295b10be1ec621ff96e64f0)
Avoid complicated preprocessor manipulations not needed any more since
the simplifications of 10d2354125 (Merge branch
'simplify-application-manifests', 2021-12-18).
See #23057, #23065.
(cherry picked from commit ddea807a2a904c7c5e0b0ac2a274ee8480eb5ce0)
This didn't work because the result of the first call to GetPrinter(),
done only to retrieve the buffer size, doesn't matter and should _not_
be checked as otherwise we're never going to succeed retrieving anything
at all.
See #23068.
(cherry picked from commit 00f89c69deaf416ab1bc3b89bc5f7f9c986c37e6)
This vararg function accepts any kind of values, without any checks, but
actually needs double for TIFFTAG_[XY]RESOLUTION and not int that we
passed to it, and which could result in the double values actually
having a NaN value of the word on the stack before the int happened to
have just the wrong value and which, in turn, resulted in a failure to
save the TIFF file later as libtiff checks that the values are valid,
i.e. positive and not-NaN. Note that we really need to pass the values
as doubles, even if they're stored as floats internally and returned as
such by TIFFGetField().
Also fix the types for all the other calls of this function, even if
this hasn't been observed to result in any problems so far.
See #23048, #23056.
(cherry picked from commit af923360abf278bf8a488238a85547d06344d4e4)
Using this class is simpler, more efficient and MT-safe, which is
important because wxZipInputStream can be used from a background thread
(e.g. to decompress a file downloaded from the network etc).
(cherry picked from commit c7255734dd71a7884e9c8f4d6a02c4e7b558fca6)
See #23054.