Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 30 additions & 5 deletions src/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,18 @@ void MainWindow::initTreelandtAttributes() //initTreelandtAttributes

initBackground();
initShortcut();

#if defined __sw_64__
if (DSysInfo::uosEditionType() == DSysInfo::UosEdition::UosMilitary) {
//在sw military上锁屏、熄屏情况下都要结束
QDBusConnection::sessionBus().connect("com.deepin.SessionManager",
"/com/deepin/SessionManager",
"org.freedesktop.DBus.Properties",
"PropertiesChanged",
this,
SLOT(onLockedStopRecord(QString, QVariantMap, QStringList)));
}
#endif
qCDebug(dsrApp) << "Attributes initialization completed.";
}

Expand Down Expand Up @@ -2233,6 +2245,9 @@ void MainWindow::topWindow()
save2Clipboard(screenShotPix);
sendNotify(m_saveIndex, m_saveFileName, r);
qCDebug(dsrApp) << "topWindow end";
QTimer::singleShot(10, [=] {
exitApp();
});
}

void MainWindow::saveTopWindow()
Expand Down Expand Up @@ -2266,6 +2281,7 @@ void MainWindow::saveTopWindow()
const auto r = saveAction(screenShotPix);
sendNotify(m_saveIndex, m_saveFileName, r);
qCDebug(dsrApp) << "saveTopWindow end";
exitApp();
}

void MainWindow::savePath(const QString &path)
Expand Down Expand Up @@ -4727,10 +4743,9 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event)
// Use flag instead call `repaint` directly,
// to avoid repaint many times in one event function.
if (needRepaint) {
#if defined __mips__
// 在1052U2
// mips上碰到问题使用repaint()会导致界面卡死,换成update()才可保证程序正常,为保证其他架构不受影响故做了区分处理。
// 该问题目前只出现在1052U2上,1051的系统使用相同应用程序包无此问题。
#if defined (__mips__) || defined (__aarch64__)
//在1052U2 mips上碰到问题使用repaint()会导致界面卡死,换成update()才可保证程序正常,为保证其他架构不受影响故做了区分处理。
//该问题目前只出现在1052U2上,1051的系统使用相同应用程序包无此问题,在1070和1060也发现了此问题。
update();
#else
repaint();
Expand Down Expand Up @@ -6108,7 +6123,17 @@ void MainWindow::onPowersource(bool flag)
}
}

// 打开截图录屏帮助文档并定位到滚动截图
//锁屏后结束录屏
void MainWindow::onLockedStopRecord(const QString &name, QVariantMap map, const QStringList &list)
{
qDebug() << "Locked will quit!"<<"----------------" << name << map << list;

if (map.value("Locked").value<bool>()) {
onExit();
}
}

//打开截图录屏帮助文档并定位到滚动截图
void MainWindow::onOpenScrollShotHelp()
{
QDBusInterface interFace(
Expand Down
6 changes: 6 additions & 0 deletions src/main_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,12 @@ public slots:
*/
void onPowersource(bool flag);

/**
* @brief onPowersource 监听锁屏,监听锁屏信号,在锁屏后结束录屏,包括休眠恢复后也会锁屏,也会结束录屏
* @param flag
*/
void onLockedStopRecord(const QString &name, QVariantMap map, const QStringList &list);

/**
* @brief 打开截图录屏帮助文档并定位到滚动截图
*/
Expand Down