~vanvugt/mir/new-performance-test

« back to all changes in this revision

Viewing changes to src/server/input/key_repeat_dispatcher.h

  • Committer: Tarmac
  • Author(s): Andreas Pokorny
  • Date: 2016-04-11 18:33:13 UTC
  • mfrom: (3427.1.5 fix-1549701)
  • Revision ID: tarmac-20160411183313-78tztt75rx9hhhxh
Disable key repeat on arale & mtk-tpd (LP: #1549701)

The arale touchscreen driver simulates a button. When the screen is turned off while the button is held and then released mir will not receive the release event or any notice that the device is off. To avoid that mir keeps on sending repeat events, repeats for the touchscreen are disabled. Fixes: https://bugs.launchpad.net/bugs/1549701.

Approved by mir-ci-bot, Alberto Aguirre, Alan Griffiths, Kevin DuBois, Cemil Azizoglu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include "mir/input/input_dispatcher.h"
23
23
#include "mir/input/input_device_observer.h"
 
24
#include "mir/optional_value.h"
24
25
 
25
26
#include <memory>
26
27
#include <chrono>
49
50
                        std::shared_ptr<cookie::Authority> const& cookie_authority,
50
51
                        bool repeat_enabled,
51
52
                        std::chrono::milliseconds repeat_timeout, /* timeout before sending first repeat */
52
 
                        std::chrono::milliseconds repeat_delay /* delay between repeated keys */);
 
53
                        std::chrono::milliseconds repeat_delay, /* delay between repeated keys */
 
54
                        bool disable_repeat_on_touchscreen);
53
55
 
54
56
    // InputDispatcher
55
57
    bool dispatch(MirEvent const& event) override;
58
60
 
59
61
    void set_input_device_hub(std::shared_ptr<InputDeviceHub> const& hub);
60
62
 
 
63
    void set_touch_button_device(MirInputDeviceId id);
 
64
    void remove_device(MirInputDeviceId id);
61
65
private:
62
66
    std::mutex repeat_state_mutex;
63
67
 
67
71
    bool const repeat_enabled;
68
72
    std::chrono::milliseconds repeat_timeout;
69
73
    std::chrono::milliseconds repeat_delay;
 
74
    bool const disable_repeat_on_touchscreen;
 
75
    optional_value<MirInputDeviceId> touch_button_device;
70
76
 
71
77
    struct KeyboardState
72
78
    {