From fc64d521068658189fac85ce984334249d3604dc Mon Sep 17 00:00:00 2001 From: lixueman Date: Tue, 12 Jul 2022 08:54:54 +0000 Subject: [PATCH] =?UTF-8?q?!8=20=E8=A7=A3=E5=86=B3wayland=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=E7=8A=B6=E6=80=81=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E8=8F=9C=E5=8D=95=E5=8D=95=E4=BE=8B=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=9A=90=E8=97=8F=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 7 ++++++ .../qtsingleapplication.cpp | 22 +++++++++---------- src/UserInterface/ListView/klistview.cpp | 1 + src/UserInterface/mainwindow.cpp | 13 ++++++++++- src/UserInterface/mainwindow.h | 6 ++--- 5 files changed, 33 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7351f55..14d1fa8 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +ukui-menu (3.1.1-ok4~0712) yangtze; urgency=medium + + * close-cd #128498 + 修复【wayland】【开始菜单】多次点击tab键和回车键后,开始菜单点不开问题 + + -- lixueman Tue, 12 Jul 2022 16:11:49 +0800 + ukui-menu (3.1.1-ok4~0708) yangtze; urgency=medium * 调整全屏窗口初始化代码结构 diff --git a/src/QtSingleApplication/qtsingleapplication.cpp b/src/QtSingleApplication/qtsingleapplication.cpp index e3ba444..d957182 100755 --- a/src/QtSingleApplication/qtsingleapplication.cpp +++ b/src/QtSingleApplication/qtsingleapplication.cpp @@ -350,19 +350,17 @@ void QtSingleApplication::activateWindow() myDebug() << "单例触发activateWindow"; if (!g_projectCodeName.contains("V10SP1-edu")) { MainWindow *w = qobject_cast(actWin); + w->windowOption(); - if (this->applicationState() & Qt::ApplicationInactive) { - myDebug() << "单例内触发开始菜单显示"; - actWin->setWindowState(actWin->windowState() & ~Qt::WindowMinimized); - // actWin->raise(); - // actWin->showNormal(); - // actWin->activateWindow(); - w->showWindow(); - } else { - myDebug() << "单例内触发开始菜单隐藏"; - actWin->setWindowState(actWin->windowState() & Qt::WindowMinimized); - w->hideWindow(); - } +// if (this->applicationState() & Qt::ApplicationInactive) { +// myDebug() << "单例内触发开始菜单显示"; +// actWin->setWindowState(actWin->windowState() & ~Qt::WindowMinimized); +// w->showWindow(); +// } else { +// myDebug() << "单例内触发开始菜单隐藏"; +// actWin->setWindowState(actWin->windowState() & Qt::WindowMinimized); +// w->hideWindow(); +// } } else { TabletWindow *w = qobject_cast(actWin); w->showPCMenu(); diff --git a/src/UserInterface/ListView/klistview.cpp b/src/UserInterface/ListView/klistview.cpp index b927ba2..96a03e6 100755 --- a/src/UserInterface/ListView/klistview.cpp +++ b/src/UserInterface/ListView/klistview.cpp @@ -63,6 +63,7 @@ void KListView::paintEvent(QPaintEvent *e) void KListView::mouseMoveEvent(QMouseEvent *e) { this->clearFocus(); + return QListView::mouseMoveEvent(e); } void KListView::mousePressEvent(QMouseEvent *event) diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index d65d221..4a3f7d9 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -181,7 +181,7 @@ void MainWindow::registDbusServer() } else { m_fullWindow->show(); setMaxWindowPos(); - // fullWindow->raise(); + m_fullWindow->raise(); m_fullWindow->activateWindow(); } } @@ -506,6 +506,15 @@ void MainWindow::initTabOrder() setTabOrder(m_minMaxChangeButton, m_powerOffButton); } +void MainWindow::windowOption() +{ + if (this->isVisible() || m_fullWindow->isVisible()) { + hideWindow(); + } else { + showWindow(); + } +} + void MainWindow::initUi() { qDebug() << "init UI"; @@ -684,6 +693,7 @@ bool MainWindow::event(QEvent *event) if (QEvent::WindowDeactivate == event->type()) { //窗口停用 if (QApplication::activeWindow() != this) { qDebug() << " * 鼠标点击窗口外部事件"; + this->setWindowState(this->windowState() & Qt::WindowMinimized); this->hide(); m_topStackedWidget->setCurrentIndex(0); m_lineEdit->clear(); @@ -1340,6 +1350,7 @@ void MainWindow::repaintWidget() m_fullWindow->setFixedSize(width, height); m_fullWindow->repaintWidget(); } + void MainWindow::showNormalWindowSlot() { myDebug() << "Style::m_availableScreenWidth" << Style::m_availableScreenWidth << "Style::m_availableScreenHeight" << Style::m_availableScreenHeight; diff --git a/src/UserInterface/mainwindow.h b/src/UserInterface/mainwindow.h index 4f0baf3..30aa46b 100755 --- a/src/UserInterface/mainwindow.h +++ b/src/UserInterface/mainwindow.h @@ -65,9 +65,7 @@ public: explicit MainWindow(QWidget *parent = nullptr); ~MainWindow(); - void showWindow(); - - void hideWindow(); + void windowOption(); protected: void initSearchUi(); @@ -81,6 +79,8 @@ protected: void registDbusServer(); void setTabletModeFlag(); void initUi(); + void showWindow(); + void hideWindow(); /** * @brief 处理外部点击事件和主窗口键盘控制 * @param event