[Git][wxwidgets/wxwidgets][master] 2 commits: Check that page inserted in wxAuiNotebook has correct parent

1 view
Skip to first unread message

Vadim Zeitlin (@_VZ_)

unread,
Jun 16, 2026, 9:11:21 AM (10 days ago) Jun 16
to wx-commi...@googlegroups.com

Vadim Zeitlin pushed to branch master at wxWidgets / wxWidgets

Commits:

  • 6af5df1d
    by Vadim Zeitlin at 2026-06-16T14:34:46+02:00
    Check that page inserted in wxAuiNotebook has correct parent
    
    The page isn't shown correctly otherwise (at least in wxMSW) and this
    check is consistent with a similar one in wxNotebook.
    
  • 0ebc0e51
    by Vadim Zeitlin at 2026-06-16T14:41:51+02:00
    Don't scale AUI layout on platforms using DPI-independent pixels
    
    Disable changes of d32c574141 (Update AUI layout on DPI change,
    2026-06-01) for the platforms with wxHAS_DPI_INDEPENDENT_PIXELS, i.e.
    wxGTK and wxOSX, because it's not just unnecessary but wrong to scale
    layout by DPI scale factor there.
    

3 changed files:

Changes:

  • include/wx/aui/framemanager.h
    ... ... @@ -640,7 +640,9 @@ protected:
    640 640
         void OnHintFadeTimer(wxTimerEvent& evt);
    
    641 641
         void OnFindManager(wxAuiManagerEvent& evt);
    
    642 642
         void OnSysColourChanged(wxSysColourChangedEvent& event);
    
    643
    +#ifndef wxHAS_DPI_INDEPENDENT_PIXELS
    
    643 644
         void OnDPIChanged(wxDPIChangedEvent& event);
    
    645
    +#endif // !wxHAS_DPI_INDEPENDENT_PIXELS
    
    644 646
     
    
    645 647
     protected:
    
    646 648
     
    

  • src/aui/auibook.cpp
    ... ... @@ -2332,6 +2332,9 @@ bool wxAuiNotebook::InsertPage(size_t page_idx,
    2332 2332
     
    
    2333 2333
         wxCHECK_MSG(page, false, wxT("page pointer must be non-null"));
    
    2334 2334
     
    
    2335
    +    wxCHECK_MSG(page->GetParent() == this, false,
    
    2336
    +                wxT("page must be a child of the notebook"));
    
    2337
    +
    
    2335 2338
         wxAuiNotebookPage info;
    
    2336 2339
         info.window = page;
    
    2337 2340
         info.caption = caption;
    

  • src/aui/framemanager.cpp
    ... ... @@ -616,6 +616,10 @@ void wxAuiManager::OnSysColourChanged(wxSysColourChangedEvent& event)
    616 616
         event.Skip(true);
    
    617 617
     }
    
    618 618
     
    
    619
    +// We don't need to scale the positions and sizes on DPI change if they use
    
    620
    +// DPI-independent pixels.
    
    621
    +#ifndef wxHAS_DPI_INDEPENDENT_PIXELS
    
    622
    +
    
    619 623
     void wxAuiManager::OnDPIChanged(wxDPIChangedEvent& event)
    
    620 624
     {
    
    621 625
         event.Skip();
    
    ... ... @@ -648,6 +652,8 @@ void wxAuiManager::OnDPIChanged(wxDPIChangedEvent& event)
    648 652
         Update();
    
    649 653
     }
    
    650 654
     
    
    655
    +#endif // !wxHAS_DPI_INDEPENDENT_PIXELS
    
    656
    +
    
    651 657
     // creates a floating frame for the windows
    
    652 658
     wxAuiFloatingFrame* wxAuiManager::CreateFloatingFrame(wxWindow* parent,
    
    653 659
                                                           const wxAuiPaneInfo& paneInfo)
    
    ... ... @@ -805,7 +811,9 @@ void wxAuiManager::SetManagedWindow(wxWindow* wnd)
    805 811
         m_frame->Bind(wxEVT_CHILD_FOCUS, &wxAuiManager::OnChildFocus, this);
    
    806 812
         m_frame->Bind(wxEVT_AUI_FIND_MANAGER, &wxAuiManager::OnFindManager, this);
    
    807 813
         m_frame->Bind(wxEVT_SYS_COLOUR_CHANGED, &wxAuiManager::OnSysColourChanged, this);
    
    814
    +#ifndef wxHAS_DPI_INDEPENDENT_PIXELS
    
    808 815
         m_frame->Bind(wxEVT_DPI_CHANGED, &wxAuiManager::OnDPIChanged, this);
    
    816
    +#endif // !wxHAS_DPI_INDEPENDENT_PIXELS
    
    809 817
     
    
    810 818
     #if wxUSE_MDI
    
    811 819
         // if the owner is going to manage an MDI parent frame,
    
    ... ... @@ -861,7 +869,9 @@ void wxAuiManager::UnInit()
    861 869
             m_frame->Unbind(wxEVT_CHILD_FOCUS, &wxAuiManager::OnChildFocus, this);
    
    862 870
             m_frame->Unbind(wxEVT_AUI_FIND_MANAGER, &wxAuiManager::OnFindManager, this);
    
    863 871
             m_frame->Unbind(wxEVT_SYS_COLOUR_CHANGED, &wxAuiManager::OnSysColourChanged, this);
    
    872
    +#ifndef wxHAS_DPI_INDEPENDENT_PIXELS
    
    864 873
             m_frame->Unbind(wxEVT_DPI_CHANGED, &wxAuiManager::OnDPIChanged, this);
    
    874
    +#endif // !wxHAS_DPI_INDEPENDENT_PIXELS
    
    865 875
             m_frame = nullptr;
    
    866 876
         }
    
    867 877
     }
    

Reply all
Reply to author
Forward
0 new messages