wxListCtrl stops displaying rows properly after a few hundred thousand (Issue #25365)

36 views
Skip to first unread message

Emily Ellis

unread,
May 4, 2025, 7:15:05 PM5/4/25
to wx-...@googlegroups.com, Subscribed
scgtrp created an issue (wxWidgets/wxWidgets#25365)

Description

Bug description:

When a wxListCtrl has hundreds of thousands of rows, scrolling past a certain point causes it to stop rendering any items. The exact row number at which it breaks appears to vary by window height; in the attached test application, it happens when row 335544 would scroll into view.

Expected vs observed behaviour:

These screenshots are from the test application below:

Here, I've scrolled to one row before the issue appears. This is the expected behavior:
image.png (view on web)

Here, I've scrolled one row down from there. At this point all rows except the first disappear:
image.png (view on web)

Attempting to click the missing rows here sometimes works, but usually either does nothing or causes another nearby row to temporarily appear:
image.png (view on web)

Scrolling such that row 335544 or later is at the top causes that row to also disappear.
image.png (view on web)

Patch or snippet allowing to reproduce the problem:

#include "wx/wx.h"
#include "wx/listctrl.h"
#include <cstdio>

class MyApp: public wxApp {
public:
    MyApp() { }
    MyApp(const MyApp&) = delete;
    MyApp& operator=(const MyApp&) = delete;

    virtual bool OnInit() override;
};

wxIMPLEMENT_APP(MyApp);

struct VirtualListCtrl : public wxListCtrl {
    VirtualListCtrl(wxFrame* parent) : wxListCtrl(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_VIRTUAL) {
        AppendColumn("a");
        SetItemCount(1000000);
    };
    virtual wxString OnGetItemText(long item, long column) const override {
        char buffer[128];
        snprintf(buffer, 128, "a %ld", item);
        return wxString(buffer);
    }
};

bool MyApp::OnInit() {
    if (!wxApp::OnInit())
        return false;
    wxFrame* frame = new wxFrame(nullptr, wxID_ANY, "wxListCtrl Test");
    auto list = new VirtualListCtrl(frame);
    frame->Show(true);
    return true;
}

To Reproduce:

Build and run the above code with g++ listtest.cpp $(wx-config --cflags --libs) && ./a.out, then scroll as described above.

This is some sort of platform-specific. I originally reported it in an application (solemnwarning/rehex#245), but the maintainer of that application could not reproduce it on his system (Debian, GTK 3.24.38, wxWidgets 3.2.2, X11).

Platform and version information

  • wxWidgets versionyou use: 3.2.8
  • wxWidgets port you use: GTK
  • OS and its version: Arch Linux
    • GTK version: 3.24.49
    • Which GDK backend is used: Wayland; I also tried forcing fallback to XWayland (WAYLAND_DISPLAY='' ./a.out) with no change
    • Desktop environment: niri 25.02
    • Current theme: Adwaita (as reported by the GTK_DEBUG=interactive inspector; I haven't explicitly set one anywhere)


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25365@github.com>

VZ

unread,
May 6, 2025, 11:01:22 AM5/6/25
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25365)

Thanks, I can indeed reproduce this with the current master under Debian. FWIW the problem can be seen in the listctrl sample, without modifying it: just select "View > Virtual View" from the menu and see that all items after 335543 are not shown.

Unfortunately I don't see anything obviously wrong in the code at first glance. More debugging is needed...


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25365/2854896748@github.com>

Andrea Gavana

unread,
May 6, 2025, 11:25:49 AM5/6/25
to wx-...@googlegroups.com, Subscribed
infinity77 left a comment (wxWidgets/wxWidgets#25365)

Possibly related:

wxWidgets/Phoenix#2522

https://gitlab.freedesktop.org/cairo/cairo/-/issues/824

https://gitlab.freedesktop.org/cairo/cairo/-/issues/824#note_2264420


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25365/2855017253@github.com>

VZ

unread,
May 6, 2025, 12:27:28 PM5/6/25
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25365)

Oh, I see, thanks, I had no idea that Cairo started limiting coordinates to 2^23.

I guess we need something like 4f9186f (Increase usable scrolling range in wxMSW by a factor of 10,000, 2022-04-30) for wxGTK too (and maybe for all platforms?). This shouldn't be that difficult to do, but there have been quite a few regressions in wxMSW after the changes in that commit, so it would need to be done a.s.a.p. if we want to have this in 3.4.0.

Needless to say, any contributions would be welcome.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/25365/2855209091@github.com>

paulcor

unread,
Jun 20, 2026, 1:49:41 PM (3 days ago) Jun 20
to wx-...@googlegroups.com, Subscribed

Closed #25365 as completed.


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.Message ID: <wxWidgets/wxWidgets/issue/25365/issue_event/26995724702@github.com>

Reply all
Reply to author
Forward
0 new messages