Skycoder42 / QHotkey

A global shortcut/hotkey for Desktop Qt-Applications
BSD 3-Clause "New" or "Revised" License
548 stars 161 forks source link

X11 Qt6: fix segmentation fault when running under Wayland #96

Closed dbermond closed 3 months ago

dbermond commented 4 months ago

Under Wayland, QGuiApplication::nativeInterface() seems to return a null pointer. At least, this happens in Plasma 6.0.3 with Qt 6.6.2. A segmentation fault occurs when dereferencing the null pointer for obtaining the X11 display.

Checking for a valid pointer in x11Interface variable before acquiring the X11 display is safer and avoids this problem.

Shatur commented 3 months ago

Superseded by #97.