Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/wayland/wayland_backend.cpp
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | |||||
60 | 60 | | |||
61 | #include <KWayland/Server/seat_interface.h> | 61 | #include <KWayland/Server/seat_interface.h> | ||
62 | 62 | | |||
63 | #include <QMetaMethod> | 63 | #include <QMetaMethod> | ||
64 | #include <QThread> | 64 | #include <QThread> | ||
65 | 65 | | |||
66 | #include <linux/input.h> | 66 | #include <linux/input.h> | ||
67 | #include <wayland-cursor.h> | 67 | #include <wayland-cursor.h> | ||
68 | #include <wayland-client.h> | ||||
68 | 69 | | |||
69 | namespace KWin | 70 | namespace KWin | ||
70 | { | 71 | { | ||
71 | namespace Wayland | 72 | namespace Wayland | ||
72 | { | 73 | { | ||
73 | 74 | | |||
74 | using namespace KWayland::Client; | 75 | using namespace KWayland::Client; | ||
75 | 76 | | |||
▲ Show 20 Lines • Show All 752 Lines • ▼ Show 20 Line(s) | |||||
828 | } | 829 | } | ||
829 | 830 | | |||
830 | Outputs WaylandBackend::enabledOutputs() const | 831 | Outputs WaylandBackend::enabledOutputs() const | ||
831 | { | 832 | { | ||
832 | // all outputs are enabled | 833 | // all outputs are enabled | ||
833 | return m_outputs; | 834 | return m_outputs; | ||
834 | } | 835 | } | ||
835 | 836 | | |||
837 | bool WaylandBackend::canLoad() | ||||
838 | { | ||||
839 | // Try at least to connect to wayland display | ||||
840 | // (and immediately disconnect in case of success) | ||||
841 | const QByteArray waylandDisplay = qgetenv("WAYLAND_DISPLAY"); | ||||
842 | if (waylandDisplay.isNull()) { | ||||
843 | return false; | ||||
844 | } | ||||
845 | struct wl_display *disp = wl_display_connect(waylandDisplay.constData()); | ||||
846 | if (!disp) { | ||||
847 | return false; | ||||
848 | } | ||||
849 | wl_display_disconnect(disp); | ||||
850 | return true; | ||||
851 | } | ||||
852 | | ||||
836 | } | 853 | } | ||
837 | 854 | | |||
838 | } // KWin | 855 | } // KWin |