refactor: replace anon Enum in XWindowsKeyState with static vars
This commit is contained in:
committed by
Chris Rizzitello
parent
181d862838
commit
e37cea2d6b
@ -71,17 +71,17 @@ void XWindowsKeyState::init(const Display *display, bool useXKB)
|
||||
m_xkb = nullptr;
|
||||
}
|
||||
#endif
|
||||
setActiveGroup(kGroupPoll);
|
||||
setActiveGroup(s_groupPoll);
|
||||
}
|
||||
|
||||
void XWindowsKeyState::setActiveGroup(int32_t group)
|
||||
{
|
||||
if (group == kGroupPollAndSet) {
|
||||
if (group == s_groupPollAndSet) {
|
||||
// we need to set the group to -1 in order for pollActiveGroup() to
|
||||
// actually poll for the group
|
||||
m_group = -1;
|
||||
m_group = pollActiveGroup();
|
||||
} else if (group == kGroupPoll) {
|
||||
} else if (group == s_groupPoll) {
|
||||
m_group = -1;
|
||||
} else {
|
||||
assert(group >= 0);
|
||||
|
||||
@ -32,11 +32,8 @@ class XWindowsKeyState : public KeyState
|
||||
{
|
||||
public:
|
||||
using KeycodeList = std::vector<int>;
|
||||
enum
|
||||
{
|
||||
kGroupPoll = -1,
|
||||
kGroupPollAndSet = -2
|
||||
};
|
||||
inline static const auto s_groupPoll = -1;
|
||||
inline static const auto s_groupPollAndSet = -2;
|
||||
|
||||
XWindowsKeyState(Display *, bool useXKB, IEventQueue *events);
|
||||
XWindowsKeyState(Display *, bool useXKB, IEventQueue *events, deskflow::KeyMap &keyMap);
|
||||
@ -48,9 +45,9 @@ public:
|
||||
//! Set active group
|
||||
/*!
|
||||
Sets the active group to \p group. This is the group returned by
|
||||
\c pollActiveGroup(). If \p group is \c kGroupPoll then
|
||||
\c pollActiveGroup(). If \p group is \c s_groupPoll then
|
||||
\c pollActiveGroup() will really poll, but that's a slow operation
|
||||
on X11. If \p group is \c kGroupPollAndSet then this will poll the
|
||||
on X11. If \p group is \c s_groupPollAndSet then this will poll the
|
||||
active group now and use it for future calls to \c pollActiveGroup().
|
||||
*/
|
||||
void setActiveGroup(int32_t group);
|
||||
|
||||
Reference in New Issue
Block a user