OpenGL Canvas not redrawn under Wayland (Issue #25848)

49 views
Skip to first unread message

0mhu

unread,
Oct 1, 2025, 9:20:14 AM (5 days ago) Oct 1
to wx-...@googlegroups.com, Subscribed
0mhu created an issue (wxWidgets/wxWidgets#25848)

Description

Bug description:

Unfortunately, I'm not able to provide a very good bug description because I'm not able to track down what exactly the problem is. Sorry about that...

I use KiCAD v9.0.4 and experience the following issue:
https://gitlab.com/kicad/code/kicad/-/issues/21089

Kicad uses a https://docs.wxpython.org/wx.ScrolledCanvas.html#wx-scrolledcanvas ScrolledCanvas (I think) to draw a footprint preview using openGL. This openGL rendering howerver does not work. See this screencast: https://gitlab.com/-/project/15502567/uploads/730f2e99e5548710f830485c835322e6/Screencast_From_2025-06-07_15-03-19.mp4

I traced it in Kicad's code down to the point where I see that the pain evewnt of the widget is called as expected and the openGL calls to draw the surface are executed. However nothing happens unless one of hte two things:

  1. The Window is resized
  2. Another GUI element like the dropdown of the zoom selection (see video) covers the canvas and somehow triggers a correct redraw.

KiCAD's development team suggested to report the issue to Mutter. However, the issue persists both on Gnome (using Mutter) and KDE which uses a differnt Wayland compositor. Therefore, I guess it's not a compositor problem.

Can you help me track that down? I'm on these bugs for months and can't find support anywhere.
I don't know, if it's wxWidgets, GDK or anything else and can't spot anything obviously wrong in Kicad either.

Expected vs observed behaviour:

OpenGL view should be correctly rendered

To Reproduce:

Open Kicad under a wayland session and go to the schematic editor -> Assign Footprints -> Select Footprint -> Open Footprint Preview.

Platform and version information

  • wxWidgets version you use: 3.2.8.1
  • wxWidgets port you use: wxGTK
  • OS and its version: Arch, but happens on Ubuntu as well
    • GTK version: 3.24.51
    • Which GDK backend is used: Wayland
    • Desktop environment : Gnome and KDE
    • Current theme: Theme independent.


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/25848@github.com>

VZ

unread,
Oct 1, 2025, 9:24:48 AM (5 days ago) Oct 1
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25848)

OpenGL definitely works under Wayland in general, so I suspect this issue is specific to the video card you use. Can you try building wxWidgets 3.3.1 and one of its OpenGL samples, e.g. samples/opengl/cube? Does it work correctly for you?

Also, does this issue happen on other machines?


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/25848/3356306574@github.com>

0mhu

unread,
Oct 1, 2025, 9:29:29 AM (5 days ago) Oct 1
to wx-...@googlegroups.com, Subscribed
0mhu left a comment (wxWidgets/wxWidgets#25848)

Thanks for the answer,

The issue persists on all my systems: An AMD Ryzen with iGPU, a Ryzen with dedicated AMD GPU, an Intel 6th generation with iGPU and on all other PCs of my friends.
One of my systems:

Platform: Arch Linux, 64 bit, Little endian, wxGTK, Wayland, gnome, wayland
OpenGL: Intel, Mesa Intel(R) HD Graphics 530 (SKL GT2), 4.6 (Compatibility Profile) Mesa 25.1.1-arch1.1
Build Info:
    Date: May 21 2025 09:11:42
    wxWidgets: 3.2.8 (wchar_t,wx containers) GTK+ 3.24
    Boost: 1.88.0
    OCC: 7.8.1
    Curl: 8.13.0
    ngspice: 44.2
    Compiler: GCC 15.1.1 with C++ ABI 1020

The problem is: OpenGL in general works. Kicad also uses the same class at different points in the software where it does work. Just this one dialog does not work. I personally don't get it. Under X11 everything works fine. But Arch dropped X for wayland.


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/25848/3356331380@github.com>

VZ

unread,
Oct 1, 2025, 9:34:39 AM (5 days ago) Oct 1
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25848)

I am afraid we're going to need some way of reproducing the problem in order to be able to debug and potentially fix it. If it works for the other OpenGL windows but not this one, there must be some salient difference between them, but unfortunately I have no idea what could it be...


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/25848/3356363707@github.com>

0mhu

unread,
Oct 1, 2025, 9:42:44 AM (5 days ago) Oct 1
to wx-...@googlegroups.com, Subscribed
0mhu left a comment (wxWidgets/wxWidgets#25848)

Is there anythign I can debug?
I'm not too much into the whole GUI chain and can't really debug that myself. I was just able to see that the redraw event is actually executing and that the glClear() and subsequent drawing commands etc. execute.

Is there a way to pinpoint it to some component? As I said. This is more or less a depserate try to get support for that becasue like all other wayland related issues, I cannot file bug reports because I can't point to specific errors.


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/25848/3356396425@github.com>

RobertRoeb

unread,
Oct 1, 2025, 1:26:01 PM (5 days ago) Oct 1
to wx-...@googlegroups.com, Subscribed
RobertRoeb left a comment (wxWidgets/wxWidgets#25848)

Is only this OpenGl window in a ScrolledCanvas?


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/25848/3357376350@github.com>

0mhu

unread,
Oct 1, 2025, 3:11:17 PM (5 days ago) Oct 1
to wx-...@googlegroups.com, Subscribed
0mhu left a comment (wxWidgets/wxWidgets#25848)

Is only this OpenGl window in a ScrolledCanvas?

No. It's a generic class EDA_DRAW_PANEL_GAL derived from wxScrolledCanvas. Kicad seems to use this in some places. See the code here https://gitlab.com/kicad/code/kicad/-/blob/master/common/draw_panel_gal.cpp?ref_type=heads#L67

There is a Repaint function / a Paint callback inside that class
https://gitlab.com/kicad/code/kicad/-/blob/master/common/draw_panel_gal.cpp?ref_type=heads#L194

This get called. I verified that. Subsequently this function executes this line:
https://gitlab.com/kicad/code/kicad/-/blob/master/common/draw_panel_gal.cpp?ref_type=heads#L304

which then leads to the view elements and their opengl drawing commands.
Despite executing this whenever the GUI should render, there is no visible output unless the window is resized or a GUI element which overlays a dropdown over the canvas is activated.


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/25848/3357775255@github.com>

VZ

unread,
Oct 2, 2025, 5:23:05 PM (4 days ago) Oct 2
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25848)

Sorry, I just have no idea about what could be causing this and no practical way to debug it. If you can reproduce this by cherry picking parts of KiCad code into cube OpenGL sample until it stops working, I'd at least try to debug it (no guarantee of success, of course), but without this I simply don't know.


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/25848/3363123619@github.com>

0mhu

unread,
Oct 3, 2025, 3:17:30 PM (3 days ago) Oct 3
to wx-...@googlegroups.com, Subscribed
0mhu left a comment (wxWidgets/wxWidgets#25848)

Sorry, I just have no idea about what could be causing this and no practical way to debug it. If you can reproduce this by cherry picking parts of KiCad code into cube OpenGL sample until it stops working, I'd at least try to debug it (no guarantee of success, of course), but without this I simply don't know.

Thanks @vadz for your help. I totally understand that you cannot help with that random issue.
I spent ~20 hours Debugging kicad, wxwidgets, mesa etc. and couldn't find anything that's not really working. There are weird things going on.. If the drawing is updated without the window in focus, it works...
I'm giving up. I still have no clue, if it's

  • Wayland
  • GDK
  • wxwidgets
  • kicad
  • mesa
  • something else?

Maybe it's time to go back to windows after 15 years of Linux.


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/25848/3366916254@github.com>

dsa-t

unread,
Oct 3, 2025, 7:33:31 PM (2 days ago) Oct 3
to wx-...@googlegroups.com, Subscribed
dsa-t left a comment (wxWidgets/wxWidgets#25848)

I wonder if this could be related to #25496

(Unfortunately I won't be able to help with the repro case for a while)


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/25848/3367545294@github.com>

VZ

unread,
Oct 4, 2025, 5:30:04 PM (2 days ago) Oct 4
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25848)

If the drawing is updated without the window in focus, it works...

This is a horrible hack, but in this case would giving focus to some other window, calling Refresh() and then putting focus back work?

Maybe it's time to go back to windows after 15 years of Linux.

Can't you just use Xwayland and run KiCad under it? This is not great, but not nearly as bad as going back to Windows...


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/25848/3368550778@github.com>

0mhu

unread,
Oct 4, 2025, 8:10:30 PM (2 days ago) Oct 4
to wx-...@googlegroups.com, Subscribed
0mhu left a comment (wxWidgets/wxWidgets#25848)

This is a horrible hack, but in this case would giving focus to some other window, calling Refresh() and then putting focus back work?

I will try that...

Can't you just use Xwayland and run KiCad under it? This is not great, but not nearly as bad as going back to Windows...

This doesn't work either... Once you lose focus on a window, the mouse capture does not work anymore and the cursor in kicad only moves if you click to a position. So changing to another application a single time breaks everything.


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/25848/3368619523@github.com>

dsa-t

unread,
Oct 4, 2025, 8:14:46 PM (2 days ago) Oct 4
to wx-...@googlegroups.com, Subscribed
dsa-t left a comment (wxWidgets/wxWidgets#25848)

By "use Xwayland" it was meant you run kicad like this:

GDK_BACKEND=x11 kicad


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/25848/3368621993@github.com>

0mhu

unread,
Oct 4, 2025, 8:30:16 PM (2 days ago) Oct 4
to wx-...@googlegroups.com, Subscribed
0mhu left a comment (wxWidgets/wxWidgets#25848)

@dsa-t I know. That doesn't work. The schematic editor works fine as long as it doesn't lose focus. Once I tab to another window and go back to kicad, the cursor in kicad doesn't work anymore. Zooming with mousewheel also impossible.


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/25848/3368630273@github.com>

dsa-t

unread,
Oct 4, 2025, 8:35:36 PM (2 days ago) Oct 4
to wx-...@googlegroups.com, Subscribed
dsa-t left a comment (wxWidgets/wxWidgets#25848)

Once I tab to another window and go back to kicad, the cursor in kicad doesn't work anymore. Zooming with mousewheel is then also impossible.

That's weird. I don't remember seeing this on my Manjaro+KDE+Wayland system (that was like months ago)


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/25848/3368633303@github.com>

dsa-t

unread,
Oct 4, 2025, 8:49:26 PM (2 days ago) Oct 4
to wx-...@googlegroups.com, Subscribed
dsa-t left a comment (wxWidgets/wxWidgets#25848)

Does that also happen with the wxWidgets pyramid sample with GDK_BACKEND=x11?


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/25848/3368641192@github.com>

Reply all
Reply to author
Forward
0 new messages