Commit Graph

67405 Commits

Author SHA1 Message Date
Paul Cornett
26701fd017 Refuse to scale an image which is too large to be properly handled
...by the wxIMAGE_QUALITY_NEAREST resampling algorithm. See #18550
2019-10-30 21:17:14 -07:00
Vadim Zeitlin
d7a640933d Remove wxUSE_WCHAR_T, it must always be 1 anyhow
This is not really an option as building requires it to be 1, so don't
make it one in setup.h/configure/cmake and just hardcode it as 1 for
compatibility.

Closes #18558.
2019-10-31 02:16:19 +01:00
Vadim Zeitlin
349e73994b Merge branch 'dpi-awareness-option' of https://github.com/MaartenBent/wxWidgets
Add wxUSE_DPI_AWARE_MANIFEST option allowing to choose to use a manifest
specifying per-monitor DPI awareness.

See https://github.com/wxWidgets/wxWidgets/pull/1622
2019-10-30 21:25:45 +01:00
Paul Cornett
25d25a4385 Fix memory leak in conversion from wxAny to wxVariant
Dynamically allocated copies in intermediate wxVariantList need to be deleted
2019-10-30 08:34:47 -07:00
Vadim Zeitlin
acf2f9ef1f Fix assert in wxWindowX11::SetBackgroundColour(wxColour())
Setting invalid colour is supposed to work and reset the background to
the default one, but asserted and then crashed due to triggering another
assert while trying to repaint the window while the assert dialog was
shown, in wxX11.

Fix this in the most expedient way by just resetting the background
colour to its initial value.

A better fix would be to leave it invalid but provide an accessor
returning the default value if the background colour is not defined.
2019-10-30 14:18:13 +01:00
Vadim Zeitlin
d076859040 Fix harmless signed/unsigned comparison warning
Cast line index to size_t after checking that it is positive to avoid
-Wsign-compare from gcc 8.3.
2019-10-30 14:13:22 +01:00
Paul Cornett
94ac1bbc85 Fix crash in wxImage::Scale()
Caused by arithmetic overflow of a signed addition and subsequent
right-shift of that (now negative) value and use as an array index.
Could only realistically occur on platforms where long is 32 bits.
See #18550
2019-10-29 19:59:31 -07:00
Maarten Bent
a72c9b6dbc Run autoconf and rebake after adding wxUSE_DPI_AWARE_MANIFEST 2019-10-30 00:02:08 +01:00
Maarten Bent
54996525f5 Document wxUSE_DPI_AWARE_MANIFEST option 2019-10-29 23:59:57 +01:00
Maarten Bent
d0b26a90ff Resolve -Wdeprecated-copy warning in wxDataFormat
Implicitly-declared 'constexpr wxDataFormat::wxDataFormat(const wxDataFormat&)'
is deprecated because 'wxDataFormat' has user-provided
'wxDataFormat& wxDataFormat::operator=(const wxDataFormat&)'.
2019-10-29 23:49:51 +01:00
Maarten Bent
cdf1226573 Add DPI Awareness option to configure and bakefile
Add option --with-dpi=[none,system,per-monitor] to configure the dpi awareness
on Windows.

Support DPI Awareness in makefile.gcc and makefile.bcc.

The default DPI awareness is set to per-monitor.
2019-10-29 23:49:51 +01:00
Maarten Bent
6f02c3a897 Add DPI Awareness option to CMake
For VS solutions, the DPI aware manifest is added as additional manifest.
For makefiles, the DPI aware manifest is included via the resource file.

Set the default DPI Awareness to per-monitor.
2019-10-29 23:49:36 +01:00
Artur Wieczorek
9e4d28ba7f Fix names of wxDirProperty ctor parameters
First two paramaters of ctors of wxPGProperty and its derivates are named
'label' and 'name' so wxDirProperty ctor should conform to this convention.

