From 22c64282ea4af03bd4e3ce85a435c1bc428e2f8c Mon Sep 17 00:00:00 2001 From: Crementif <26669564+Crementif@users.noreply.github.com> Date: Tue, 8 Jul 2025 02:23:51 +0200 Subject: [PATCH] build: Don't build wxWidgets with audio support, like before "debug-support" is now less-optional as it was before, and not including it breaks the debug builds of Cemu. Might have to figure this out further. --- .../fix-wxtextctrl-dark-mode-msw.patch | 82 +++++++++++++++++++ vcpkg.json | 8 +- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 dependencies/vcpkg_overlay_ports/wxwidgets/fix-wxtextctrl-dark-mode-msw.patch diff --git a/dependencies/vcpkg_overlay_ports/wxwidgets/fix-wxtextctrl-dark-mode-msw.patch b/dependencies/vcpkg_overlay_ports/wxwidgets/fix-wxtextctrl-dark-mode-msw.patch new file mode 100644 index 00000000..8584baaa --- /dev/null +++ b/dependencies/vcpkg_overlay_ports/wxwidgets/fix-wxtextctrl-dark-mode-msw.patch @@ -0,0 +1,82 @@ +diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp +index 3bdb2c5699bf..96225f19f849 100644 +--- a/src/msw/textctrl.cpp ++++ b/src/msw/textctrl.cpp +@@ -50,6 +50,7 @@ + #include + + #include "wx/msw/private.h" ++#include "wx/msw/private/darkmode.h" + #include "wx/msw/winundef.h" + + #include +@@ -473,9 +474,10 @@ bool wxTextCtrl::Create(wxWindow *parent, + if ( !MSWCreateText(value, pos, size) ) + return false; + +-#if wxUSE_DRAG_AND_DROP && wxUSE_RICHEDIT ++#if wxUSE_RICHEDIT + if ( IsRich() ) + { ++#if wxUSE_DRAG_AND_DROP + // rich text controls have a default associated drop target which + // allows them to receive (rich) text dropped on them, which is nice, + // but prevents us from associating a user-defined drop target with +@@ -484,8 +486,16 @@ bool wxTextCtrl::Create(wxWindow *parent, + // to make it work, we set m_dropTarget to this special value initially + // and check for it in our SetDropTarget() + m_dropTarget = wxRICHTEXT_DEFAULT_DROPTARGET; ++#endif // wxUSE_DRAG_AND_DROP ++ ++ if ( wxMSWDarkMode::IsActive() ) ++ { ++ // We need to set the colours explicitly for rich text controls. ++ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); ++ SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT)); ++ } + } +-#endif // wxUSE_DRAG_AND_DROP && wxUSE_RICHEDIT ++#endif // wxUSE_RICHEDIT + + return true; + } +@@ -501,9 +511,6 @@ bool wxTextCtrl::MSWCreateText(const wxString& value, + const wxPoint& pos, + const wxSize& size) + { +- // translate wxWin style flags to MSW ones +- WXDWORD msStyle = MSWGetCreateWindowFlags(); +- + // do create the control - either an EDIT or RICHEDIT + wxString windowClass = wxT("EDIT"); + +@@ -624,7 +631,7 @@ bool wxTextCtrl::MSWCreateText(const wxString& value, + // implementation detail + m_updatesCount = -2; + +- if ( !MSWCreateControl(windowClass.t_str(), msStyle, pos, size, valueWin) ) ++ if ( !MSWCreateControl(windowClass.t_str(), valueWin, pos, size) ) + { + // There is one case in which window creation may realistically fail + // and this is when we create a plain EDIT control with too long text, +@@ -647,6 +654,20 @@ bool wxTextCtrl::MSWCreateText(const wxString& value, + #if wxUSE_RICHEDIT + if (IsRich()) + { ++ // RICHEDIT50W automatically adds WS_EX_CLIENTEDGE to its style for ++ // some reason and while this isn't very noticeable in light mode, it ++ // looks really bad in dark mode, so forcibly remove it unless it was ++ // explicitly requested. ++ if ( GetBorder() != wxBORDER_SUNKEN && wxMSWDarkMode::IsActive() ) ++ { ++ const auto origExStyle = ::GetWindowLongPtr(GetHwnd(), GWL_EXSTYLE); ++ if ( origExStyle & WS_EX_CLIENTEDGE ) ++ { ++ ::SetWindowLongPtr(GetHwnd(), GWL_EXSTYLE, ++ origExStyle & ~WS_EX_CLIENTEDGE); ++ } ++ } ++ + #if wxUSE_INKEDIT + if (IsInkEdit()) + { diff --git a/vcpkg.json b/vcpkg.json index 15f9a707..53febd2e 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -34,7 +34,13 @@ "default-features": false }, "zstd", - "wxwidgets", + { + "name": "wxwidgets", + "features": [ + "debug-support" + ], + "default-features": false + }, "openssl", { "name": "curl",