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:
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.
OpenGL view should be correctly rendered
Open Kicad under a wayland session and go to the schematic editor -> Assign Footprints -> Select Footprint -> Open Footprint Preview.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
@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.
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.
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.