Close #18547.
2019-10-29 23:34:37 +01:00
Paul Cornett
d6c6fe78bb Fix read of uninitialized variable in wxFileConfig dtor 2019-10-29 11:17:06 -07:00
Vadim Zeitlin
c700f3bdf7 Remove asserts from wxZipHeader::ReadNN() methods
They prevent fuzzing from working properly as the program aborts instead
of continuing and crashing if it mishandles incorrect input, so just
remove them -- they didn't add any safety anyhow, as asserts are dormant
by default in release builds.
2019-10-29 19:05:15 +01:00
Vadim Zeitlin
c836b94cc4 Fix buffer read overflow in ZIP-64 loading code
Don't even try to parse the ZIP-64 header if there is not enough data in
the file.

Credit to OSS-Fuzz: this solves its issue 16250.
2019-10-29 19:01:48 +01:00
Vadim Zeitlin
e790f03950 Fix popup menu position on non-primary displays in wxGTK
If the popup menu position was explicitly specified, it wasn't taken
into account correctly in wxGTK code as it always clamped it to the
primary display boundaries, even if the window showing the menu wasn't
on this monitor at all, typically resulting in the menu shown at the
left or right edge of the monitor instead of the correct position.

Fix this by using the display containing the window instead. This
requires passing the window, or rather the menu from which it can be
retrieved, to wxPopupMenuPositionCallback too, so add a helper struct to
pass both the position and the menu to it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1621
2019-10-29 13:55:41 +01:00
Vadim Zeitlin
c0db9fe01c Remove MinGW 7.2 note as we build 7.3 binaries now
Also correct 8.x version number, it's 8.1 and not 8.3.
2019-10-28 14:56:37 +01:00
Vadim Zeitlin
4951d3be6f Remove mention of TDM from binaries description
We don't provide binaries for this compiler any more, just MinGW-w64.

Also mention that SJLJ exceptions propagation mechanism is only used in
32-bit builds.
2019-10-28 14:25:10 +01:00
Vadim Zeitlin
0a02f4c190 Increment version number to 3.1.4
Done by running misc/scripts/inc_release, manually updating version.bkl,
rebaking and rerunning autoconf.

Also a header for the next version to the change log.
2019-10-28 14:11:00 +01:00
Vadim Zeitlin
e8fbf9aa49 Also mention wxwidgets.props in the release notes
Explain how to use the MSVC binaries in the new projects. We could also
link to https://docs.wxwidgets.org/3.1.3/plat_msw_binaries.html, but
it's arguably better to add this small note here.
2019-10-27 19:11:27 +01:00
Vadim Zeitlin
a04207a5f8 Update 3.1.3 source archives SHA-1 sums 2019-10-27 19:01:40 +01:00
Vadim Zeitlin
8a40d23b27 Update release notes etc for 3.1.3 release
Also simplify MSVC binaries use instructions by instructing people to
just use the provided properties file.
2019-10-27 18:41:42 +01:00
Vadim Zeitlin
57f3a20d39 Update change log for 3.1.3 release
Add all the changes from "git notes --ref=changelog" and a few more.
2019-10-27 17:53:26 +01:00
Vadim Zeitlin
67739303fd Don't force wxAuiToolBar size to be less than its parent
This results in the toolbar being too small to show any items in it
in wxGTK and wxOSX, because the parent window size is still the default
small one and not the actual size it will be when shown, when the size
of the toolbar is first set.

And it seems completely unnecessary to do this anyhow, as toolbar is
resized by wxAuiManager in any case.

Closes #18218.
2019-10-27 17:41:05 +01:00
Vadim Zeitlin
1d844882ed Avoid closing invalid socket after unsuccessful Accept()
Calling wxSocket::Accept() may return an invalid socket, especially when
non-blocking, so don't close it unconditionally.

This avoids an assertion failure in MSVC CRT due to calling
closesocket() with an invalid argument.
2019-10-27 15:50:33 +01:00
Vadim Zeitlin
56d36d11ba Merge remote-tracking branch 'github/osx-fixes'
Several fixes for wxOSX, including several focus-related changes.

