Not the selected menu under wayland

Every time I select a menu item somewhere in KiCad (project, schem-editor,etc ), it always drops down the first item. So in the screenshot I click on “Voorkeuren” and it opens “Bestand”. (sorry it’s in dutch)

I’m running cachy os (Arch Linux derivative), so the latest stuff. I’m running KDE on wayland. KDE on X doesn’t have this issue.

Is this a known issue?

My understanding is that wayland has problems. Please see:

Yes, I hear you. That page also tells KiCads starts / runs on xwayland, which is outdated info I believe. xprop doesn’t react on KiCad, the quickest way I can see if it’s on xwayland. Also wxwidgets is compiled against wayland gtk libs.

Okay, no quickfix. I might try to recompile with some other options than the standard in Arch package or try other distro in a virtual machine.

I personally use Fedora with XFCE (X11). That combination works quite well but I don’t know how it would behave in a VM on a wayland system.

  • Check on native GTK3 apps.
  • Check on wxWidgets samples.
  • Check on Gnome, Weston, Sway, etc.
  • Check with GDK_BACKEND=x11 (KiCad sets it automatically if built with GLX backend so uses XWayland).
  • Report to respective projects.

Thanks for the list. Maybe I can narrow it down with that list.

The Arch Linux package uses this:
cmake
-B build
-S “$pkgname”
-G Ninja
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=/usr
-D KICAD_USE_EGL=ON
-D KICAD_USE_BUNDLED_GLEW=OFF
-D KICAD_BUILD_I18N=ON
-D KICAD_I18N_UNIX_STRICT_PATH=ON
-D KICAD_BUILD_QA_TESTS=OFF
-W no-dev

So KICAD_USE_EGL=ON is kinda the opposite of GDK_BACKEND=x11

That might be the issue then.
Gentoo forces KICAD_USE_EGL=OFF, this use to be a use-flag issue but bugs started to appear (wx was teh root cause) and so this was removed as an option.

I remeber this as I was going through the bug with gentoo dev’s. Kicad works fine in wayland for me (be it via Xwayland)

Ah nice find on the Gentoo package. Thanks.

Turns out I don’t use much gtk apps lately.

I found Inkspace and Guitarix on my system, they’re built on gtk-3.0 and gtk-2.0. Both have the same issue with the menu.

I also tried Cosmic and Hyprland. Issue remains the same under Hyprland, but works with Cosmic. I must say Cosmic is nice, but zooming with the mouse doesn’t work as smooth as with kde plasma.

So looks like a gtk quirck. KiCad functions very good overall for the rest of the stuff.

bascially EGL is needed for wayland and GLX for X11.
wx is still flaky with wayland :frowning: so several distro’s (fedora, gentoo) force x11 until this is fixed

GLX is X11-only
EGL supports both Wayland and X11 (althrough EGL support in wxWidgets is less mature)

Yes but if you have egl support and on Wayland then we will "attempt " to use Wayland and this is where the issue is
Glx is the only way to reliably force x11

Launching kicad like GDK_BACKEND=x11 kicad is also a way to reliably force X11

yes

GDK_BACKEND=x11 kicad

does start KiCad via xwayland and then the menu works under KDE plasma.

I was trying “export GDK_BACKEND=x11” in a fish shell, that probably doesn’t work or I typed something wrong.

ok, now I’m lost, as in, no idea in which component(s) the error(s) is or are.

I tried KiCad on cachy-os and Arch Linux in a virtual machine : both work, just install and go.

I tried KiCad on Arch Linux on my mac mini from 2014, works.

I wiped my laptop and tried cachy-os and then Arch Linux. Normally I work with a dock on an external monitor, but I also tried with just the laptop. Disabling the touchscreen and what not, no banana. GTK apps crooked menu.

There are so many layers where this can go wrong: a) graphics intel driver (which doesn’t merely consists of a kernel module), b) kde wayland implementation and c) gtk. It could also be d) WxWidgets, but because other gtk app suffer from the same issue, I believe in this case WxWidgets is fine. This is a rabbit hole to sort out. And if you find you’ll have to convince the right project to fix it or accept your merge request. Could be this sorts itself out by someone changing code in some component to be more compliant. Still a shame I can’t isolate the problem.

Luckily KiCad just get’s better and better and the solution works for KiCad. Happy user.

I noticed a new build version of KiCad 9.0.0 on Arch Linux and the problem seems to be solved. Didn’t test this thoroughly, but e.g. VirtualMachineManager had the same issue, it’s fixed also. In the pacman.log (package manager log on Arch) I saw that gtk3 was updated recently.

Sooooo nice.