Commit Graph
22468 Commits
Author SHA1 Message Date
Vadim Zeitlin f47de7bfd8 Add wxFileName::CopyAttributesFrom() and use it in wxTemp{F,}File
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.
2026-09-11 02:28:00 +02:00
Vadim Zeitlin ab3f5e7299 Merge branch 'aui-button-event'
Restore generation of wxEVT_AUINOTEBOOK_BUTTON events.

See #26978.
2026-09-10 17:58:22 +02:00
Vadim Zeitlin dcfc167163 Merge branch 'aui-wayland-drag'
Implement dragging AUI panes under Wayland.

See #26969.
2026-09-10 17:56:55 +02:00
ali kettab 0944f83f95 Update wxColourDialog documentation
Mention that wxEVT_COLOUR_CHANGED is also generated under wxQt starting from
wxWidgets 3.3.2
2026-09-10 15:35:37 +01:00
ali kettab e2812706a8 wxQt: Allow using Qt's standard color dialog instead of the native one 2026-09-10 15:12:48 +01:00
Vadim Zeitlin 684420c9fa Merge branch 'qt-stattext-markup'
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK UTF-8 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxQt (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxX11 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK 2 (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK gcc 7 static compatible 3.0 (push) Canceled after 0s
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxDFB (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Canceled after 0s
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Canceled after 0s
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Canceled after 0s
CMake builds / MSW/MSVC wxMSW (push) Canceled after 0s
CMake builds / MSW/Clang wxMSW (push) Canceled after 0s
CMake builds / macOS latest wxOSX Ninja (push) Canceled after 0s
CMake builds / macOS 14 wxOSX Xcode (push) Canceled after 0s
CMake builds / macOS 14 wxIOS (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 5.15 (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 6.10 (push) Canceled after 0s
Mac builds / wxMac ARM ASAN not compatible (push) Canceled after 0s
Mac builds / wxMac Universal C++14 (push) Canceled after 0s
Mac builds / wxiOS Simulator on Silicon Mac (push) Canceled after 0s
Mac builds / wxiOS (push) Canceled after 0s
Mac builds / wxMac Intel C++17 (push) Canceled after 0s
Mac Xcode builds / iOS Simulator static (push) Canceled after 0s
Mac Xcode builds / macOS dynamic Release (push) Canceled after 0s
Mac Xcode builds / iOS static Debug (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Release x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Debug Win32 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Release arm64 (push) Canceled after 0s
MSW builds / wxMSW vs2026 DLL Release x64 (push) Canceled after 0s
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 markup support to wxStaticText under wxQt.

See #26984.
2026-09-10 03:18:52 +02:00
Vadim Zeitlin d6be8f1f6b Merge branch 'darkmode-taskdialog-dpichange' of github.com:stevecor/wxWidgets
MSW: Fix dark mode task dialog for DPI change.

See #26975.

Closes #26956.
2026-09-10 03:17:02 +02:00
Vadim Zeitlin 8e02ab920d Merge branch 'RibbonDisabled' of github.com:Blake-Madden/wxWidgets
Provide helpers for creating disabled wxBitmap and wxBitmapBundle
versions.

Fix disabled Ribbon icons being upscaled on Retina display using them.

See #26989.
2026-09-10 02:59:29 +02:00
Vadim Zeitlin 75876f7c94 Merge branch 'qt-rop' of github.com:AliKet/wxWidgets
wxQt: some wxDC cleanup.

See #26988.
2026-09-09 17:30:44 +02:00
Blake-Madden 56a802fc85 Use new wxBitmap::MakeDisabled 2026-09-09 06:15:08 -04:00
Blake-Madden 251a549713 Add MakeDisabled at the bitmap bundle level 2026-09-09 06:14:07 -04:00
Blake-Madden 67da9ed1e9 Fix disabled Ribbon icons being upscaled on Retina display 2026-09-08 21:38:01 -04:00
Vadim Zeitlin dca379e670 Merge branch 'msw-persist-tlw-on-screen'
Improve restoring TLW geometry in wxMSW.

See #26987.
2026-09-09 02:36:58 +02:00
ali kettab eb22974947 wxQt: Remove a hack from wxDC that was added for raster operation support.
This hack is not needed because there is a one-to-one mapping between
wxRasterOperationMode and QPainter::CompositionMode.
2026-09-09 00:11:31 +01:00
Vadim Zeitlin 3203a5222c Merge branch 'qt-frm-clntsize' of github.com:AliKet/wxWidgets
Fix wxFrame's client size under wxQt.

See #26982.
2026-09-09 00:20:38 +02:00
Vadim Zeitlin c79672192a Fix restoring TLWs whose geometry has become invalid under MSW
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.
2026-09-08 23:46:35 +02:00
ali kettab ac4f5979c2 Implement support for markup in wxQt wxStaticText 2026-09-08 16:02:18 +01:00
ali kettab d9d7f40596 wxQt: Override wxToolBar::DoSetToolBitmapSize() 2026-09-08 14:41:22 +01:00
ali kettab b6c9a46cbe wxQt: Exclude tool/menu/statusbar geometries from wxFrame's client size 2026-09-08 13:28:33 +01:00
Blake-Madden fd1576d9e8 Add keyboard accessibility to ribbon
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.
2026-09-08 13:53:58 +02:00
Steve Cornett 413b92c800 Fix wxUxThemeHandle for DPI 96 not system default
Use a special value other than 96 for STD_DPI. The value 96 might match a real DPI value that is not the system default.
2026-09-07 16:26:59 -07:00
Richard b3394e518a Preserve printer duplex defaults in wxMSW
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.
2026-09-07 23:52:18 +02:00
Vadim Zeitlin 6c08a692a6 Restore sending wxEVT_AUINOTEBOOK_BUTTON events
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.
2026-09-07 22:53:28 +02:00
Scott Talbert 78f03618a2 Fix spurious asserts when using wxHelpEvent under Wayland
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.
2026-09-07 17:57:52 +02:00
Vadim Zeitlin be09ff9c35 Check for gdk_wayland_window_get_xdg_toplevel() presence at run-time
This seems to be as simple as redeclaring it with the "weak" attribute
and then testing whether the pointer to the function is non-null.
2026-09-07 17:42:15 +02:00
Vadim Zeitlin a0d34a8bec Make wx-provided std::make_unique<> fallback work for arrays
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).
2026-09-05 16:07:44 +02:00
Vadim Zeitlin cd504ac8d8 Allow dragging and dropping floating AUI panes under Wayland too
Use StartDragSession() with the floating pane as the origin window.
2026-09-05 15:28:38 +02:00
Vadim Zeitlin 6761ea45fc Separate the TLW drag target window from the one being dragged
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.
2026-09-05 15:28:38 +02:00
Vadim Zeitlin 90380b06a7 Factor out wxTLWDragSession::IsAvailable()
Allow checking if TLW dragging is supported.

No real changes yet.
2026-09-05 15:28:38 +02:00
Vadim Zeitlin 00b1557138 Add wxSystemSettings::ExceedsDragThreshold() and use it
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.
2026-09-05 15:28:38 +02:00
Vadim Zeitlin 8acb90a9a0 Factor out wxAuiManager::SaveDockPositions()
This will allow reusing it from the code using wxTLWDragSession too.

No real changes yet.

This commit is best viewed with Git --color-moved option.
2026-09-05 15:28:38 +02:00
Vadim Zeitlin b60655776b Implement dragging and docking AUI panes under Wayland
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.
2026-09-05 15:28:38 +02:00
Vadim Zeitlin 32eb75983a Extract reusable functions used while dragging wxAUI panes
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.
2026-09-05 15:28:38 +02:00
Vadim Zeitlin 602423a2ec Add support for using XDG toplevel drag protocol
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.
2026-09-05 15:28:38 +02:00
ClaudeandVadim Zeitlin 63ebedec71 Fix possible crash in wxAuiManager::DoFrameLayout() on mouse move
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>
2026-09-05 15:28:11 +02:00
ClaudeandVadim Zeitlin 996d360a8f Initialize wxHtmlCellEvent's members in its default constructor
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>
2026-09-05 15:27:16 +02:00
Richard 53e793af35 Fix MSW wxFileSystemWatcher removal races
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.
2026-09-03 23:35:58 +02:00
Stefan Csomor 7697af0887 Turn off clipping in wxOSX composite controls automatically
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.
2026-09-01 14:32:32 +02:00
PB 847d9c645b Improve wxRendererXP::DrawGauge() in wxMSW dark mode
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.
2026-08-31 01:17:15 +02:00
Vadim Zeitlin 779d01f7ae Merge branch 'qt-fixes' of github.com:AliKet/wxWidgets
wxQt fixes and cleanups.

See #26949.
2026-08-31 01:04:40 +02:00
Paul Cornett 6155567922 Treat diagnostics from wxENABLE_EXTRA_WARNINGS as errors
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK UTF-8 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxQt (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxX11 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK 2 (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK gcc 7 static compatible 3.0 (push) Canceled after 0s
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxDFB (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Canceled after 0s
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Canceled after 0s
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Canceled after 0s
CMake builds / MSW/MSVC wxMSW (push) Canceled after 0s
CMake builds / MSW/Clang wxMSW (push) Canceled after 0s
CMake builds / macOS latest wxOSX Ninja (push) Canceled after 0s
CMake builds / macOS 14 wxOSX Xcode (push) Canceled after 0s
CMake builds / macOS 14 wxIOS (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 5.15 (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 6.10 (push) Canceled after 0s
Mac builds / wxMac ARM ASAN not compatible (push) Canceled after 0s
Mac builds / wxMac Universal C++14 (push) Canceled after 0s
Mac builds / wxiOS Simulator on Silicon Mac (push) Canceled after 0s
Mac builds / wxiOS (push) Canceled after 0s
Mac builds / wxMac Intel C++17 (push) Canceled after 0s
Mac Xcode builds / iOS Simulator static (push) Canceled after 0s
Mac Xcode builds / macOS dynamic Release (push) Canceled after 0s
Mac Xcode builds / iOS static Debug (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Release x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Debug Win32 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Release arm64 (push) Canceled after 0s
MSW builds / wxMSW vs2026 DLL Release x64 (push) Canceled after 0s
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
Otherwise they override -Werror
2026-08-29 00:07:25 -07:00
Paul Cornett f4fe6e2870 Use override in wxiOS code
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK UTF-8 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxQt (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxX11 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK 2 (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK gcc 7 static compatible 3.0 (push) Canceled after 0s
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxDFB (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Canceled after 0s
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Canceled after 0s
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Canceled after 0s
CMake builds / MSW/MSVC wxMSW (push) Canceled after 0s
CMake builds / MSW/Clang wxMSW (push) Canceled after 0s
CMake builds / macOS latest wxOSX Ninja (push) Canceled after 0s
CMake builds / macOS 14 wxOSX Xcode (push) Canceled after 0s
CMake builds / macOS 14 wxIOS (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 5.15 (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 6.10 (push) Canceled after 0s
Mac builds / wxMac ARM ASAN not compatible (push) Canceled after 0s
Mac builds / wxMac Universal C++14 (push) Canceled after 0s
Mac builds / wxiOS Simulator on Silicon Mac (push) Canceled after 0s
Mac builds / wxiOS (push) Canceled after 0s
Mac builds / wxMac Intel C++17 (push) Canceled after 0s
Mac Xcode builds / iOS Simulator static (push) Canceled after 0s
Mac Xcode builds / macOS dynamic Release (push) Canceled after 0s
Mac Xcode builds / iOS static Debug (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Release x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Debug Win32 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Release arm64 (push) Canceled after 0s
MSW builds / wxMSW vs2026 DLL Release x64 (push) Canceled after 0s
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
2026-08-28 16:29:18 -07:00
Paul Cornett 2420ded403 Fix suppression of -Wdouble-promotion warning 2026-08-28 16:29:18 -07:00
ali kettab 956ec42eec wxQt: Make border flags apply to some wxWindows
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).
2026-08-28 19:52:20 +01:00
Paul Cornett cffa74e2bc Drop unused parameters from wxWidgetIPhoneImpl::controlAction()
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK UTF-8 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxQt (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxX11 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK 2 (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK gcc 7 static compatible 3.0 (push) Canceled after 0s
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxDFB (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Canceled after 0s
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Canceled after 0s
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Canceled after 0s
CMake builds / MSW/MSVC wxMSW (push) Canceled after 0s
CMake builds / MSW/Clang wxMSW (push) Canceled after 0s
CMake builds / macOS latest wxOSX Ninja (push) Canceled after 0s
CMake builds / macOS 14 wxOSX Xcode (push) Canceled after 0s
CMake builds / macOS 14 wxIOS (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 5.15 (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 6.10 (push) Canceled after 0s
Mac builds / wxMac ARM ASAN not compatible (push) Canceled after 0s
Mac builds / wxMac Universal C++14 (push) Canceled after 0s
Mac builds / wxiOS Simulator on Silicon Mac (push) Canceled after 0s
Mac builds / wxiOS (push) Canceled after 0s
Mac builds / wxMac Intel C++17 (push) Canceled after 0s
Mac Xcode builds / iOS Simulator static (push) Canceled after 0s
Mac Xcode builds / macOS dynamic Release (push) Canceled after 0s
Mac Xcode builds / iOS static Debug (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
And correct parameter type for wxUITextFieldControl override,
which eliminates -Woverloaded-virtual warning.
2026-08-27 17:30:11 -07:00
got3nks 44efecda41 Use a per-descriptor wrapper in wxEpollDispatcher instead of a map
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.
2026-08-26 22:59:04 +02:00
Daniel Kulp e3c466eb71 Support wxFileDialog extra controls in sandboxed apps on macOS
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.
2026-08-26 20:17:19 +02:00
Steve Cornett fcc0fedd0d Implement dark mode support for Windows common dialogs
Unix builds / Ubuntu 24.04 wxGTK ASAN not compatible (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK UTF-8 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxQt (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxX11 (push) Canceled after 0s
Unix builds / Ubuntu 26.04 wxGTK 2 (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK 3 with clang (push) Canceled after 0s
Unix builds / Ubuntu 20.04 wxGTK gcc 7 static compatible 3.0 (push) Canceled after 0s
Unix builds / Ubuntu 22.04 wxGTK with wx containers (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxDFB (push) Canceled after 0s
Unix builds / Ubuntu 24.04 wxGTK UBSAN (push) Canceled after 0s
CMake builds / Ubuntu 22.04 wxGTK 3 (push) Canceled after 0s
CMake builds / macOS latest wxGTK 3 Unix Makefiles (push) Canceled after 0s
CMake builds / MSW/MSVC wxMSW (push) Canceled after 0s
CMake builds / MSW/Clang wxMSW (push) Canceled after 0s
CMake builds / macOS latest wxOSX Ninja (push) Canceled after 0s
CMake builds / macOS 14 wxOSX Xcode (push) Canceled after 0s
CMake builds / macOS 14 wxIOS (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 5.15 (push) Canceled after 0s
CMake builds / MSW/MSVC wxQt 6.10 (push) Canceled after 0s
Mac builds / wxMac ARM ASAN not compatible (push) Canceled after 0s
Mac builds / wxMac Universal C++14 (push) Canceled after 0s
Mac builds / wxiOS Simulator on Silicon Mac (push) Canceled after 0s
Mac builds / wxiOS (push) Canceled after 0s
Mac builds / wxMac Intel C++17 (push) Canceled after 0s
Mac Xcode builds / iOS Simulator static (push) Canceled after 0s
Mac Xcode builds / macOS dynamic Release (push) Canceled after 0s
Mac Xcode builds / iOS static Debug (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Debug x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 DLL Release x64 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Debug Win32 (push) Canceled after 0s
MSW builds / wxMSW vs2022 Release arm64 (push) Canceled after 0s
MSW builds / wxMSW vs2026 DLL Release x64 (push) Canceled after 0s
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.
2026-08-26 19:22:44 +02:00
PBandVadim Zeitlin 3c6fb85431 Make scrollbar corner painting work in RTL layout too
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>
2026-08-26 19:15:59 +02:00
got3nks ddd1e72ee4 Don't call handlers unregistered during wxEpollDispatcher::Dispatch()
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.
2026-08-26 18:05:26 +02:00