mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-03 00:15:21 +00:00
get focus when show
Change-Id: I00ed2816bb9a90eb1e815f4be29418257654b98d
This commit is contained in:
parent
df0d9d1147
commit
fe212ce82a
Notes:
Deepin Code Review
2016-09-05 06:41:44 +00:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: 石博文 <sbw@sbw.so> Submitted-by: 石博文 <sbw@sbw.so> Submitted-at: Mon, 05 Sep 2016 06:41:44 +0000 Reviewed-on: https://cr.deepin.io/15846 Project: dde/dde-dock Branch: refs/heads/master
@ -70,11 +70,23 @@ void DockPopupWindow::hide()
|
||||
DArrowRectangle::hide();
|
||||
}
|
||||
|
||||
void DockPopupWindow::showEvent(QShowEvent *e)
|
||||
{
|
||||
DArrowRectangle::showEvent(e);
|
||||
|
||||
QTimer::singleShot(1, this, [&] {
|
||||
raise();
|
||||
activateWindow();
|
||||
setFocus(Qt::ActiveWindowFocusReason);
|
||||
});
|
||||
}
|
||||
|
||||
void DockPopupWindow::enterEvent(QEvent *e)
|
||||
{
|
||||
DArrowRectangle::enterEvent(e);
|
||||
|
||||
raise();
|
||||
activateWindow();
|
||||
setFocus(Qt::ActiveWindowFocusReason);
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@ signals:
|
||||
void accept() const;
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent *e);
|
||||
void enterEvent(QEvent *e);
|
||||
void mousePressEvent(QMouseEvent *e);
|
||||
bool eventFilter(QObject *o, QEvent *e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user