The changes of 1f7a8a8 (Round, rather than truncate, in wxSize and
wxPoint operations, 2018-03-06) have invalidated the documentation that
had been previously added in 4c20f3d (Document that wxPoint(wxRealPoint)
ctor truncates, not rounds., 2013-04-16) to document the old behaviour.
Changing the behaviour once again doesn't seem to be desirable, but at
least synchronize the documentation with it again.
See #26099.
(cherry picked from commit eb64d55ea9)
Post dummy event from applicationDidFinishLaunching, otherwise on some
macOS versions apps might not boot properly if no other events are
happening.
See #26095, #26098.
(cherry picked from commit 2f89cd2d6c)
Get the full font name using ::GetOutlineTextMetrics() if the name is
exactly 31 characters long, as it may indicate that it was truncated to
fit into LOGFONT::lfFaceName buffer which has fixed size of 32.
This commit is best viewed with Git --color-moved option.
See #25333, #26078.
(cherry picked from commit c73b1b12e1)
Update key bindings for macOS to more closely match native behavior.
Currently, Cmd+Left goes to the left word boundary, and Cmd+Right goes
to the right word boundary, like on Windows (wxWidgets treats Cmd on Mac
as if it were Ctrl for keyboard modifier key purposes). Alt/Opt+Left
and Alt/Opt+Right do nothing.
This change maps Cmd+Left to the start of the line, and Cmd+Right to the
end of the line. It also maps Alt/Opt+Left to WordLeft() and
Alt/Opt+Right to WordRight(), which is conventional on native Cocoa
controls (including other wxWidgets controls that map directly to Cocoa
controls).
See #26064, #26066.
(cherry picked from commit 2048a6871c)
Native wxListCtrl in wxMSW behaved inconsistently with the generic one
and used the first image for the new items inserted into it even if no
image was explicitly specified.
Work around this unhelpful native behaviour by using I_IMAGENONE for the
items without images.
See #26062.
(cherry picked from commit 2ab82b5a20)
Don't draw all the columns, there is no need to do it for those scrolled
out of view.
As a side effect, don't rely on wxDC::SetDeviceOrigin() for the
coordinates translation but do it ourselves in the drawing code: this is
pretty trivial in this case and avoids a bug in wxOSX which doesn't seem
to honour device origin in its wxRendererNative implementation, somehow.
See #26014, #26016.
(cherry picked from commit 411430b835)
Limit explicit border to be around text control, not the spin button,
which looks very wrong.
See #26002.
Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
(cherry picked from commit 0b97a4f25e)
Set wxSpinButton start value to start value of wxSpinCtrl, otherwise the
generic control used in OSX would report a wrong value in EVT_SPIN.
See #26002.
(cherry picked from commit 5178043b3e)
The scale of the canvas was set up correctly only once we received
"size-allocate" signal from GTK, but this doesn't necessarily happen
when the window is first shown and after its scale factor is actually
known.
Ensure that we use the correct scale by catching the notification about
its change too. This makes buffer scale factor correct from the very
beginning, without having to wait for a resize.
See #23733, #25465.
(cherry picked from commit 036087097b)
Check for the availability of eglCreatePlatformWindowSurfaceEXT() if EGL
version is < 1.5 and use it if it's available, as it allows applications
using wxGLCanvasEGL to work on some (many?) systems without EGL 1.5
support.
See #22325.
Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
(cherry picked from commit 602b80d896)
Avoid the overhead of converting the backing store bitmap to DIB and
back when drawing bitmaps with alpha on it in AlphaBlt(), which may be
very significant, by using 24bpp bitmap: as it doesn't have alpha, it
doesn't need to be adjusted after drawing on it.
This is ugly and it would be better to have a better implementation of
AlphaBlt(), but it's not clear how to do it, and for now this fixes a
real user-visible problem.
See #14403, #23841.
(cherry picked from commit b732393986)
Define __STDC_WANT_LIB_EXT1__ in wx/platform.h, which is included before
the standard headers even when using PCH, to make sure memset_s()
declaration is available in this case too.
See #24687.
(cherry picked from commit e913e9eba4)
As allowedTypes were restricted to the first filter expression, choosing
another filter only showed the files conforming to both expressions
instead of only applying the selected filter.
This commit is best viewed ignoring whitespace-only changes.
Fixes wxWidgets/Phoenix/issues#2806
See #25918, #25922.
(cherry picked from commit b153aafee9)
This didn't work correctly because the check if the column was already
selected in wxGridColumnOperations::IsLineInSelection() used incorrect
parameter order when calling IsInSelection().
See #25884.
(cherry picked from commit c7e5734797)
Check that the timer is still valid before using the associated object.
This is necessary because already queued timer events are still
delivered, even if wxTimer is destroyed.
See #25871.
(cherry picked from commit f25aec1b38)
wxMarkupToAttrStringBase implementation of markup parsing failed to
correctly apply nested attributes: in e.g. <i><b>foo</b></i>, only the
outer attribute was in effect.
This was due to applying - and overwriting - attributes to a span in
OnAttrEnd(), which is called first for the inner span, and then for the
outer one, overwriting all inner changes.
Instead, apply the currently effective attributes to text in OnText(),
similarly to how wxMarkupParserRenderOutput does it. As a side effect,
this also eliminates the need to apply default font to the entire range
first.
See #25864.
(cherry picked from commit ca05aee2f8)
This framework has apparently been deprecated since quite some time and
was removed from macOS 26, so linking with it resulted in an error.
Don't do this any longer.
See #25798.
(cherry picked from commit dd3f250949)
Free the old surface pointer before overwriting it with the new one in
wxOverlayImpl::EndDrawing().
This resulted in huge memory leaks when using wxOverlay repeatedly, e.g.
while dragging something around the window.
See #24500.
(cherry picked from commit 34e6866683)
HAVE_LOCALE_T is misnamed, as it must only be defined not just when
locale_t type is available but when the functions using it, such as
strxxx_l(), are available.
Due to the confusion about the nature of this symbol, CMake didn't check
for it correctly and only checked for its existence, but musl (used by
e.g. Alpine) does define the type without providing any of the functions
using it, which resulted in build errors later.
Fix this by checking for both the type and the functions in CMake too,
just as we do in configure.
See #25749, #25750.
(cherry picked from commit 170c386314)
These controls were not shown due to a forgotten colon in the test for
setAccessoryViewDisclosed support added in e765756555 (OSX file dialog
extensions (#2592), 2021-11-26).
Fix this simply by adding the colon, which is part of the method name,
but also avoid calling this method for save file dialogs which not only
don't need it, but result in an immediate application exit if it is
called on them.
See #25717.
(combined cherry pick from 426f745c6b and
32ea27c34f)
Workaround for Mutter from 9537141500 (Fix handling window total size
under GNOME with X11, 2025-04-28) broke the well behaving WMs used by
other desktop environments, such as XFCE, as it resulted in the window
size being mistakenly adjusted after the decorations size was changed
due to restoring a previous maximized window.
Prevent this from happening by not adjusting the size after the window
has been already mapped.
See #25348, #25349, #25708, #25711.
(cherry picked from commit 9b73719543)
Fix the visualizer to display full Unicode string.
Previously, only the first character was shown in recent versions of
Visual Studio. This was due to the use of "sb" format specifier meaning
an ANSI string.
Use condition expressions to cover both wchar_t and UTF-8 builds.
Correct the specifier for UTF-8 case to be "s8b" so that it interprets
and displays UTF-8 correctly.
See #25684.
(cherry picked from commit 77dd42f3c6)
While wxSOCKET_NOWAIT is incompatible with wxSOCKET_WAITALL, using
wxSOCKET_NOWAIT_READ and wxSOCKET_WAITALL_WRITE should be allowed, but
it was not.
Fix this and also split the assert in two for a bit more clarity.
See #17114, #25665.
(cherry picked from commit 943e4fb18d)
Protect gs_platInfo initialization with a critical section to ensure
that we don't try to do it in parallel from more than one thread,
resulting in crashes.
See #25459, #25464.
(cherry picked from commit a26eda72e8)
These dots should just use the window foreground colour instead of using
the hardcoded colour -- it will still be the same as before by default
but could be different (and better) now if different colours are used
for the window.
See #25405.
(cherry picked from commit c0089d90b0)
Use the key translated to the US layout by XKB and not the actual
character produced by the key in the current layout when determining
whether to generate wxEVT_CHAR for key presses with Ctrl or not.
This ensures that we produce the expected events for Ctrl-Latter in all
layouts and not just the ones using Latin letters.
See #25384, #25385.
(cherry picked from commit 57c33bb9ed)
If a panel contained a notebook and some other element(s) that didn't
accept focus (e.g. because they were disabled), TAB didn't wrap around
correctly. Fix this by ensuring the focus gets to the notebook itself in
this case by handling it in wxNotebook itself if the parent didn't do
anything.
See #25443.
(cherry picked from commit a2ed8ac9e6)
This shouldn't normally happen, but if it does, e.g. because all the GDI
resources have been exhausted, we still shouldn't crash, so check for
this.
See #24703, #24705.
(cherry picked from commit a6203be954)
If an event handler for wxEVT_DATAVIEW_SELECTION_CHANGED called
Collapse() itself (which is weird but allowed), Collapse() still tried
to collapse it again, which could result in the count of items becoming
negative and all sorts of other problems.
Avoid them by not doing anything if the item has been collapsed after
the selection change.
See #25638, #25631.
(cherry picked from commit 0396c2661f)
When the sizer is completely empty, it makes more sense to return 0
from these functions without asserting.
See #25642, #25641.
(cherry picked from commit d1be72aa8e)
Don't overwrite the existing m_refData in wxColour::InitRGBA()
implementation, as this could result in leaking it.
Ensure that we are its unique owners, which allocates it if necessary,
and then assign to the existing object instead.
See #25569.
(cherry picked from commit c7e5ac12e6)
This function needs to compile with wxNO_IMPLICIT_WXSTRING_ENCODING
defined, as there are some calls to it in wx headers (at least
wx/msw/private.h which, unfortunately, gets included when PCH is used,
i.e. practically always with MSVC).
Fix its compilation in this case by using wide char __TFILE__ instead of
__FILE__ which would have to be wrapped in wxString::FromAscii() or
FromUTF8().
See #25568.
(cherry picked from commit 1be2e487e3)
If the encoding is not recognized (which is the case at least for the
encoding used for Persian/Farsi), wxLocale::GetSystemEncoding() returns
wxFONTENCODING_DEFAULT and wxFont::SetDefaultEncoding() must not be
called in this case, as it asserts and, due to a separate bug, crashes
as the GUI is not fully initialized yet when wxApp::Initialize() is
executing.
See #25561.
(cherry picked from commit 5de590ffaf)
With backports of:
5513114673
CMake: Create all mswu include directories when installing
1dc7334851
CMake: Fix monolithic build with static wxWebviewEdge
3a48ac75ed
CMake: Add option to force all builtin libraries
51037ff728
Add wx/msw/mfc.h to file list
ecf2b0dcd7
Fix wx-config created in CMake build with custom flavour
2ec276affc
CMake: Fix iOS OpenGL warning
e1f0a938f6
CMake: Fix using Cotire for precompiled headers
35e3c14cb4
Fix library naming when cross compiling for Windows using CMake