Changeset View
Changeset View
Standalone View
Standalone View
backends/kwayland/waylandconfig.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 40 | WaylandConfig::WaylandConfig(QObject *parent) | |||
---|---|---|---|---|---|
46 | , m_kscreenPendingConfig(nullptr) | 46 | , m_kscreenPendingConfig(nullptr) | ||
47 | , m_screen(new WaylandScreen(this)) | 47 | , m_screen(new WaylandScreen(this)) | ||
48 | , m_tabletModeAvailable(false) | 48 | , m_tabletModeAvailable(false) | ||
49 | , m_tabletModeEngaged(false) | 49 | , m_tabletModeEngaged(false) | ||
50 | { | 50 | { | ||
51 | initKWinTabletMode(); | 51 | initKWinTabletMode(); | ||
52 | 52 | | |||
53 | connect(this, &WaylandConfig::initialized, &m_syncLoop, &QEventLoop::quit); | 53 | connect(this, &WaylandConfig::initialized, &m_syncLoop, &QEventLoop::quit); | ||
54 | QTimer::singleShot(1000, this, [this] { | 54 | QTimer::singleShot(3000, this, [this] { | ||
55 | if (m_syncLoop.isRunning()) { | 55 | if (m_syncLoop.isRunning()) { | ||
56 | qCWarning(KSCREEN_WAYLAND) << "Connection to Wayland server at socket:" | 56 | qCWarning(KSCREEN_WAYLAND) << "Connection to Wayland server at socket:" | ||
57 | << m_connection->socketName() << "timed out."; | 57 | << m_connection->socketName() << "timed out."; | ||
58 | m_syncLoop.quit(); | 58 | m_syncLoop.quit(); | ||
59 | m_thread->quit(); | 59 | m_thread->quit(); | ||
60 | m_thread->wait(); | 60 | m_thread->wait(); | ||
61 | } | 61 | } | ||
62 | }); | 62 | }); | ||
▲ Show 20 Lines • Show All 187 Lines • ▼ Show 20 Line(s) | 240 | { | |||
250 | m_screen->setOutputs(m_outputMap.values()); | 250 | m_screen->setOutputs(m_outputMap.values()); | ||
251 | delete output; | 251 | delete output; | ||
252 | 252 | | |||
253 | if (!m_blockSignals) { | 253 | if (!m_blockSignals) { | ||
254 | Q_EMIT configChanged(); | 254 | Q_EMIT configChanged(); | ||
255 | } | 255 | } | ||
256 | } | 256 | } | ||
257 | 257 | | |||
258 | bool WaylandConfig::isInitialized() const | ||||
259 | { | ||||
260 | return !m_blockSignals | ||||
261 | && m_registryInitialized | ||||
262 | && m_initializingOutputs.isEmpty() | ||||
263 | && m_outputMap.count() > 0 | ||||
264 | && m_outputManagement != nullptr; | ||||
265 | } | ||||
266 | | ||||
258 | void WaylandConfig::checkInitialized() | 267 | void WaylandConfig::checkInitialized() | ||
259 | { | 268 | { | ||
260 | if (!m_blockSignals && m_registryInitialized && | 269 | if (isInitialized()) { | ||
261 | m_initializingOutputs.isEmpty() && m_outputMap.count() && m_outputManagement != nullptr) { | | |||
262 | m_screen->setOutputs(m_outputMap.values()); | 270 | m_screen->setOutputs(m_outputMap.values()); | ||
263 | Q_EMIT initialized(); | 271 | Q_EMIT initialized(); | ||
264 | } | 272 | } | ||
265 | } | 273 | } | ||
266 | 274 | | |||
267 | KScreen::ConfigPtr WaylandConfig::currentConfig() | 275 | KScreen::ConfigPtr WaylandConfig::currentConfig() | ||
268 | { | 276 | { | ||
269 | // TODO: do this setScreen call less clunky | 277 | // TODO: do this setScreen call less clunky | ||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |