Changeset View
Changeset View
Standalone View
Standalone View
krfb/main.cpp
Show All 36 Lines | |||||
37 | #include <QCommandLineOption> | 37 | #include <QCommandLineOption> | ||
38 | 38 | | |||
39 | 39 | | |||
40 | static const char description[] = I18N_NOOP("VNC-compatible server to share " | 40 | static const char description[] = I18N_NOOP("VNC-compatible server to share " | ||
41 | "desktops"); | 41 | "desktops"); | ||
42 | 42 | | |||
43 | static bool checkX11Capabilities() | 43 | static bool checkX11Capabilities() | ||
44 | { | 44 | { | ||
45 | // QX11Info::display() can still be non-null in wayland, if XWayland is running. | ||||
pino: looking at similar checks in other applications, shouldn't this be `QX11Info::isPlatformX11()`? | |||||
46 | if (!QX11Info::display() || (QApplication::platformName() != QStringLiteral("xcb"))) { | ||||
pino: then most probably only the platform name check should be enough, shouldn't it? | |||||
alexeymin: Yeah, probably platform name check should be enough. | |||||
47 | // XTestQueryExtension segfaults under wayland + XWayland. | ||||
48 | // exit early and gracefully | ||||
49 | KMessageBox::error(nullptr, | ||||
50 | i18n("It seems you are not running X11. " | ||||
51 | "Wayland is currently not supported yet!"), | ||||
please no exclamation marks in error messages, as they "increase the tone" of the message itself. pino: please no exclamation marks in error messages, as they "increase the tone" of the message… | |||||
alexeymin: Okay | |||||
52 | i18n("Desktop Sharing Error")); | ||||
53 | return false; | ||||
54 | } | ||||
55 | | ||||
45 | int bp1, bp2, majorv, minorv; | 56 | int bp1, bp2, majorv, minorv; | ||
46 | Bool r = XTestQueryExtension(QX11Info::display(), &bp1, &bp2, | 57 | Bool r = XTestQueryExtension(QX11Info::display(), &bp1, &bp2, | ||
47 | &majorv, &minorv); | 58 | &majorv, &minorv); | ||
48 | 59 | | |||
49 | if ((!r) || (((majorv * 1000) + minorv) < 2002)) { | 60 | if ((!r) || (((majorv * 1000) + minorv) < 2002)) { | ||
50 | KMessageBox::error(nullptr, | 61 | KMessageBox::error(nullptr, | ||
51 | i18n("Your X11 Server does not support the required XTest extension " | 62 | i18n("Your X11 Server does not support the required XTest extension " | ||
52 | "version 2.2. Sharing your desktop is not possible."), | 63 | "version 2.2. Sharing your desktop is not possible."), | ||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |
looking at similar checks in other applications, shouldn't this be QX11Info::isPlatformX11()?