See https://github.com/wxWidgets/wxWidgets/pull/1620
2019-10-27 14:52:37 +01:00
Vadim Zeitlin
d38d8f4f9c Remove Carbon-specific code from wxScreenDC implementation
Carbon is not supported any more and defining m_overlayWindow, which was
only used by Carbon code, resulted in "unused private variable" warning
from clang.
2019-10-27 01:44:29 +02:00
Vadim Zeitlin
85b5337160 Try to improve CanFocus() behaviour for hidden windows
This should be less important now that we don't rely on CanFocus() to
determine if we should set focus to the window any longer, but it seems
to still be better to try to make it work better for hidden windows, so
at least return true from it when full keyboard access is on.

When it's off, the behaviour is the same as before, but this doesn't
affect wxTextCtrl, whose peer NSView overrides CanFocus() to always
return true.

We almost certainly need to override CanFocus() in other views, notably
wxDataViewCtrl, wxSearchCtrl, and any other controls that can have focus
even when full keyboard access is off.

See #17340.
2019-10-27 01:42:26 +02:00
Vadim Zeitlin
6530323f31 Add unit test for wxWindow::IsThisEnabled()
Check that the child IsEnabled() returns false if its parent is
disabled, but its IsThisEnabled() still returns true in this case.
2019-10-27 01:31:21 +02:00
Vadim Zeitlin
37ca3bcae9 Remove unnecessary wxIsWindowOrParentDisabled()
wxWindow::IsEnabled() already returns false if any of the window
ancestors are disabled, there is no need to check them explicitly.
2019-10-27 01:30:43 +02:00
Vadim Zeitlin
a5d719dc19 Fix setting initial focus in wxOSX
Previously calls to SetFocus() during construction/initialization of the
parent window simply didn't do anything for windows other than
wxTextCtrl because CanFocus() always returned false for them because
they were not shown yet (while wxTextCtrl implementation overrides
CanFocus() to always return true, probably to work around the same
problem).

Now use [NSView setInitialFirstResponder:] if the window is currently
hidden to try to focus it when it's shown. This might still fail if the
window is really not focusable (e.g. for non-text windows when full
keyboard access is off), but it's not worse than what happens now, and
it also may work -- unlike now.

Closes #17340.
2019-10-27 01:20:39 +02:00
Vadim Zeitlin
c9faa30987 Remove AcceptsFocus() check from SetFocus()
This is partially a workaround for AcceptsFocus() not working as
expected for hidden windows under Mac (see the upcoming commits), but
also makes sense on its own: the other ports don't check whether the
window accepts focus in their SetFocus() implementation and it's not
clear why should Mac do this.

See #17340.
2019-10-27 01:18:27 +02:00
Vadim Zeitlin
55da22563b Add even more focus tracing to wxOSX
Log CanFocus() results too.
2019-10-27 00:19:56 +02:00
Vadim Zeitlin
3406147690 Improve tracing of focus event in wxOSX
Give more details about the window gaining/losing focus rather than only
printing out its address.
2019-10-27 00:14:41 +02:00
Vadim Zeitlin
87bba02fef Stop handling performKeyEquivalent: in wxOSX
We can't handle the accelerators (known as "key equivalents" in Cocoa)
in this function because it is called for the views in top to bottom
order, while wx semantics is for accelerators to be handled in the
accelerator table closest to the focused window.

So just remove this code and rely on accelerator handling happening in
wxWindowMac::OSXHandleKeyEvent() instead.

Closes #13937.
2019-10-27 00:02:29 +02:00
Vadim Zeitlin
df689e739a Add tracing to key event handling functions
No real changes, just make it simpler to understand what's going in
wxOSX code when handling key events by sprinkling it with wxLogTrace
calls.
2019-10-26 23:50:01 +02:00
Vadim Zeitlin
456743666c Remove the section about universal binaries from macOS docs
This is not relevant any longer, all supported macOS versions support
x86-64 binaries and the latest ones don't support anything else, so
there is no need to create i386 binaries any more (and PPC ones don't
work since ages).
2019-10-26 18:16:52 +02:00
Vadim Zeitlin
7ec0d640ca Clarify library installation instructions for macOS
Don't explain how to install the library first only to say that it
shouldn't be done afterwards.

