Changeset View
Changeset View
Standalone View
Standalone View
app/mainwindow.cpp
Show First 20 Lines • Show All 1046 Lines • ▼ Show 20 Line(s) | 1046 | if (info.valid() && info.transientFor() == winId()) { | |||
---|---|---|---|---|---|
1047 | return; | 1047 | return; | ||
1048 | } | 1048 | } | ||
1049 | 1049 | | |||
1050 | 1050 | | |||
1051 | if (m_isX11) { | 1051 | if (m_isX11) { | ||
1052 | if (!Settings::keepOpen() && isVisible() && KWindowSystem::activeWindow() != winId()) { | 1052 | if (!Settings::keepOpen() && isVisible() && KWindowSystem::activeWindow() != winId()) { | ||
1053 | toggleWindowState(); | 1053 | toggleWindowState(); | ||
1054 | } | 1054 | } | ||
1055 | } else if (m_isWayland) { | ||||
1056 | if (Settings::keepOpen()) { | ||||
1057 | return; | ||||
1058 | } | ||||
1059 | | ||||
1060 | const auto activeWin = qApp->activeWindow(); | ||||
1061 | if (activeWin == nullptr) { | ||||
1062 | toggleWindowState(); | ||||
1063 | } | ||||
1055 | } else { | 1064 | } else { | ||
1056 | if (!Settings::keepOpen() && hasFocus()) { | 1065 | if (!Settings::keepOpen() && hasFocus()) { | ||
1057 | toggleWindowState(); | 1066 | toggleWindowState(); | ||
1058 | } | 1067 | } | ||
1059 | } | 1068 | } | ||
1060 | } | 1069 | } | ||
1061 | 1070 | | |||
1062 | void MainWindow::changeEvent(QEvent* event) | 1071 | void MainWindow::changeEvent(QEvent* event) | ||
▲ Show 20 Lines • Show All 272 Lines • ▼ Show 20 Line(s) | 1339 | { | |||
1335 | if (Settings::pollMouse()) toggleMousePoll(false); | 1344 | if (Settings::pollMouse()) toggleMousePoll(false); | ||
1336 | if (Settings::rememberFullscreen()) setFullScreen(m_isFullscreen); | 1345 | if (Settings::rememberFullscreen()) setFullScreen(m_isFullscreen); | ||
1337 | } | 1346 | } | ||
1338 | 1347 | | |||
1339 | void MainWindow::sharedAfterOpenWindow() | 1348 | void MainWindow::sharedAfterOpenWindow() | ||
1340 | { | 1349 | { | ||
1341 | if (!Settings::firstRun()) KWindowSystem::forceActiveWindow(winId()); | 1350 | if (!Settings::firstRun()) KWindowSystem::forceActiveWindow(winId()); | ||
1342 | 1351 | | |||
1352 | if (m_isWayland) { | ||||
1353 | connect(qApp, &QApplication::focusChanged, this, &MainWindow::wmActiveWindowChanged); | ||||
1354 | } else { | ||||
1343 | connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged, | 1355 | connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged, | ||
1344 | this, &MainWindow::wmActiveWindowChanged); | 1356 | this, &MainWindow::wmActiveWindowChanged); | ||
1357 | } | ||||
1345 | 1358 | | |||
1346 | applyWindowProperties(); | 1359 | applyWindowProperties(); | ||
1347 | 1360 | | |||
1348 | #if HAVE_KWAYLAND | 1361 | #if HAVE_KWAYLAND | ||
1349 | initWaylandSurface(); | 1362 | initWaylandSurface(); | ||
1350 | #endif | 1363 | #endif | ||
1351 | 1364 | | |||
1352 | emit windowOpened(); | 1365 | emit windowOpened(); | ||
1353 | } | 1366 | } | ||
1354 | 1367 | | |||
1355 | void MainWindow::sharedPreHideWindow() | 1368 | void MainWindow::sharedPreHideWindow() | ||
1356 | { | 1369 | { | ||
1370 | if (m_isWayland) { | ||||
1371 | disconnect(qApp, &QApplication::focusChanged, this, &MainWindow::wmActiveWindowChanged); | ||||
1372 | } else { | ||||
1357 | disconnect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged, | 1373 | disconnect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged, | ||
1358 | this, &MainWindow::wmActiveWindowChanged); | 1374 | this, &MainWindow::wmActiveWindowChanged); | ||
1359 | } | 1375 | } | ||
1376 | } | ||||
1360 | 1377 | | |||
1361 | void MainWindow::sharedAfterHideWindow() | 1378 | void MainWindow::sharedAfterHideWindow() | ||
1362 | { | 1379 | { | ||
1363 | if (Settings::pollMouse()) toggleMousePoll(true); | 1380 | if (Settings::pollMouse()) toggleMousePoll(true); | ||
1364 | 1381 | | |||
1365 | #if HAVE_KWAYLAND | 1382 | #if HAVE_KWAYLAND | ||
1366 | delete m_plasmaShellSurface; | 1383 | delete m_plasmaShellSurface; | ||
1367 | m_plasmaShellSurface = Q_NULLPTR; | 1384 | m_plasmaShellSurface = Q_NULLPTR; | ||
▲ Show 20 Lines • Show All 191 Lines • Show Last 20 Lines |