Do not crash on wayland, gracefully exit with error instead

Summary:
Sadly, XTestQueryExtension just segfaults under wayland.
Avoid it by detecting QPA used.

BUG: 406599

Test Plan:
Nice error message when running in Wayland session.
{F6833467}

Still works in X11
{F6833069}

Reviewers: aacid, kossebau, jgrulich, #kde_applications, pino, ngraham

Reviewed By: pino

Subscribers: pino, ngraham

Tags: #kde_applications

Differential Revision: https://phabricator.kde.org/D21267
This commit is contained in:
Alexey Min
2019-05-18 13:47:45 +03:00
parent 6ecb4248b8
commit 7624aee8e2

View File

@@ -121,13 +121,21 @@ int main(int argc, char *argv[])
app.setQuitOnLastWindowClosed(false);
if (!checkX11Capabilities()) {
if (QX11Info::isPlatformX11()) {
if (!checkX11Capabilities()) {
return 1;
}
// upgrade the configuration
checkOldX11PluginConfig();
} else {
KMessageBox::error(nullptr,
i18n("Desktop Sharing is not running under an X11 Server. "
"Other display servers are currently not supported."),
i18n("Desktop Sharing Error"));
return 1;
}
// upgrade the configuration
checkOldX11PluginConfig();
//init the core
InvitationsRfbServer::init();