Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxWindow::Refresh() doesn't repaint items under Wayland when called from wxEVT_IDLE handler #24443

Open
vadz opened this issue Mar 29, 2024 · 1 comment
Assignees
Labels
Wayland wxGTK Wayland-specific issues

Comments

@vadz
Copy link
Contributor

vadz commented Mar 29, 2024

I'll try to come up with a SSCCE later, but for now I'm opening this just to check if anybody has already run into this by chance and/or has any ideas:

Calling wxListCtrl::RefreshLines() doesn't have the expected effect when it's called from OnIdle(), i.e. it doesn't repaint the affected items. This only happens when using Wayland, not X11, and can be worked around by using CallAfter() which is weird because it's still called during the idle time -- but somehow doing it during the next idle callback call works. This doesn't seem to be wxListCtrl-specific, I just don't see any calls to GTKSendPaintEvents() after calling gdk_window_invalidate_rect() in this case.

@vadz vadz added the Wayland wxGTK Wayland-specific issues label Mar 29, 2024
@vadz vadz self-assigned this Mar 29, 2024
@vadz vadz changed the title wxWindow::Refresh() doesn't generate wxEVT_PAINT under Wayland when called from wxEVT_IDLE handler wxWindow::Refresh() doesn't repaint items under Wayland when called from wxEVT_IDLE handler Mar 30, 2024
@vadz
Copy link
Contributor Author

vadz commented Mar 30, 2024

I was wrong in my initial bug description, the paint events do get generated and processed but, somehow, drawing on wxPaintDC doesn't update what is shown on screen. This is a bit crazy, especially because I can't reproduce it in a simple example, but it does happen in my application. Calling CallAfter([this]() { Refresh(); }) instead of calling Refresh() directly in the idle handler fixes it, so I'll use this as a workaround for now but I'd like to understand what is really going on here and why could wxPaintDC possibly decide not to update the screen like this...

vadz pushed a commit to vadz/mahogany that referenced this issue Mar 31, 2024
Somehow, refreshing items directly from the idle event handler didn't
work when using Wayland: they were refreshed and repainted, but the
results didn't appear on the screen, unlike when using X11 (or MSW for
that matter).

Work around it by calling RefreshItems() later: this shouldn't normally
change anything, but it does fix the problem.

See wxWidgets/wxWidgets#24443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Wayland wxGTK Wayland-specific issues
Projects
None yet
Development

No branches or pull requests

1 participant