解决wayland下应用过程中导致开始菜单阻塞问题

This commit is contained in:
lixueman 2022-08-31 01:07:32 +08:00
parent b86148af59
commit cf5b01a5f4
14 changed files with 27 additions and 71 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
ukui-menu (3.1.1-ok4~0831) yangtze; urgency=medium
* close-cd # 131373 【wayland】【软件更新器】点击打开软件更新器后开始菜单过6s左右才退出;
-- lixueman <lixueman@kylinos.cn> Wed, 31 Aug 2022 00:52:08 +0800
ukui-menu (3.1.1-ok4~0818) yangtze; urgency=medium
* close-cd #125159 修改全屏下固定到收藏不生效问题

View File

@ -2,6 +2,7 @@
#include "klistview.h"
#include "utility.h"
#include <QScrollBar>
#include <QtConcurrent/QtConcurrent>
#include "rightclickmenu.h"
KListView::KListView(QWidget *parent):
@ -42,11 +43,11 @@ void KListView::updateData(QStringList data)
void KListView::onClicked(QModelIndex index)
{
QVariant var = listmodel->data(index, Qt::DisplayRole);
if (var.isValid()) {
QString desktopfp = var.value<QString>();
myDebug() << "KListView点击应用" << desktopfp << "触发隐藏信号";
Q_EMIT sendHideMainWindowSignal();
execApp(desktopfp);
QtConcurrent::run(execApp, QString(desktopfp));
}
}

View File

@ -21,6 +21,7 @@
#include "utility.h"
#include <QDebug>
#include <QDesktopServices>
#include <QtConcurrent/QtConcurrent>
ListView::ListView(QWidget *parent/*, int width, int height, int module*/):
KListView(parent)
@ -107,8 +108,9 @@ void ListView::onClicked(QModelIndex index)
if (var.value<QStringList>().at(1).toInt() == 0) {
Q_EMIT sendAppClassificationBtnClicked();
} else {
myDebug() << "ListView打开应用触发隐藏";
Q_EMIT sendHideMainWindowSignal();
execApp(desktopfp);
QtConcurrent::run(execApp, QString(desktopfp));
}
}
}

View File

@ -22,6 +22,7 @@
#include <syslog.h>
#include <QPushButton>
#include <QGSettings>
#include <QtConcurrent/QtConcurrent>
RightListView::RightListView(QWidget *parent):
KListView(parent)
@ -128,12 +129,12 @@ void RightListView::keyPressEvent(QKeyEvent *e)
void RightListView::onClicked(QModelIndex index)
{
Q_EMIT sendHideMainWindowSignal();
QVariant var = listmodel->data(index, Qt::DisplayRole);
QString desktopfp = var.value<QStringList>().at(0);
if (var.isValid()) {
QString desktopfp = var.value<QString>();
execApp(desktopfp);
Q_EMIT sendHideMainWindowSignal();
QtConcurrent::run(execApp, QString(desktopfp));
}
}

View File

