Changeset View
Standalone View
pointer_input.h
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | |||||
52 | class DecoratedClientImpl; | 52 | class DecoratedClientImpl; | ||
53 | } | 53 | } | ||
54 | 54 | | |||
55 | namespace LibInput | 55 | namespace LibInput | ||
56 | { | 56 | { | ||
57 | class Device; | 57 | class Device; | ||
58 | } | 58 | } | ||
59 | 59 | | |||
60 | uint32_t qtMouseButtonToButton(Qt::MouseButton button); | ||||
zzag: Wouldn't it be better to have an utility function that one can use to get a button code for the… | |||||
Why add a function nobody needs? The function is already present, only not exposed to the header. apol: Why add a function nobody needs? The function is already present, only not exposed to the… | |||||
I'm asking you only to replace buttonCodeToQt with the utility function. // pointer_input.h uint32_t qtToButtonMouseButton(Qt::MouseButton button); // pointer_input.cpp uint32_t qtToButtonMouseButton(Qt::MouseButton button) { return s_buttonToQtMouseButton.key(button); } zzag: I'm asking you only to replace `buttonCodeToQt` with the utility function.
```lang=cpp
//… | |||||
Yea, definitely makes sense. Also that the function for the other direction is not implemented. romangg: Yea, definitely makes sense. Also that the function for the other direction is not implemented. | |||||
romangg: I meant "not exposed" | |||||
I agree it's better as a function, I was asked to return a hash in this comment here Maybe I misunderstood, @romangg can you confirm? apol: I agree it's better as a function, I was asked to return a hash in this comment here
https… | |||||
Yea, this was a misunderstanding. I meant there the internal representation should be changed to being a hash instead of a switch-statement in a separate patch (as you did in D25763), but I didn't mean that the getter should return the full hash, only that the getter should be exposed as well in a separate patch. romangg: Yea, this was a misunderstanding. I meant there the internal representation should be changed… | |||||
61 | | ||||
60 | class KWIN_EXPORT PointerInputRedirection : public InputDeviceHandler | 62 | class KWIN_EXPORT PointerInputRedirection : public InputDeviceHandler | ||
61 | { | 63 | { | ||
62 | Q_OBJECT | 64 | Q_OBJECT | ||
63 | public: | 65 | public: | ||
64 | explicit PointerInputRedirection(InputRedirection *parent); | 66 | explicit PointerInputRedirection(InputRedirection *parent); | ||
65 | ~PointerInputRedirection() override; | 67 | ~PointerInputRedirection() override; | ||
66 | 68 | | |||
67 | void init() override; | 69 | void init() override; | ||
▲ Show 20 Lines • Show All 192 Lines • Show Last 20 Lines |
Wouldn't it be better to have an utility function that one can use to get a button code for the given Qt::MouseButton?
API-wise, I think we need something like this