Bug 367080

Summary: Keyboard KCM crashes when checking Advanced > Configure keyboard options (on Wayland)
Product: [Applications] systemsettings Reporter: Matthias Fauconneau <matthias.fauconneau>
Component: kcm_keyboardAssignee: Andriy Rysin <arysin>
Status: RESOLVED FIXED    
Severity: crash CC: bugseforuns, christian.lindberg, hakon, jhnpwa, wingrime
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=379325
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Matthias Fauconneau 2016-08-17 08:57:43 UTC
XInternAtom is called without an X connection :
#0 XInternAtom
#1 X11Helper::getGroupNames(_XDisplay*, XkbConfig*, X11Helper::FetchType)
#2 KCMKeyboardWidget::populateWithCurrentXkbOptions
#3 KCMKeyboardWidget::configureXkbOptionsChanged

Reproducible: Always
Comment 1 Patrick Silva 2017-01-29 15:57:11 UTC
I can confirm this testing plasma-wayland-devedition-gitunstable-20170128-2117-amd64.iso
Comment 2 Christoph Feck 2017-05-16 00:59:16 UTC
*** Bug 379325 has been marked as a duplicate of this bug. ***
Comment 3 Håkon Alstadheim 2017-06-08 21:09:45 UTC
Have same problem, patch below works around it. Not claiming this is "The Right Way" 
--------------------
--- a/kcms/keyboard/x11_helper.cpp	2017-06-08 21:04:52.650000000 +0200
+++ b/kcms/keyboard/x11_helper.cpp	2017-06-08 21:02:23.880000000 +0200
@@ -239,6 +239,13 @@
 	char *prop_data = NULL;
 	Status ret;
 
+	if (!QX11Info::isPlatformX11())
+	{
+	    qCWarning(KCM_KEYBOARD) << "Desktop platform is not X11";
+	    return false;
+	}
+
+
 	Atom rules_atom = XInternAtom(display, _XKB_RF_NAMES_PROP_ATOM, False);
 
 	/* no such atom! */
Comment 4 Christoph Feck 2017-06-26 16:38:19 UTC
*** Bug 381305 has been marked as a duplicate of this bug. ***
Comment 5 Christoph Feck 2017-07-14 21:01:38 UTC
*** Bug 382211 has been marked as a duplicate of this bug. ***
Comment 6 Patrick Silva 2017-10-15 03:57:27 UTC
No crash on Arch, plasma 5.11.
Maybe fixed?
Comment 7 Christoph Feck 2017-10-18 12:11:12 UTC
Fixed by Martin Flöser.

See https://commits.kde.org/plasma-desktop/5cd48d672782bc11b4f949a3646aa5bc4224ab85