Add timestamp to window decoration mouse events

Since 4881dd63 replaced the double click timer for OffscreenQuickView
with a time check, we need to make sure the timestamp from
XInput/libinput is passed on to the actual QMouseEvent.

BUG: 448477
This commit is contained in:
Severin von Wnuck 2022-01-30 18:28:39 +01:00 committed by Nate Graham
parent e6fb6ff5d3
commit 5fe9fd13ad
2 changed files with 2 additions and 0 deletions

View file

@ -951,6 +951,7 @@ bool X11Client::buttonPressEvent(xcb_window_t w, int button, int state, int x, i
} else {
QMouseEvent event(QEvent::MouseButtonPress, QPointF(x, y), QPointF(x_root, y_root),
x11ToQtMouseButton(button), x11ToQtMouseButtons(state), x11ToQtKeyboardModifiers(state));
event.setTimestamp(time);
event.setAccepted(false);
QCoreApplication::sendEvent(decoration(), &event);
if (!event.isAccepted()) {

View file

@ -1195,6 +1195,7 @@ public:
return actionResult.second;
}
QMouseEvent e(event->type(), p, event->globalPos(), event->button(), event->buttons(), event->modifiers());
e.setTimestamp(event->timestamp());
e.setAccepted(false);
QCoreApplication::sendEvent(decoration->decoration(), &e);
if (!e.isAccepted() && event->type() == QEvent::MouseButtonPress) {