On 01.05.2021 11:44, Germano Massullo wrote:
Let's wait also for Jan Grulich. He should be back next
days/weeks
Yes, but my simple workaround works fine. We need to add a new method:
```c++
#ifdef Q_OS_LINUX
void wayland_hacks()
{
// Workaround to
https://github.com/ksnip/ksnip/issues/416
QByteArray currentDesktop = qgetenv("XDG_CURRENT_DESKTOP").toLower();
QByteArray sessionDesktop = qgetenv("XDG_SESSION_DESKTOP").toLower();
QByteArray sessionType = qgetenv("XDG_SESSION_TYPE").toLower();
if (sessionType.contains("wayland") &&
(currentDesktop.contains("gnome") ||
sessionDesktop.contains("gnome")))
{
qputenv("QT_QPA_PLATFORM", "xcb");
}
}
#endif
```
Then call it in main(), just before the QApplication initialization:
```c++
int main(int argc, char** argv)
{
#ifdef Q_OS_LINUX
wayland_hacks();
#endif
QApplication app(argc, argv);
}
```
--
Sincerely,
Vitaly Zaitsev (vitaly(a)easycoding.org)