Changeset View
Changeset View
Standalone View
Standalone View
plugins/qpa/nativeinterface.cpp
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 63 | { | |||
---|---|---|---|---|---|
74 | if (r == s_surfaceKey && window) { | 74 | if (r == s_surfaceKey && window) { | ||
75 | if (auto handle = window->handle()) { | 75 | if (auto handle = window->handle()) { | ||
76 | return static_cast<wl_surface*>(*static_cast<Window*>(handle)->surface()); | 76 | return static_cast<wl_surface*>(*static_cast<Window*>(handle)->surface()); | ||
77 | } | 77 | } | ||
78 | } | 78 | } | ||
79 | return nullptr; | 79 | return nullptr; | ||
80 | } | 80 | } | ||
81 | 81 | | |||
82 | static void roundtrip() | ||||
83 | { | ||||
84 | if (!waylandServer()) { | ||||
85 | return; | ||||
86 | } | ||||
87 | auto c = waylandServer()->internalClientConection(); | ||||
88 | if (!c) { | ||||
89 | return; | ||||
90 | } | ||||
91 | c->flush(); | ||||
92 | waylandServer()->dispatch(); | ||||
93 | } | ||||
94 | | ||||
95 | QFunctionPointer NativeInterface::platformFunction(const QByteArray &function) const | ||||
96 | { | ||||
97 | if (qstrcmp(function.toLower(), "roundtrip") == 0) { | ||||
98 | return &roundtrip; | ||||
99 | } | ||||
100 | return nullptr; | ||||
101 | } | ||||
102 | | ||||
82 | } | 103 | } | ||
83 | } | 104 | } |