From a04eb53822d306435f4efaba36225bc3bd297f5d Mon Sep 17 00:00:00 2001 From: Crementif <26669564+Crementif@users.noreply.github.com> Date: Thu, 12 Mar 2026 21:58:22 +0100 Subject: [PATCH] vcpkg: Update wxWidgets to 3.3.2 (#1824) --- .../wxwidgets/fix-listctrl-layout.patch | 40 +++++++++++++++++++ .../wxwidgets/portfile.cmake | 9 +++-- .../vcpkg_overlay_ports/wxwidgets/vcpkg.json | 2 +- src/gui/wxgui/components/wxGameList.cpp | 4 +- 4 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 dependencies/vcpkg_overlay_ports/wxwidgets/fix-listctrl-layout.patch diff --git a/dependencies/vcpkg_overlay_ports/wxwidgets/fix-listctrl-layout.patch b/dependencies/vcpkg_overlay_ports/wxwidgets/fix-listctrl-layout.patch new file mode 100644 index 00000000..4da35fb3 --- /dev/null +++ b/dependencies/vcpkg_overlay_ports/wxwidgets/fix-listctrl-layout.patch @@ -0,0 +1,40 @@ +diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp +index 5e1cd98a8b..169ab7847d 100644 +--- a/src/msw/listctrl.cpp ++++ b/src/msw/listctrl.cpp +@@ -1385,20 +1385,29 @@ bool wxListCtrl::GetSubItemRect(long item, long subItem, wxRect& rect, int code) + + wxCopyRECTToRect(rectWin, rect); + +- // We can't use wxGetListCtrlSubItemRect() for the 0th subitem as 0 means +- // the entire row for this function, so we need to calculate it ourselves. +- if ( subItem == 0 && code == wxLIST_RECT_BOUNDS ) ++ // We can't trust the native LVM_GETSUBITEMRECT for LVIR_BOUNDS because: ++ // - subitem 0 returns the entire row bounds, not just column 0 ++ // - when column 0 is narrower than the icon, the native control clamps ++ // all subitems' left edge to at least the icon width, misaligning them ++ // ++ // So for all subitems we calculate x and width from GetColumnWidth() in ++ // visual (column order) order, which always reflects the real column sizes. ++ if ( subItem != wxLIST_GETSUBITEMRECT_WHOLEITEM && code == wxLIST_RECT_BOUNDS ) + { +- // Because the columns can be reordered, we need to sum the widths of +- // all preceding columns to get the correct x position. ++ // Start from the row's left edge (which accounts for scrolling). ++ RECT rowRect; ++ wxGetListCtrlItemRect(GetHwnd(), item, LVIR_BOUNDS, rowRect); ++ int x = rowRect.left; ++ + for ( auto col : GetColumnsOrder() ) + { + if ( col == subItem ) + break; + +- rect.x += GetColumnWidth(col); ++ x += GetColumnWidth(col); + } + ++ rect.x = x; + rect.width = GetColumnWidth(subItem); + } + diff --git a/dependencies/vcpkg_overlay_ports/wxwidgets/portfile.cmake b/dependencies/vcpkg_overlay_ports/wxwidgets/portfile.cmake index d9962958..a0c801df 100644 --- a/dependencies/vcpkg_overlay_ports/wxwidgets/portfile.cmake +++ b/dependencies/vcpkg_overlay_ports/wxwidgets/portfile.cmake @@ -1,8 +1,8 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wxWidgets/wxWidgets - REF "bfd436b" - SHA512 bd3fd6d0d0db3b6fa34eceae1119e21ffd2f62221dcd249f8b8b82a6e65d83a05101e4e1e4ca9b9c4d7937add73b113bb029b03b05d2c3d87d17c1922d800a24 + REF "v${VERSION}" + SHA512 c47460c8bc150445e7774a287a79bd70b6d96b91ea46b51f238a317f068e466d570c5a94e2204d112e42da781a5cef98236718efff4b7f539d61a12ceaf65eb7 HEAD_REF master PATCHES install-layout.patch @@ -12,14 +12,15 @@ vcpkg_from_github( fix-pcre2.patch gtk3-link-libraries.patch sdl2.patch + fix-listctrl-layout.patch ) # Submodule dependencies vcpkg_from_github( OUT_SOURCE_PATH lexilla_SOURCE_PATH REPO wxWidgets/lexilla - REF "27c20a6ae5eebf418debeac0166052ed6fb653bc" - SHA512 7e5de7f664509473b691af8261fca34c2687772faca7260eeba5f2984516e6f8edf88c27192e056c9dda996e2ad2c20f6d1dff1c4bd2f3c0d74852cb50ca424a + REF "0dbce0b418b8b3d2ef30304d0bf53ff58c07ed84" + SHA512 61f7b0217f4518121ecad32f015b53600e565bdd499d4020468cf6c8a533d516c6881115aa5e640afca5ea428535f47680cde426fa3dbabe9e4423b4526853fd HEAD_REF wx ) file(COPY "${lexilla_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/src/stc/lexilla") diff --git a/dependencies/vcpkg_overlay_ports/wxwidgets/vcpkg.json b/dependencies/vcpkg_overlay_ports/wxwidgets/vcpkg.json index 132f4fe3..542027c8 100644 --- a/dependencies/vcpkg_overlay_ports/wxwidgets/vcpkg.json +++ b/dependencies/vcpkg_overlay_ports/wxwidgets/vcpkg.json @@ -1,6 +1,6 @@ { "name": "wxwidgets", - "version": "3.3.1", + "version": "3.3.2", "description": [ "Widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. ", "Set WXWIDGETS_USE_STL in a custom triplet to build with the wxUSE_STL build option.", diff --git a/src/gui/wxgui/components/wxGameList.cpp b/src/gui/wxgui/components/wxGameList.cpp index cf77119a..a1e5142d 100644 --- a/src/gui/wxgui/components/wxGameList.cpp +++ b/src/gui/wxgui/components/wxGameList.cpp @@ -304,7 +304,7 @@ int wxGameList::GetColumnDefaultWidth(int column) switch (column) { case ColumnIcon: - return kListIconWidth; + return kListIconWidth+2; case ColumnName: return DefaultColumnSize::name; case ColumnVersion: @@ -994,7 +994,7 @@ void wxGameList::ApplyGameListColumnWidths() const auto& config = GetWxGUIConfig(); wxWindowUpdateLocker lock(this); if(config.show_icon_column) - SetColumnWidth(ColumnIcon, kListIconWidth); + SetColumnWidth(ColumnIcon, kListIconWidth+2); else SetColumnWidth(ColumnIcon, 0); SetColumnWidth(ColumnName, config.column_width.name);