[Git][wxwidgets/wxwidgets][master] 13 commits: Correct wxFileConfig paths documentation

0 views
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Apr 18, 2026, 6:35:32 PM (14 hours ago) Apr 18
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 218217a0
    by Vadim Zeitlin at 2026-04-16T19:34:51+02:00
    Correct wxFileConfig paths documentation
    
    Explain that while the default files in $HOME are used if they exist,
    new files are created in XDG-compliant location even if XDG compliance
    is not explicitly enabled.
    
  • 64b5217e
    by mcorino at 2026-04-17T15:10:58+02:00
    Update wxRibbonPage documentation after wxBitmapBundle changes
    
    This should have been part of 722f58e238 (Refactor wxRibbon to use
    wxBitmapBundle for icons and images, 2026-01-25), see #26117.
    
    Closes #26390.
    
  • 09321123
    by Steve Cornett at 2026-04-18T15:23:40+02:00
    Fix linking with RTTI disabled
    
    Don't reference ms_wxDummy variable which was never defined in the
    version of WX_DECLARE_TYPEINFO_INLINE() macro used when compiler RTTI
    support is disabled, as this resulted in link errors.
    
    Just remove this variable completely.
    
    Closes #26389.
    
  • d2f572bd
    by Vadim Zeitlin at 2026-04-18T16:45:38+02:00
    Define WX_ATTRIBUTE_UNUSED correctly for clang-cl
    
    It needs the usual clang definition of this attribute to avoid warnings
    about unused local typedefs in wxDELETE[A] but the macro was defined as
    empty for it because clang-cl doesn't predefine __GNUC__ (it predefines
    _MSC_VER instead).
    
  • ec7255f4
    by Vadim Zeitlin at 2026-04-18T16:51:53+02:00
    Remove "extern" from wxGlobalSEInformation definition
    
    This is not needed here and results in -Wexternal-linkage from clang.
    
  • dcec891a
    by Vadim Zeitlin at 2026-04-18T17:04:21+02:00
    Use WinStruct<> instead of manually initializing HIGHCONTRAST
    
    This is simpler and avoids clang warning about missing field
    initializers.
    
  • f8cef129
    by Alex Shvartzkop at 2026-04-18T17:35:56+02:00
    Really fix wxGLCanvas position inside wxPopupWindow with Wayland
    
    The change of 5a42ec7453 (Fix position of wxGLCanvas inside a
    wxPopupWindow under Wayland, 2026-04-12) didn't work correctly when the
    canvas was not a direct child of the popup.
    
    Compute the offset of the canvas from the top level window correctly in
    all cases by subtracting their origins.
    
    Closes #26250.
    
  • 9c9858ab
    by Vadim Zeitlin at 2026-04-18T17:50:03+02:00
    Make wxToastEventHandler final to avoid warnings when deleting it
    
    This class doesn't have, and doesn't need, a virtual dtor but does have
    virtual functions, which triggered clang warnings on "delete this" line.
    
    Make it "final" to avoid the warning without unnecessarily making the
    dtor virtual.
    
  • 60b54505
    by Vadim Zeitlin at 2026-04-18T17:50:03+02:00
    Add a cast to suppress signed/unsigned comparison warning
    
    StretchDIBits() return value is int, while GDI_ERROR is unsigned, so add
    a cast before comparing them to avoid clang warning.
    
  • 892fb7f2
    by Vadim Zeitlin at 2026-04-18T18:19:54+02:00
    Use "__declspec(nothrow)" when overriding IUnknown functions
    
    Use STDMETHOD and STDMETHOD_ macros instead of STDMETHODIMP[_] to get
    the Microsoft-specific exception specification which is present in the
    former macros but not the latter ones and avoid clang warning about
    overriding the base class virtual function using laxer exception
    specification.
    
  • 8933626b
    by Vadim Zeitlin at 2026-04-19T00:24:01+02:00
    Slightly simplify and make more robust CMake version parsing
    
    Check that we parsed all version components and avoid doing 2 regex
    matches for every component when we can just use CMAKE_MATCH_1 directly.
    
    See #26382.
    
  • 8ef84ab4
    by Vadim Zeitlin at 2026-04-19T00:24:57+02:00
    Don't use /MP option when not using MSVS CMake generator
    
    It is useless in this case as make/Ninja generators only compile a
    single file at once anyhow and can also be harmful when using clang-cl
    compiler which gives warnings about unsupported option.
    
    See #26392.
    
  • 6026d2f6
    by Vadim Zeitlin at 2026-04-19T00:26:46+02:00
    Merge branch 'clang-cl-fixes'
    
    Fix multiple clang-cl warnings in wxMSW build.
    
    See #26393.
    

