client: Port QWaylandInputDevice to support QT_NO_CONTEXTLESS_CONNECT

There were two existing usages of the 3-arg connect, but the timer is
always scoped to be shorter than the receiver so it was previously safe.

Change-Id: I0bb5a38fed997cbb68e49defc51972894f5239ee
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
This commit is contained in:
David Edmundson 2023-07-10 22:24:28 +01:00
parent ea30d389f8
commit 3783016b72

View File

@ -64,7 +64,7 @@ QWaylandInputDevice::Keyboard::Keyboard(QWaylandInputDevice *p)
: mParent(p)
{
init(p->get_keyboard());
mRepeatTimer.callOnTimeout([&]() {
mRepeatTimer.callOnTimeout(this, [&]() {
if (!focusWindow()) {
// We destroyed the keyboard focus surface, but the server didn't get the message yet...
// or the server didn't send an enter event first.
@ -132,7 +132,7 @@ QWaylandInputDevice::Pointer::Pointer(QWaylandInputDevice *seat)
}
mCursor.frameTimer.setSingleShot(true);
mCursor.frameTimer.callOnTimeout([&]() {
mCursor.frameTimer.callOnTimeout(this, [&]() {
cursorTimerCallback();
});
#endif