Skip to content

Commit 27ef987

Browse files
fix(quickpanel): delay DBus call to wait for panel close animation
Delay StartScreenshot DBus call by 300ms after clicking the quick panel screenshot button, allowing the quick panel close animation to complete before the screenshot window appears. bug: https://pms.uniontech.com/bug-view-358533.html
1 parent 9eed451 commit 27ef987

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ AI config
1212
.specstory/
1313
.vscode/
1414
.npm-cache/
15-
.claude/
15+
.claude/
16+
.trellis/

src/dde-dock-plugins/shotstart/shotstartplugin.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,13 @@ void ShotStartPlugin::onClickQuickPanel()
353353
if (!m_isRecording) {
354354
qCDebug(dsrApp) << "Get Shot DBus Interface";
355355
m_proxyInter->requestSetAppletVisible(this, pluginName(), false);
356-
QDBusInterface shotDBusInterface(
357-
"com.deepin.Screenshot", "/com/deepin/Screenshot", "com.deepin.Screenshot", QDBusConnection::sessionBus());
358-
shotDBusInterface.asyncCall("StartScreenshot");
359-
qCDebug(dsrApp) << "Shot and Recorder plugin start run!";
360-
qCDebug(dsrApp) << "Not recording, initiating StartScreenshot DBus call.";
356+
QTimer::singleShot(400, this, [this]() {
357+
QDBusInterface shotDBusInterface(
358+
"com.deepin.Screenshot", "/com/deepin/Screenshot", "com.deepin.Screenshot", QDBusConnection::sessionBus());
359+
shotDBusInterface.asyncCall("StartScreenshot");
360+
qCDebug(dsrApp) << "Shot and Recorder plugin start run!";
361+
qCDebug(dsrApp) << "Not recording, initiating StartScreenshot DBus call.";
362+
});
361363
} else {
362364
qCDebug(dsrApp) << "Recording in progress, ignoring quick panel click.";
363365
}

0 commit comments

Comments
 (0)