commit bb630252684d3556b79ac7a521616692f348fcf7
Author: Javier O. Cordero Pérez <javiercorderoperez@gmail.com>
Date:   Mon May 20 15:13:12 2024 -0400

    Fix: Prevent crash on Wayland when using Qt 6 (#97)

diff --git a/QHotkey/qhotkey_x11.cpp b/QHotkey/qhotkey_x11.cpp
index d3ac1d1..d9d73f7 100644
--- a/QHotkey/qhotkey_x11.cpp
+++ b/QHotkey/qhotkey_x11.cpp
@@ -132,13 +132,16 @@ quint32 QHotkeyPrivateX11::nativeKeycode(Qt::Key keycode, bool &ok)
 
 #if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
 	const QNativeInterface::QX11Application *x11Interface = qGuiApp->nativeInterface<QNativeInterface::QX11Application>();
-	Display *display = x11Interface->display();
 #else
 	const bool x11Interface = QX11Info::isPlatformX11();
-	Display *display = QX11Info::display();
 #endif
 
 	if(x11Interface) {
+#if QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)
+		Display *display = x11Interface->display();
+#else
+		Display *display = QX11Info::display();
+#endif
 		auto res = XKeysymToKeycode(display, keysym);
 		if(res != 0)
 			ok = true;
