Copy the target attributes that are easy to copy and make sense to
preserve under Windows too instead of only doing it under Unix in
wxTemp{F,}File and do it in a new wxFileName::CopyAttributesFrom()
function instead of duplicating the same code in both classes.
The new function can be potentially useful on its own, so make it public
and document it.
Add a unit test verifying that the attributes are preserved after
overwriting the file with wxTemp{F,}File.
Provide helpers for creating disabled wxBitmap and wxBitmapBundle
versions.
Fix disabled Ribbon icons being upscaled on Retina display using them.
See #26989.
We previously trusted Win32 ::SetWindowPlacement() function to handle
the case when restoring a window which was saved with the geometry that
has become invalid since (e.g. because the display the window was
displayed on was disconnected), as MSDN documents that it does it:
> If the information specified in WINDOWPLACEMENT would result in a
> window that is completely off the screen, the system will
> automatically adjust the coordinates so that the window is visible,
> taking into account changes in screen resolution and multiple monitor
> configuration.
but this didn't work well in practice. In particular if only a tiny part
of the window remained visible, it didn't trigger ::SetWindowPlacement()
check for "completely off screen" and so the window was restored in an
unusable position.
Fixing this by ensuring that the window is always fully visible would be
wrong too, however, as it's possible that the user has intentionally
moved the window partially off screen. To handle this case, remember
whether the window was partially off screen when saving its geometry and
only force it to be inside the visible screen area if this wasn't the
case.
Extend the unit tests to check for all possible situations.
Show "key tips", i.e. popup windows showing the key that can be used to
activate a ribbon element, and add support for using keys to do it to
improve accessibility.
Closes#26935.
Keep wxPrintData's default duplex value unspecified internally so MSW
print conversion leaves the native DEVMODE duplex setting alone. Still
write DM_DUPLEX when SetDuplex() is used, including explicit simplex.
Fixes#4366.
Closes#26896.
This was broken by 48bf1ac (Rewrite event generation and propagation in
wxAuiNotebook, 2025-07-12), see #25634 and #25544.
Restore sending this event for the buttons and do it with the correct
page indexes now, i.e. using the logical page index and not its physical
position.
Also consistently allow the handler of this event to prevent the default
action from taking place if it doesn't call wxEvent::Skip(). This is not
100% backwards-compatible but is consistent and more useful.
Add a unit test checking that this works as expected.
Closes#26801.
Remove wxHelpEvent::GuessOrigin() and guess origin in wxMSW instead
because GuessOrigin() called wxGetKeyState(WXK_F1) from the wxHelpEvent
ctor to tell keyboard-triggered help from help-button clicks and this
asserted under a non-X11 GTK backend (Wayland), where wxGetKeyState()
can't be used with non-modifier keys, and broke the EventClone test
which default-constructs a wxHelpEvent.
wxMSW's WM_HELP handler is the only place that creates a wxHelpEvent
without an explicit origin, so just do the key state check there, where
it works, and let the origin default to Origin_Unknown everywhere else.
Closes#26964.
Make expressions like make_unique<unsigned char[]>(zipLen) compile in
C++11 mode too.
This fixes building the tests in C++11 after the changes of c8003a0a06
(Use make_unique<>() instead of "new" in the tests, 2026-09-04).
We are going to need to drag floating AUI panes and dropping them onto
the main window too, so make wxTLWDragSession more flexible and allow
using different windows for starting the drag and for drop.
This function is trivial but it's still better to have it than to
duplicate it in several different places.
No real changes, this is just a refactoring.
Connect the recently added support for using XDG toplevel protocol to
wxAuiManager via wxAuiPaneDragHandler.
This reuses the same code which is used when dragging frames under the
other platforms (including wxGTK when using X11), but calls it from the
drag controlled by Wayland compositor.
Move the code called from the various event handlers while a pane is
being dragged in functions that could be reused when the drag is not
controlled by us.
No real changes yet.
Check for the necessary compile- and run-time support and implement the
new wxTLWDragSession class, allowing to start a TLW drag and notifying a
wxTLWDragHandler about its progress and result, if both are available.
This is not used just yet but will be in the upcoming commits.
With GTK4, events are dispatched while laying out the window so it was
possible for OnMotion() to be called from inside DoFrameLayout() and
this resulted in a crash because OnMotion() called Update() which
destroyed the sizer that DoFrameLayout() was using.
Fix this by tracking whether we're inside DoFrameLayout() and ignoring
mouse move events received while it's executing.
See #26968.
Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
The default constructor exists for the dynamic event creation machinery
and leaves m_cell and m_bLinkWasClicked indeterminate, so reading either
one from an event created that way was undefined behaviour and UBSAN
reported it as
include/wx/html/htmlwin.h:603:5: runtime error: load of value 93,
which is not a valid value for type 'bool'
Fix this by always initializing these fields, which also allows to
remove initialization of one of them in the non-default ctor.
See #26968.
Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
Cancel outstanding overlapped directory reads before destroying their
buffers, and protect the IOCP watch lists shared between the main thread
and worker thread. Also handle cancelled completions as normal watch
removal so removed watches are not processed or reissued.
Fixes#22381.
Closes#26866.
Let the window with a child wxTextCtrl positioned at the very top of it
draw out of its bounds as otherwise wxTextCtrl border is not visible at
all.
This is a hack, but it helps to keep existing code, not just in
wxWidgets itself, but in the applications too, working under macOS Tahoe
so it seems to be worth it.
Closes#26952.
Closes#26955.
The Windows theming engine does not draw the progress bar correctly
in the dark mode, so we need to draw it ourselves (only the border
under Windows 11 25H2).
Closes#26812.
Applying border flags had no effect before. Now it has an effect on windows whose
Qt handle derives from QFrame, such as a multiline wxTextCtrl or a generic window
(scrolled or not).
Dispatch() resolves the handler through a map keyed by the descriptor
stored in epoll_event::data, which means taking a lock for every event
dispatched, on the thread running the event loop.
Point epoll_event::data.ptr at a small dispatcher-owned entry holding the
handler instead. Unregistering clears the handler in the entry rather than
freeing it, since a batch being dispatched may still point at one, so the
entries live as long as the dispatcher and are indexed by descriptor.
Dispatch() then reaches the handler through the pointer epoll_wait() gave
back and never looks at the container at all, so it takes no lock. The lock
that remains guards only the growth of the vector, from registrations made
on worker threads.
This also makes the RegisterFD()/ModifyFD() disagreement noted in the map
version a non-issue: an entry is created on demand by either path.
No behaviour change, and the test added with the map version passes
unchanged.
Closes#26930.
Extra controls (including the file type filter choice) have been disabled
in sandboxed applications since the 2013-era workaround for #14906: the
native save/open panel runs out of process (Powerbox/NSRemoteView) and
inserting our views into its view hierarchy crashed.
The supported contract is to build the accessory view entirely in-process
and hand the finished NSView to -[NSSavePanel setAccessoryView:]; the
panel then hosts it safely even when remote. Do exactly that: create the
extra control and the filter panel as children of a hidden in-process
host window instead of parenting them to the (possibly remote) panel.
This makes extra controls and file type filters work in sandboxed
applications too. As a safety valve, a system option, which can be set
by the user by setting wx_osx_openfiledialog_disable_extra_controls
environment variable to 1, is provided to restore the old behaviour of
simply ignoring the extra controls.
Closes#26908.
MSW cross-builds / wxMSW 64 bits not compatible (push) Canceled after 0s
MSW cross-builds / wxMSW/Univ (push) Canceled after 0s
MSW cross-builds / wxMSW 32 bits (push) Canceled after 0s
Code Checks / Check Spelling (push) Canceled after 0s
Code Checks / Check Whitespace (push) Canceled after 0s
Code Checks / Check Mixed EOL (push) Canceled after 0s
Code Checks / Check C++ Style (push) Canceled after 0s
Code Checks / Check All Headers In allheaders.h (push) Canceled after 0s
Update Documentation / Update Online Documentation (push) Canceled after 0s
Add dark mode support for wxColourDialog, wxFindReplaceDialog,
wxFontDialog and wxPrintDialog.
Centralize all the related code in CommonDialogHookProc() which is used
by all these dialogs.
Closes#26780.
Check whether the WS_EX_LAYOUTRTL flag, indicating the
vertical scrollbar is on the left, is set and if so,
adjust the corner horizontal coordinates accordingly.
This required changing PaintScrollBarCorner() to take a wxWindow instead
of HWND, so adjust the callers accordingly.
Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
Dispatch() stored the wxFDIOHandler pointer in epoll_event::data.ptr and
called through the copy that epoll_wait() had filled in before any handler
ran. Servicing one event of a batch can unregister the descriptor belonging
to a later event of the same batch -- and, in the code owning it, destroy its
handler with it -- but nothing scrubs the pointer already copied into the
array, so the loop went on to make a virtual call on released memory.
Store the descriptor in epoll_event::data instead and look the handler up
when the event is actually processed, so that one which is no longer
registered is skipped rather than called. That is what wxSelectDispatcher has
always done, via FindHandler() in ProcessSets().
The map this needs is kept here rather than by deriving from
wxMappedFDIODispatcher, for two reasons:
- Its ModifyFD() asserts that the descriptor is already known, but
wxFDIOManagerUnix chooses between RegisterFD() and ModifyFD() from the mask
it keeps on the handler rather than from anything this dispatcher knows, so
the two can legitimately disagree. epoll_ctl(EPOLL_CTL_MOD) merely reports
ENOENT in that case, and that tolerance has to be preserved. Recording the
handler is therefore an unconditional assignment.
- Descriptors are registered and unregistered from worker threads, e.g. by
wxSocketImpl from whichever thread performs the socket operation, while
Dispatch() reads the map on the thread running the event loop. epoll_ctl()
is thread-safe so the previous implementation needed no locking; the map
does, and it is guarded accordingly. The lock is never held across a call
into a handler, which is free to register or unregister descriptors.
This only makes a handler safe against being unregistered by another handler
in the same batch, on the thread running the loop. A handler destroyed by a
different thread while the loop is between the lookup and the call was racy
before and still is.
The new test in tests/events/evtsource.cpp (which existed since many
years but was completely empty) covers the fixed case without depending
on timing: two pipes that are both readable are collected in one batch,
and the handler that runs first unregisters the other, which must then
not be called. It fails before this change -- both handlers run -- and
passes after.
Found while investigating a crash in aMule, where wxWebRequest's curl
backend destroys transfer event sources from inside curl callbacks that
themselves run during Dispatch(). Reported and reduced by ngosang at
https://github.com/amule-org/amule/issues/1136, which also has a real-world
reproducer built on wxFileSystemWatcher; under ASan it faulted in
wxEpollDispatcher::Dispatch() on 4 of 5 runs before this change and 0 of
8 after.
Closes#26924.