Skip to content

Commit

Permalink
Activate window before replay mouse press event
Browse files Browse the repository at this point in the history
Activate the window of the widget under mouse pointer before replay mouse
press event.

Change-Id: I9e699374accf108aa49b2a3c73d5e76631100dfd
Reviewed-by: Friedemann Kleint <[email protected]>
Reviewed-by: Samuel Rødal <[email protected]>
Reviewed-by: Gunnar Sletta <[email protected]>
  • Loading branch information
jianliang79 authored and The Qt Project committed Feb 20, 2013
1 parent a4c9ddb commit af27b37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/widgets/kernel/qwidgetwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
// the popup disappeared, replay the mouse press event
QWidget *w = QApplication::widgetAt(event->globalPos());
if (w && !QApplicationPrivate::isBlockedByModal(w)) {
// activate window of the widget under mouse pointer
if (!w->isActiveWindow()) {
w->activateWindow();
w->raise();
}

QWindow *win = w->windowHandle();
if (!win)
win = w->nativeParentWidget()->windowHandle();
Expand Down

0 comments on commit af27b37

Please sign in to comment.