Skip to content

Commit 05dba44

Browse files
committed
make older wayland protocol versions run
1 parent 5464050 commit 05dba44

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/wayland/input_method/types.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ struct FreeDeleter{
1414
};
1515
// Dont use this for literals, only c strings that were allocated
1616
using uniqueCString = std::unique_ptr<const char, FreeDeleter>;
17+
18+
#ifndef WL_KEYBOARD_KEY_STATE_REPEATED_SINCE_VERSION
19+
// Hack to get old wayland version to build
20+
#define WL_KEYBOARD_KEY_STATE_REPEATED 2;
21+
#endif
22+
1723
}
1824

1925
} // namespace qs::wayland::input_method

src/wayland/input_method/virtual_keyboard.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ void VirtualKeyboardHandle::sendKey(xkb_keycode_t keycode, wl_keyboard_key_state
6464
if (!good) return;
6565
if (keycode == XKB_KEYCODE_INVALID) return;
6666

67+
#ifndef WL_KEYBOARD_KEY_STATE_REPEATED_SINCE_VERSION
68+
// Protocol version does not support
69+
if (state == WL_KEYBOARD_KEY_STATE_REPEATED) return;
70+
#endif
71+
6772
this->zwp_virtual_keyboard_v1::key(now(), keycode - 8, state);
6873
}
6974

0 commit comments

Comments
 (0)