Changeset View
Changeset View
Standalone View
Standalone View
pointer_input.cpp
1 | /******************************************************************** | 1 | /******************************************************************** | ||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | 2 | KWin - the KDE window manager | ||
3 | This file is part of the KDE project. | 3 | This file is part of the KDE project. | ||
4 | 4 | | |||
5 | Copyright (C) 2013, 2016 Martin Gräßlin <mgraesslin@kde.org> | 5 | Copyright (C) 2013, 2016 Martin Gräßlin <mgraesslin@kde.org> | ||
6 | Copyright (C) 2018 Roman Gilg <subdiff@gmail.com> | 6 | Copyright (C) 2018 Roman Gilg <subdiff@gmail.com> | ||
7 | Copyright (C) 2019 Vlad Zagorodniy <vladzzag@gmail.com> | ||||
7 | 8 | | |||
8 | This program is free software; you can redistribute it and/or modify | 9 | This program is free software; you can redistribute it and/or modify | ||
9 | it under the terms of the GNU General Public License as published by | 10 | it under the terms of the GNU General Public License as published by | ||
10 | the Free Software Foundation; either version 2 of the License, or | 11 | the Free Software Foundation; either version 2 of the License, or | ||
11 | (at your option) any later version. | 12 | (at your option) any later version. | ||
12 | 13 | | |||
13 | This program is distributed in the hope that it will be useful, | 14 | This program is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
▲ Show 20 Lines • Show All 299 Lines • ▼ Show 20 Line(s) | 288 | { | |||
314 | 315 | | |||
315 | input()->processFilters(std::bind(&InputEventFilter::pointerEvent, std::placeholders::_1, &event, button)); | 316 | input()->processFilters(std::bind(&InputEventFilter::pointerEvent, std::placeholders::_1, &event, button)); | ||
316 | 317 | | |||
317 | if (state == InputRedirection::PointerButtonReleased) { | 318 | if (state == InputRedirection::PointerButtonReleased) { | ||
318 | update(); | 319 | update(); | ||
319 | } | 320 | } | ||
320 | } | 321 | } | ||
321 | 322 | | |||
322 | void PointerInputRedirection::processAxis(InputRedirection::PointerAxis axis, qreal delta, uint32_t time, LibInput::Device *device) | 323 | void PointerInputRedirection::processAxis(InputRedirection::PointerAxis axis, qreal delta, qint32 discreteDelta, | ||
324 | InputRedirection::PointerAxisSource source, uint32_t time, LibInput::Device *device) | ||||
323 | { | 325 | { | ||
324 | if (delta == 0) { | | |||
325 | return; | | |||
326 | } | | |||
327 | update(); | 326 | update(); | ||
328 | 327 | | |||
329 | emit input()->pointerAxisChanged(axis, delta); | 328 | emit input()->pointerAxisChanged(axis, delta); | ||
330 | 329 | | |||
331 | WheelEvent wheelEvent(m_pos, delta, | 330 | WheelEvent wheelEvent(m_pos, delta, discreteDelta, | ||
332 | (axis == InputRedirection::PointerAxisHorizontal) ? Qt::Horizontal : Qt::Vertical, | 331 | (axis == InputRedirection::PointerAxisHorizontal) ? Qt::Horizontal : Qt::Vertical, | ||
333 | m_qtButtons, input()->keyboardModifiers(), time, device); | 332 | m_qtButtons, input()->keyboardModifiers(), source, time, device); | ||
334 | wheelEvent.setModifiersRelevantForGlobalShortcuts(input()->modifiersRelevantForGlobalShortcuts()); | 333 | wheelEvent.setModifiersRelevantForGlobalShortcuts(input()->modifiersRelevantForGlobalShortcuts()); | ||
335 | 334 | | |||
336 | input()->processSpies(std::bind(&InputEventSpy::wheelEvent, std::placeholders::_1, &wheelEvent)); | 335 | input()->processSpies(std::bind(&InputEventSpy::wheelEvent, std::placeholders::_1, &wheelEvent)); | ||
337 | 336 | | |||
338 | if (!inited()) { | 337 | if (!inited()) { | ||
339 | return; | 338 | return; | ||
340 | } | 339 | } | ||
341 | input()->processFilters(std::bind(&InputEventFilter::wheelEvent, std::placeholders::_1, &wheelEvent)); | 340 | input()->processFilters(std::bind(&InputEventFilter::wheelEvent, std::placeholders::_1, &wheelEvent)); | ||
▲ Show 20 Lines • Show All 1071 Lines • Show Last 20 Lines |