Also separate the discussion of installing and distributing the
libraries.

Closes #16316.
2019-10-26 18:15:32 +02:00
Vadim Zeitlin
bf99c7ae9f Fix asserts in wxRibbonButtonBar during destruction
Don't do anything when the art provider is being reset during the window
destruction: this is at best useless and is actually harmful as the code
ended up by requesting the DPI of the TLW parent which could already be
half-destroyed.
2019-10-26 17:24:46 +02:00
Vadim Zeitlin
e303231d00 Simplify drawing plain background in AUI toolbars
Don't bother adjusting the rectangle, just set the pen correctly to
avoid drawing its borders.

Closes #17616.
2019-10-26 16:54:16 +02:00
Robin Dunn
4684607a0d wxGrid now derives from wxScrolledCanvas 2019-10-25 21:22:58 -07:00
Vadim Zeitlin
198a4e97a0 Fix wrongly cached state of children focusability under Mac
Remove caching of whether any of the children accept focus in
wxControlContainer as it can change at any moment under Mac, due to full
keyboard access being turned on and off (which can be done using
Ctrl-F7, i.e. easily, and so this might be something users actually do
and not just a theoretical edge case). This also incidentally fixes
caching of the wrong focusability state during window initialization,
when its children are not yet shown, as [NSView canBecomeKeyView:] used
for AcceptsFocusFromKeyboard() implementation under Mac, apparently
always returns false for hidden windows.

The behaviour under the other platforms should remain the same, but
AcceptsFocus() is slower now as it always has to query children instead
of being able to avoid doing it when we know that none of them accepts
focus anyhow. OTOH this only happens to the windows that don't accept
focus themselves and, at least at some moment, don't have any children
accepting focus neither, which should be quite rare and optimizing this
case doesn't seem to be worth the extra code complexity due to extra
preprocessor platform checks.

Closes #18089.
2019-10-26 02:58:29 +02:00
Vadim Zeitlin
8648f839e7 Don't accept focus for wxRadioBox itself in wxOSX
The radio box is just a static box and so can't have focus, only its
child radio buttons should have it.

This resolves the problem with getting stuck on wxRadioBox when full
keyboard access is off, as wxControlContainer code tried to give focus
to wxRadioBox because its AcceptsFocusFromKeyboard() returned true, but
none of its radio buttons could be focused without full keyboard access.

However this introduces a new problem with wxRadioBox being skipped when
full keyboard access is on, which will be fixed in the following commit.

See #18089.
2019-10-26 02:46:39 +02:00
Vadim Zeitlin
146befeb88 Fix appearance of ampersands in wxAuiNotebook dropdown menu
They need to be escaped to prevent them from being interpreted as
special characters in wxMenuItem ctor.

Closes #18055.
2019-10-26 00:41:15 +02:00
PB
46792d4933 Fix typos in wxStaticBox docs
Add missing commas in code examples.

Closes #18542
2019-10-25 19:39:47 +02:00
Vadim Zeitlin
2b3e3d6c10 Show wxRendererNative::DrawChoice() in the render sample too
See #18255.
2019-10-25 17:47:02 +02:00
Danny Scott
dc3e685e3a Fix package path when adding wx_setup.props
Closes https://github.com/wxWidgets/wxWidgets/pull/1618
2019-10-25 16:33:48 +02:00
Dummy
5eef7382bc Correct Italian translation of "Shift"
This notably prevented accelerators using Shift from working when using
Italian translations.

Closes #18541.
2019-10-25 14:45:43 +02:00
Vadim Zeitlin
6d1b6c71c4 Fix wxUpdateUIEvent prcoessing for standard menu items under Mac
Handle these events in the menu itself first, then the window and only
then at the application level instead of falling back on the application
before searching the window for the handler.

This requires using the logic already present in the base class
DoProcessEvent() method, so make it protected to allow reuse.

Closes #4769.
2019-10-25 04:10:23 +02:00