When I run the provided code sample on Windows, I see the CPU usage of my app rising quite high, and my screen reader navigation lags. If I shorten the length of the title strings, the CPU usage goes way down.
CPU usage should remain low, as we're doing nothing intensive.
\#include <memory> #include <wx/bookctrl.h> #include <wx/wx.h> class app : public wxApp { public: bool OnInit() override { frame = new wxFrame(nullptr, wxID_ANY, "Test"); auto* panel = new wxPanel(frame); notebook = new wxNotebook(panel, wxID_ANY); auto* sizer = new wxBoxSizer(wxVERTICAL); sizer->Add(notebook, 1, wxEXPAND | wxALL, 10); panel->SetSizer(sizer); auto* panel1 = create_tab_panel("This is a test."); auto* panel2 = create_tab_panel("This is a test."); notebook->AddPage(panel1, "This is a test of a very long title This is a test of a very long title This is a test of a very long title"); notebook->AddPage(panel2, "This is a test of a very long title This is a test of a very long title This is a test of a very long title"); frame->Show(true); return true; } wxPanel* create_tab_panel(const wxString& content) { wxPanel* panel = new wxPanel(notebook, wxID_ANY); auto* sizer = new wxBoxSizer(wxVERTICAL); long style = wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH2 | wxTE_DONTWRAP; auto* text_ctrl = new wxTextCtrl(panel, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, style); sizer->Add(text_ctrl, 1, wxEXPAND | wxALL, 5); panel->SetSizer(sizer); text_ctrl->SetValue(content); return panel; } private: wxFrame* frame{nullptr}; wxNotebook* notebook{nullptr}; }; wxIMPLEMENT_APP(app);
Run the compiled code sample, and then view CPU usage in task manager. Depending on how many cores you have, you'll see different usage values as wxWidgets only is allowed to use one core, but it's trying to use most of it.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Adding this:
#ifdef __WXMSW__ notebook->MSWDisableComposited(); #endif
makes the behavior go away.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Probably not worth investigating in light of #25663.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Ah thanks, hadn't seen that. That should fix this :) thanks
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Please check that #25808 fixes this if you can.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
Closed #25797 as completed via b5a9fa3.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.