@ -147,7 +147,6 @@ void FullCommonUseWidget::initAppListWidget()
m_listView->installEventFilter(this);
m_scrollAreaWidLayout->addWidget(m_listView);
m_listView->setFixedWidth(m_scrollAreaWid->width());
connect(m_listView, &FullListView::sendItemClickedSignal, this, &FullCommonUseWidget::execApplication);
connect(m_listView, &FullListView::sendUpdateAppListSignal, this, &FullCommonUseWidget::updateListViewSlot);
connect(m_listView, &FullListView::sendCollectViewUpdate, this, &FullCommonUseWidget::sendCollectViewUpdate);
connect(m_listView, &FullListView::sendHideMainWindowSignal, this, &FullCommonUseWidget::sendHideMainWindowSignal);
@ -185,15 +184,6 @@ void FullCommonUseWidget::fillAppList()
resizeScrollAreaControls();
}
/**
*
*/
void FullCommonUseWidget::execApplication(QString desktopfp)
{
Q_EMIT sendHideMainWindowSignal();
execApp(desktopfp);
}
void FullCommonUseWidget::selectFirstItem()
{
m_listView->setCurrentIndex(m_listView->model()->index(0, 0));

View File

@ -102,11 +102,6 @@ protected:
bool eventFilter(QObject *watched, QEvent *event);
public Q_SLOTS:
/**
* @brief Open the application
* @param arg: Desktop file path
*/
void execApplication(QString desktopfp);
/**
* @brief Update the application list slot function
*/

View File

@ -208,21 +208,11 @@ void FullFunctionWidget::insertAppList(QStringList desktopfplist)
}
listview->addData(m_data);
connect(listview, &FullListView::sendItemClickedSignal, this, &FullFunctionWidget::execApplication);
connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullFunctionWidget::sendHideMainWindowSignal);
connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullFunctionWidget::sendUpdateCommonView);
connect(listview, &FullListView::sendCollectViewUpdate, this, &FullFunctionWidget::sendCollectViewUpdate);
}
/**
*
*/
void FullFunctionWidget::execApplication(QString desktopfp)
{
Q_EMIT sendHideMainWindowSignal();
execApp(desktopfp);
}
void FullFunctionWidget::on_setAreaScrollBarValue(int value)
{
// m_scrollArea->verticalScrollBar()->setMaximum(maxmumValue);

View File

@ -142,11 +142,6 @@ protected:
bool eventFilter(QObject *watched, QEvent *event);
public Q_SLOTS:
/**
* @brief Open the application
* @param arg: Desktop file path
*/
void execApplication(QString desktopfp);
/**
* @brief Respond to button click
* @param btn: QButtonGroup button

View File

@ -206,7 +206,6 @@ void FullLetterWidget::fillAppList()
}
listview->addData(m_data);
connect(listview, &FullListView::sendItemClickedSignal, this, &FullLetterWidget::execApplication);
connect(listview, &FullListView::sendHideMainWindowSignal, this, &FullLetterWidget::sendHideMainWindowSignal);
connect(listview, &FullListView::sendUpdateAppListSignal, this, &FullLetterWidget::sendUpdateCommonView);
connect(listview, &FullListView::sendCollectViewUpdate, this, &FullLetterWidget::sendCollectViewUpdate);
@ -216,15 +215,6 @@ void FullLetterWidget::fillAppList()
resizeScrollAreaControls();
}
/**
*
*/
void FullLetterWidget::execApplication(QString desktopfp)
{
Q_EMIT sendHideMainWindowSignal();
execApp(desktopfp);
}
void FullLetterWidget::on_setAreaScrollBarValue(int value)
{
// m_scrollArea->verticalScrollBar()->setMaximum(maxmumValue);

View File

@ -147,11 +147,6 @@ public Q_SLOTS:
* @param btn: QButtonGroup button
*/
void btnGroupClickedSlot(QAbstractButton *btn);
/**
* @brief Open the application
* @param arg: Desktop file path
*/
void execApplication(QString desktopfp);
/**
* @brief Update application list slot function
*/

View File

@ -136,7 +136,6 @@ void FullSearchResultWidget::initAppListWidget()
m_listView->installEventFilter(this);
m_scrollAreaWidLayout->addWidget(m_listView);
m_listView->setFixedWidth(m_scrollArea->width());
connect(m_listView, &FullListView::sendItemClickedSignal, this, &FullSearchResultWidget::execApplication);
connect(m_listView, &FullListView::sendHideMainWindowSignal, this, &FullSearchResultWidget::sendHideMainWindowSignal);
connect(m_listView, &FullListView::sendSetslidebar, this, &FullSearchResultWidget::onSetSlider);
connect(m_listView, &FullListView::sendCollectViewUpdate, this, &FullSearchResultWidget::sendCollectViewUpdate);
@ -148,14 +147,6 @@ void FullSearchResultWidget::fillAppList()
m_listView->addData(m_data);
resizeScrollAreaControls();
}
/**
*
*/
void FullSearchResultWidget::execApplication(QString desktopfp)
{
Q_EMIT sendHideMainWindowSignal();
execApp(desktopfp);
}
void FullSearchResultWidget::updateAppListView(QVector<QStringList> arg)
{

View File

@ -90,11 +90,6 @@ protected:
bool eventFilter(QObject *watched, QEvent *event);
public Q_SLOTS:
/**
* @brief Open the application
* @param arg: Desktop file path
*/
void execApplication(QString desktopfp);
void selectFirstItemTab();

View File

@ -1316,11 +1316,13 @@ void MainWindow::hideWindow()
{
myDebug() << "调用开始菜单隐藏";
if (m_fullWindow->isVisible()) {
myDebug() << "全屏窗口隐藏";
m_fullWindow->hide();
m_fullWindow->resetEditline();
this->clearFocus();
m_isFullScreen = true;
} else {
myDebug() << "默认窗口隐藏";
this->hide();
m_topStackedWidget->setCurrentIndex(0);
m_lineEdit->clear();

View File

@ -28,6 +28,7 @@
#include <QApplication>
#include <QDBusInterface>
#include <QScreen>
#include <QtConcurrent/QtConcurrent>
#include "ukuimenuinterface.h"
#define DATABASENAME QDir::homePath()+"/.config/ukui/"+"UkuiMenu.db"
@ -710,14 +711,16 @@ bool deleteAppRecord(QString desktopfn)
void execApp(QString desktopfp)
{
QDBusReply<bool> result;
if (QDBusConnection::connectToBus(QDBusConnection::SessionBus, QString("com.kylin.AppManager")).isConnected()) {
QDBusInterface iface("com.kylin.AppManager", "/com/kylin/AppManager", "com.kylin.AppManager");
if (iface.isValid()) {
result = iface.call("LaunchApp", desktopfp);
myDebug() << "LaunchApp desktopFile:" << desktopfp;
}
}
QDBusInterface iface("com.kylin.AppManager",
"/com/kylin/AppManager",
"com.kylin.AppManager",
QDBusConnection::sessionBus());
QDBusReply<bool> res = iface.call("LaunchApp", desktopfp);
if (!res.isValid() || !res) {
if (!result.isValid() || !result) {
UkuiMenuInterface interface;