X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/9061b22a0d0bc6bd7b9a1c31a5296bd00af60d0b..c9217337c717c336eb8cfcc27e9d4992bc1ebb37:/src/dolphinmainwindow.cpp diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 5061a10af..7931bab58 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -277,6 +277,31 @@ void DolphinMainWindow::openFiles(const QStringList &files, bool splitView) openFiles(QUrl::fromStringList(files), splitView); } +bool DolphinMainWindow::isOnCurrentDesktop() const +{ +#if HAVE_X11 + if (KWindowSystem::isPlatformX11()) { + const NET::Properties properties = NET::WMDesktop; + KWindowInfo info(this->winId(), properties); + return info.isOnCurrentDesktop(); + } +#endif + return true; +} + +bool DolphinMainWindow::isOnActivity(const QString &activityId) const +{ +#if HAVE_X11 && HAVE_KACTIVITIES + if (KWindowSystem::isPlatformX11()) { + const NET::Properties properties = NET::Supported; + const NET::Properties2 properties2 = NET::WM2Activities; + KWindowInfo info(this->winId(), properties, properties2); + return info.activities().contains(activityId); + } +#endif + return true; +} + void DolphinMainWindow::activateWindow(const QString &activationToken) { window()->setAttribute(Qt::WA_NativeWindow, true); @@ -1479,7 +1504,7 @@ void DolphinMainWindow::slotStorageTearDownFromPlacesRequested(const QString &mo setViewsToHomeIfMountPathOpen(mountPath); }); - if (m_terminalPanel && m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) { + if (m_terminalPanel && m_terminalPanel->currentWorkingDirectoryIsChildOf(mountPath)) { m_tearDownFromPlacesRequested = true; m_terminalPanel->goHome(); // m_placesPanel->proceedWithTearDown() will be called in slotTerminalDirectoryChanged @@ -1494,7 +1519,7 @@ void DolphinMainWindow::slotStorageTearDownExternallyRequested(const QString &mo setViewsToHomeIfMountPathOpen(mountPath); }); - if (m_terminalPanel && m_terminalPanel->currentWorkingDirectory().startsWith(mountPath)) { + if (m_terminalPanel && m_terminalPanel->currentWorkingDirectoryIsChildOf(mountPath)) { m_tearDownFromPlacesRequested = false; m_terminalPanel->goHome(); }