fix: when there is focus on dockpopupwindow, it hide

Log: fix when there is focus and dockpopupwindow hide
This commit is contained in:
chenhongtao 2023-04-12 13:41:52 +08:00 committed by deepin-bot[bot]
parent 1bb0c628f3
commit c2ba4e4971
2 changed files with 9 additions and 4 deletions

View File

@ -213,6 +213,11 @@ void DockPopupWindow::ensureRaised()
void DockPopupWindow::onButtonPress(int type, int x, int y, const QString &key)
{
// if there is something focus on widget, return
if (auto focus = qApp->focusWidget()) {
qDebug() << "PopupWindow not hide, focus className is" << focus->metaObject()->className();
return;
}
if (!m_enableMouseRelease)
return;
QRect screenRect = this->screen()->geometry();

View File

@ -52,10 +52,10 @@ signals:
void unusedSignal();
protected:
void showEvent(QShowEvent *e);
void hideEvent(QHideEvent *event);
void enterEvent(QEvent *e);
bool eventFilter(QObject *o, QEvent *e);
void showEvent(QShowEvent *e) override;
void hideEvent(QHideEvent *event) override;
void enterEvent(QEvent *e) override;
bool eventFilter(QObject *o, QEvent *e) override;
void blockButtonRelease();
private slots: