From 00b4bd0a4298f8ccd6ad7ba1e6ea37342f1b6a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Martsum?= Date: Wed, 8 May 2013 20:34:54 +0200 Subject: [PATCH] QWidgets QPA - remove wrong setting of mouse timestamp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comment to the code said it was to avoid double click. However it actually breaks wanted double clicks. The reason for it must be that the replayed event in earlier code versions could be changed into a double click (together with the first event). However (now) we only test qt_replay_popup_mouse_event in void QWidgetWindow::handleMouseEvent(QMouseEvent *event); Regardless what kind of event we receive as input it will send QEvent::MouseButtonPress when it sends replay mouse event. I.e. it will then call QCoreApplication::sendSpontaneousEvent(r,e) => QCoreApplication::notifyInternal(receiver, event) => QCoreApplication::notify(receiver, event) => QApplicationPrivate::notify_helper(receiver, event) (+filters) => (probably) QWidgeWindow::event(receiver, event) => further handling in widget classes. That especially means that it will *not* get into the function QGuiApplicationPrivate::processMouseEvent where doubleclicks are created. Therefore no doubleclick can be made from the extra event. That makes the statement have no good effect - just side effects. Change-Id: I190baff3c060548775201695e324059560bb7106 Reviewed-by: Samuel Rødal Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qapplication_qpa.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp index 2761c84a8dd..f6a8a3af3d8 100644 --- a/src/widgets/kernel/qapplication_qpa.cpp +++ b/src/widgets/kernel/qapplication_qpa.cpp @@ -196,7 +196,6 @@ void QApplicationPrivate::closePopup(QWidget *popup) // mouse release event or inside qt_replay_popup_mouse_event = false; } else { // mouse press event - QGuiApplicationPrivate::mousePressTime -= 10000; // avoid double click qt_replay_popup_mouse_event = true; }