13 changed files:

Changes:

  • CMakeLists.txt
    ... ... @@ -52,18 +52,18 @@ set(wxOUTPUT_DIR ${wxBINARY_DIR}/lib)
    52 52
     
    
    53 53
     # parse the version number from wx/version.h and include in wxMAJOR_VERSION and wxMINOR_VERSION
    
    54 54
     file(READ "${wxSOURCE_DIR}/include/wx/version.h" WX_VERSION_H_CONTENTS)
    
    55
    -string(REGEX MATCH "wxMAJOR_VERSION[ \t]+([0-9]+)"
    
    56
    -    wxMAJOR_VERSION ${WX_VERSION_H_CONTENTS})
    
    57
    -string (REGEX MATCH "([0-9]+)"
    
    58
    -    wxMAJOR_VERSION ${wxMAJOR_VERSION})
    
    59
    -string(REGEX MATCH "wxMINOR_VERSION[ \t]+([0-9]+)"
    
    60
    -    wxMINOR_VERSION ${WX_VERSION_H_CONTENTS})
    
    61
    -string (REGEX MATCH "([0-9]+)"
    
    62
    -    wxMINOR_VERSION ${wxMINOR_VERSION})
    
    63
    -string(REGEX MATCH "wxRELEASE_NUMBER[ \t]+([0-9]+)"
    
    64
    -    wxRELEASE_NUMBER ${WX_VERSION_H_CONTENTS})
    
    65
    -string (REGEX MATCH "([0-9]+)"
    
    66
    -    wxRELEASE_NUMBER ${wxRELEASE_NUMBER})
    
    55
    +
    
    56
    +macro(wx_extract_version_component name)
    
    57
    +    string(REGEX MATCH "# *define +${name} +([0-9]+)" _dummy ${WX_VERSION_H_CONTENTS})
    
    58
    +    if("${CMAKE_MATCH_1}" STREQUAL "")
    
    59
    +        message(FATAL_ERROR "Failed to extract ${name} from wx/version.h")
    
    60
    +    endif()
    
    61
    +    set(${name} ${CMAKE_MATCH_1})
    
    62
    +endmacro()
    
    63
    +
    
    64
    +wx_extract_version_component(wxMAJOR_VERSION)
    
    65
    +wx_extract_version_component(wxMINOR_VERSION)
    
    66
    +wx_extract_version_component(wxRELEASE_NUMBER)
    
    67 67
     
    
    68 68
     # Determine if current version is a "Development" release
    
    69 69
     math(EXPR rel_dev "${wxMINOR_VERSION} % 2")
    

  • build/cmake/init.cmake
    ... ... @@ -107,7 +107,7 @@ if(MSVC)
    107 107
         wx_string_append(CMAKE_EXE_LINKER_FLAGS_RELEASE "${MSVC_PDB_FLAG}")
    
    108 108
         wx_string_append(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${MSVC_PDB_FLAG}")
    
    109 109
     
    
    110
    -    if(wxBUILD_MSVC_MULTIPROC)
    
    110
    +    if(wxBUILD_MSVC_MULTIPROC AND ${CMAKE_GENERATOR} MATCHES "Visual Studio")
    
    111 111
             wx_string_append(CMAKE_C_FLAGS " /MP")
    
    112 112
             wx_string_append(CMAKE_CXX_FLAGS " /MP")
    
    113 113
         endif()
    

  • include/wx/defs.h
    ... ... @@ -495,7 +495,7 @@ int wxSsize(const C& c)
    495 495
     #   endif
    
    496 496
     #endif
    
    497 497
     
    
    498
    -#if defined(__GNUC__)
    
    498
    +#if defined(__GNUC__) || defined(__clang__)
    
    499 499
         #define WX_ATTRIBUTE_UNUSED __attribute__ ((unused))
    
    500 500
     #else
    
    501 501
         #define WX_ATTRIBUTE_UNUSED
    

  • include/wx/msw/ole/comimpl.h
    ... ... @@ -90,9 +90,9 @@ private:
    90 90
     
    
    91 91
     #define   DECLARE_IUNKNOWN_METHODS                                            \
    
    92 92
       public:                                                                     \
    
    93
    -    STDMETHODIMP          QueryInterface(REFIID, void **) override;         \
    
    94
    -    STDMETHODIMP_(ULONG)  AddRef() override;                                \
    
    95
    -    STDMETHODIMP_(ULONG)  Release() override;                               \
    
    93
    +    STDMETHOD(QueryInterface) (REFIID, void **) override;                     \
    
    94
    +    STDMETHOD_(ULONG, AddRef) () override;                                    \
    
    95
    +    STDMETHOD_(ULONG, Release) () override;                                   \
    
    96 96
       private:                                                                    \
    
    97 97
         static  const IID    *ms_aIids[];                                         \
    
    98 98
         wxAutoULong           m_cRef
    
    ... ... @@ -107,6 +107,7 @@ private:
    107 107
     // implementation is as straightforward as possible
    
    108 108
     // Parameter:  classname - the name of the class
    
    109 109
     #define   IMPLEMENT_IUNKNOWN_METHODS(classname)                               \
    
    110
    +  COM_DECLSPEC_NOTHROW                                                        \
    
    110 111
       STDMETHODIMP classname::QueryInterface(REFIID riid, void **ppv)             \
    
    111 112
       {                                                                           \
    
    112 113
         wxLogQueryInterface(wxT(#classname), riid);                               \
    
    ... ... @@ -124,6 +125,7 @@ private:
    124 125
         }                                                                         \
    
    125 126
       }                                                                           \
    
    126 127
                                                                                   \
    
    128
    +  COM_DECLSPEC_NOTHROW                                                        \
    
    127 129
       STDMETHODIMP_(ULONG) classname::AddRef()                                    \
    
    128 130
       {                                                                           \
    
    129 131
         wxLogAddRef(wxT(#classname), m_cRef);                                     \
    
    ... ... @@ -131,6 +133,7 @@ private:
    131 133
         return ++m_cRef;                                                          \
    
    132 134
       }                                                                           \
    
    133 135
                                                                                   \
    
    136
    +  COM_DECLSPEC_NOTHROW                                                        \
    
    134 137
       STDMETHODIMP_(ULONG) classname::Release()                                   \
    
    135 138
       {                                                                           \
    
    136 139
         wxLogRelease(wxT(#classname), m_cRef);                                    \
    

  • include/wx/msw/private/metrics.h
    ... ... @@ -40,7 +40,7 @@ inline const NONCLIENTMETRICS GetNonClientMetrics(const wxWindow* win)
    40 40
     // Check whether high contrast mode is on.
    
    41 41
     inline bool IsHighContrast()
    
    42 42
     {
    
    43
    -    HIGHCONTRAST hc = { sizeof(hc) };
    
    43
    +    WinStruct<HIGHCONTRAST> hc;
    
    44 44
     
    
    45 45
         if ( !::SystemParametersInfo(SPI_GETHIGHCONTRAST, sizeof(hc), &hc, 0) )
    
    46 46
         {
    

  • include/wx/typeinfo.h
    ... ... @@ -129,8 +129,7 @@ void CLS::ms_wxClassInfo() { ms_wxDummy = 0; }
    129 129
     // Use this macro to declare type info fully inline in class.
    
    130 130
     #define WX_DECLARE_TYPEINFO_INLINE(CLS) \
    
    131 131
     private: \
    
    132
    -    static char ms_wxDummy; \
    
    133
    -    static void ms_wxClassInfo() { ms_wxDummy = 0; } \
    
    132
    +    static void ms_wxClassInfo() { } \
    
    134 133
     _WX_DECLARE_TYPEINFO_CUSTOM(CLS, ms_wxClassInfo)
    
    135 134
     
    
    136 135
     #define wxTypeId(OBJ) (OBJ).GetWxTypeId()
    

  • interface/wx/fileconf.h
    ... ... @@ -20,19 +20,25 @@
    20 20
     
    
    21 21
         @section fileconf_paths Configuration Files Paths
    
    22 22
     
    
    23
    -    The default path for local (or user) configuration file is `~/.appname`,
    
    24
    -    i.e. it is stored directly in the user home directory. This default
    
    25
    -    path is backwards-compatible but not recommended any more and it is advised
    
    26
    -    to call wxStandardPaths::SetFileLayout() with
    
    27
    -    wxStandardPaths::FileLayout_XDG parameter to change the default path to
    
    28
    -    `~/.config/appname.conf`. MigrateLocalFile() may be helpful for moving the
    
    29
    -    existing configuration file to the new location.
    
    30
    -
    
    31
    -    Alternatively, it is possible to specify ::wxCONFIG_USE_XDG flag in the
    
    32
    -    style parameter of the constructor to use this XDG-compliant path without
    
    33
    -    changing the global file layout.
    
    34
    -
    
    35
    -    And for the programs using multiple configuration files it is recommended
    
    23
    +    The default behaviour is to use the existing local (or user) configuration
    
    24
    +    file in `~/.appname` if it exists, but to create new configuration files in
    
    25
    +    the XDG-compliant location under `~/.config/appname.conf`, where `appname`
    
    26
    +    is the return value of wxAppConsole::GetAppName() (unless overridden by the
    
    27
    +    constructor parameter with the same name). This is compatible with the
    
    28
    +    existing installations, using legacy convention for the configuration
    
    29
    +    files, but automatically uses the new and preferred XDG convention for the
    
    30
    +    new installations.
    
    31
    +
    
    32
    +    You may call wxStandardPaths::SetFileLayout() with
    
    33
    +    wxStandardPaths::FileLayout_XDG parameter or specify ::wxCONFIG_USE_XDG
    
    34
    +    flag in the style parameter of the constructor to always use the
    
    35
    +    XDG-compliant location. If you do this, MigrateLocalFile() may be helpful
    
    36
    +    for moving the existing configuration file to the new location.
    
    37
    +
    
    38
    +    Alternatively, ::wxCONFIG_USE_HOME flag may be used to use the legacy
    
    39
    +    location, but this is not recommended.
    
    40
    +
    
    41
    +    For the programs using multiple configuration files it is recommended
    
    36 42
         to use both ::wxCONFIG_USE_XDG and ::wxCONFIG_USE_SUBDIR which change the
    
    37 43
         default file path to `~/.config/appname/appname.conf` -- and allow the
    
    38 44
         program to store other files in the same `~/.config/appname` directory.
    

  • interface/wx/ribbon/page.h
    ... ... @@ -46,7 +46,7 @@ public:
    46 46
         wxRibbonPage(wxRibbonBar* parent,
    
    47 47
                     wxWindowID id = wxID_ANY,
    
    48 48
                     const wxString& label = wxEmptyString,
    
    49
    -                const wxBitmap& icon = wxNullBitmap,
    
    49
    +                const wxBitmapBundle& icon = wxBitmapBundle(),
    
    50 50
                     long style = 0);
    
    51 51
     
    
    52 52
         /**
    
    ... ... @@ -62,7 +62,7 @@ public:
    62 62
         bool Create(wxRibbonBar* parent,
    
    63 63
                     wxWindowID id = wxID_ANY,
    
    64 64
                     const wxString& label = wxEmptyString,
    
    65
    -                const wxBitmap& icon = wxNullBitmap,
    
    65
    +                const wxBitmapBundle& icon = wxBitmapBundle(),
    
    66 66
                     long style = 0);
    
    67 67
     
    
    68 68
         /**
    
    ... ... @@ -78,7 +78,15 @@ public:
    78 78
             Get the icon used for the page in the ribbon bar tab area (only
    
    79 79
             displayed if the ribbon bar is actually showing icons).
    
    80 80
         */
    
    81
    -    wxBitmap& GetIcon();
    
    81
    +    wxBitmap GetIcon();
    
    82
    +
    
    83
    +    /**
    
    84
    +        Get the icon bundle used for the page in the ribbon bar tab area (only
    
    85
    +        displayed if the ribbon bar is actually showing icons).
    
    86
    +
    
    87
    +        @since 3.3.3
    
    88
    +    */
    
    89
    +    const wxBitmapBundle& GetIconBundle() const;
    
    82 90
     
    
    83 91
         /**
    
    84 92
             Set the size of the page and the external scroll buttons (if any).
    

  • src/msw/dcprint.cpp
    ... ... @@ -344,7 +344,7 @@ bool DrawBitmapUsingStretchDIBits(HDC hdc,
    344 344
                     (LPBITMAPINFO)&ds.dsBmih,
    
    345 345
                     DIB_RGB_COLORS,
    
    346 346
                     SRCCOPY
    
    347
    -            ) == GDI_ERROR )
    
    347
    +            ) == static_cast<int>(GDI_ERROR) )
    
    348 348
         {
    
    349 349
             wxLogLastError(wxT("StretchDIBits"));
    
    350 350
     
    

  • src/msw/main.cpp
    ... ... @@ -56,7 +56,7 @@ extern int wxEntryReal(int& argc, wxChar **argv);
    56 56
     
    
    57 57
     // global pointer to exception information, only valid inside OnFatalException,
    
    58 58
     // used by wxStackWalker and wxCrashReport
    
    59
    -extern EXCEPTION_POINTERS *wxGlobalSEInformation = nullptr;
    
    59
    +EXCEPTION_POINTERS *wxGlobalSEInformation = nullptr;
    
    60 60
     
    
    61 61
     // flag telling us whether the application wants to handle exceptions at all
    
    62 62
     static bool gs_handleExceptions = false;
    

  • src/msw/rt/notifmsgrt.cpp
    ... ... @@ -44,7 +44,7 @@ typedef ABI::Windows::Foundation::ITypedEventHandler<ToastNotification *, ToastF
    44 44
     
    
    45 45
     class wxToastNotifMsgImpl;
    
    46 46
     
    
    47
    -class wxToastEventHandler :
    
    47
    +class wxToastEventHandler final :
    
    48 48
         public Microsoft::WRL::Implements<DesktopToastActivatedEventHandler, DesktopToastDismissedEventHandler, DesktopToastFailedEventHandler>
    
    49 49
     {
    
    50 50
     public:
    

  • src/msw/webview_ie.cpp
    ... ... @@ -1622,6 +1622,7 @@ VirtualProtocol::VirtualProtocol(wxSharedPtr<wxWebViewHandler> handler)
    1622 1622
         m_handler = handler;
    
    1623 1623
     }
    
    1624 1624
     
    
    1625
    +COM_DECLSPEC_NOTHROW
    
    1625 1626
     STDMETHODIMP VirtualProtocol::QueryInterface(REFIID riid, void **ppv)
    
    1626 1627
     {
    
    1627 1628
         wxLogQueryInterface(wxT("VirtualProtocol"), riid);
    
    ... ... @@ -1660,12 +1661,14 @@ STDMETHODIMP VirtualProtocol::QueryInterface(REFIID riid, void **ppv)
    1660 1661
         return (HRESULT) E_NOINTERFACE;
    
    1661 1662
     }
    
    1662 1663
     
    
    1664
    +COM_DECLSPEC_NOTHROW
    
    1663 1665
     STDMETHODIMP_(ULONG) VirtualProtocol::AddRef()
    
    1664 1666
     {
    
    1665 1667
         wxLogAddRef(wxT("VirtualProtocol"), m_cRef);
    
    1666 1668
         return ++m_cRef;
    
    1667 1669
     }
    
    1668 1670
     
    
    1671
    +COM_DECLSPEC_NOTHROW
    
    1669 1672
     STDMETHODIMP_(ULONG) VirtualProtocol::Release()
    
    1670 1673
     {
    
    1671 1674
         wxLogRelease(wxT("VirtualProtocol"), m_cRef);
    

  • src/unix/glegl.cpp
    ... ... @@ -448,8 +448,24 @@ void wxGLCanvasEGL::UpdateSubsurfacePosition()
    448 448
             return;
    
    449 449
         }
    
    450 450
     
    
    451
    +    // We need to position the subsurface at the canvas window position inside
    
    452
    +    // its top level ancestor, so get it by computing the offset between the
    
    453
    +    // canvas origin and the window origin.
    
    454
    +    //
    
    455
    +    // We could also use gtk_widget_translate_coordinates() or call
    
    456
    +    // gdk_window_get_position() recursively until we reach the top level
    
    457
    +    // ancestor, but this way is even simpler and seems to work fine.
    
    458
    +    GtkWidget* const toplevel = gtk_widget_get_toplevel(m_canvas->m_widget);
    
    459
    +
    
    460
    +    int tlwx, tlwy;
    
    461
    +    gdk_window_get_origin(gtk_widget_get_window(toplevel), &tlwx, &tlwy);
    
    462
    +
    
    451 463
         int x, y;
    
    452
    -    gdk_window_get_position(m_canvas->GTKGetDrawingWindow(), &x, &y);
    
    464
    +    gdk_window_get_origin(m_canvas->GTKGetDrawingWindow(), &x, &y);
    
    465
    +
    
    466
    +    x -= tlwx;
    
    467
    +    y -= tlwy;
    
    468
    +
    
    453 469
         wl_subsurface_set_position(m_wlSubsurface, x, y);
    
    454 470
     }
    
    455 471
     
    

Reply all
Reply to author
Forward
0 new messages