I'm using wxDataViewTreeCtrl and wxAuiNotebook in my code. I've noticed that both of these widgets flicker under the following conditions:
wxDataViewTreeCtrl flickers when the main window width is changed. Sometimes the flickering also occurs when expanding/collapsing tree items.wxAuiNotebook tabs flicker when the mouse cursor hovers over the tab bar buttons.Sometimes the flickering doesn't occur immediately; you need to perform the action several times in different directions for the problem to occur.
The problem occurs in both light and dark mode. I'd also like to point out that both of these controls are generic controls, at least in wxMSW.
Note: These issues only occur when SetDoubleBuffered(true) has been called on the wxFrame. If this isn't called, the flickering doesn't occur.
IMPORTANT: I also notice flickering of tabs in wxAuiNotebook when the mouse cursor hovers over the buttons on the right side of the tab bar and under other conditions when SetDoubleBuffered(true) is not set on wxFrame. However, I cannot provide a reproducible example, as this occurs in a project that consists of many thousands of lines of code, and I currently have no idea what is causing this flickering.
I expect there to be no flickering
Here the code to reproduce the issue
#include <wx/wx.h> #include <wx/aui/aui.h> #include <wx/dataview.h> class MainFrame : public wxFrame { public: MainFrame() : wxFrame(nullptr, wxID_ANY, "wxAuiNotebook with Tree", wxDefaultPosition, wxSize(900, 600)) { m_notebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_TOP | wxAUI_NB_CLOSE_BUTTON | wxAUI_NB_WINDOWLIST_BUTTON ); AddPage("Welcome", "Hello wxWidgets!"); AddPage("Settings", "Settings page"); AddPage("Console", "Console output"); m_tree = new wxDataViewTreeCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_ROW_LINES | wxDV_VERT_RULES ); wxDataViewItem root = m_tree->AppendContainer( wxDataViewItem(nullptr), "Folders" ); for (int i = 1; i <= 10; i++) { m_tree->AppendContainer( root, wxString::Format("Folder %d", i) ); } m_tree->Expand(root); wxBoxSizer* mainSizer = new wxBoxSizer(wxHORIZONTAL); mainSizer->Add(m_tree, 1, wxEXPAND); mainSizer->Add(m_notebook, 1, wxEXPAND); SetSizer(mainSizer); Centre(); } private: wxAuiNotebook* m_notebook; wxDataViewTreeCtrl* m_tree; void AddPage( const wxString& title, const wxString& text) { wxPanel* panel = new wxPanel(m_notebook); wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL); wxStaticText* label = new wxStaticText( panel, wxID_ANY, text ); sizer->Add( label, 0, wxALL, 20 ); panel->SetSizer(sizer); m_notebook->AddPage( panel, title, true ); } }; class MyApp : public wxApp { public: bool OnInit() override { //MSWEnableDarkMode(wxApp::DarkMode_Always); MainFrame* frame = new MainFrame(); frame->SetDoubleBuffered(true); frame->Show(); return true; } }; wxIMPLEMENT_APP(MyApp);
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Could be the same as #26750.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Another important note: Sometimes even wxSearchCtrl flickers when the mouse cursor hovers over it. I'm having trouble providing a reproducible example because I don't currently understand what's causing the flickering.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
I assume wxWidgets 3.3.0 is a typo and you are using 3.3.3.
Not only is the version outdated but there is an important difference since 3.3.0 introduced using native double buffering on Windows (WS_EX_COMPOSITED) but it was problematic and it is not used since 3.3.2.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@PBfordev No, there is no typo. I'm using 3.3.0
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Well, you really shouldn't, and there is no chance anything is ever going to be fixed in that version. You should have no issues upgrading to 3.3.3, so please do this and reopen the issue if you still see problems in it.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
@vadz
There is no flickering after upgrading to 3.3.3.
Many thanks!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()