blob: 9b16b84d811a950fdb5766adca322ee17bf59789 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
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;
|