fix:修复最大化和最小化失败问题

Signed-off-by: zhoudisi <zhoudisi@kylinos.cn>
This commit is contained in:
zhoudisi 2024-05-16 16:31:36 +08:00
parent 8212124975
commit 6653989ec1
3 changed files with 15 additions and 9 deletions

9
debian/changelog vendored
View File

@ -1,3 +1,12 @@
yhkylin-backup-tools (4.1.0.1-ok11) nile; urgency=medium
* BUG: #226486 【wlcom】【备份还原】最小化与最大化按钮失效无响应
* 需求号: 无
* 其他改动说明: 无
* 其他改动影响域: 无
-- zhoudisi <zhoudisi@kylinos.cn> Thu, 16 May 2024 16:30:06 +0800
yhkylin-backup-tools (4.1.0.1-ok10) nile; urgency=medium yhkylin-backup-tools (4.1.0.1-ok10) nile; urgency=medium
* BUG: 无 * BUG: 无

View File

@ -35,9 +35,9 @@ MainDialog::MainDialog(QWidget *parent)
this->setProperty("useSystemStyleBlur", true); this->setProperty("useSystemStyleBlur", true);
this->setAutoFillBackground(true); this->setAutoFillBackground(true);
connect(kdk::WindowManager::self(), &kdk::WindowManager::windowAdded, this, [=](const kdk::WindowId& window_id){ connect(kdk::WindowManager::self(), &kdk::WindowManager::windowAdded, this, [=](const kdk::WindowId& window_id){
if (getpid() == kdk::WindowManager::getPid(window_id) && m_window_id == 0) if (getpid() == kdk::WindowManager::getPid(window_id) && m_window_id.isNull())
{ {
m_window_id = window_id.toULongLong(); m_window_id = window_id.toString();
} }
}); });
@ -226,16 +226,13 @@ void MainDialog::initConnect()
}); });
//最小化按钮 //最小化按钮
connect(m_minBtn, &QPushButton::clicked, this, [=](){ connect(m_minBtn, &QPushButton::clicked, this, &MainDialog::showMinimized);
kdk::WindowManager::minimizeWindow(m_window_id);
});
//最大化按钮 //最大化按钮
connect(m_maxBtn, &QPushButton::clicked, this, [=] { connect(m_maxBtn, &QPushButton::clicked, this, [=] {
if (isMaximized()) { if (isMaximized()) {
showNormal(); showNormal();
} else { } else {
kdk::WindowManager::maximizeWindow(m_window_id); showMaximized();
} }
}); });
connect(m_titleWidget, &DoubleClickWidget::doubleClicked, m_maxBtn, &QPushButton::click); connect(m_titleWidget, &DoubleClickWidget::doubleClicked, m_maxBtn, &QPushButton::click);
@ -444,7 +441,7 @@ void MainDialog::resizeEvent(QResizeEvent *event) {
void MainDialog::closeBtn() void MainDialog::closeBtn()
{ {
if (this->close()) { if (this->close()) {
kdk::WindowManager::closeWindow(m_window_id); qApp->quit();
} }
} }

View File

@ -74,7 +74,7 @@ private:
// 监控是否平板的dbus接口 // 监控是否平板的dbus接口
QDBusInterface * m_statusSessionDbus = nullptr; QDBusInterface * m_statusSessionDbus = nullptr;
quint64 m_window_id; QString m_window_id;
Ui::MainDialog *ui; Ui::MainDialog *ui;
}; };