mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
example compositor: handle keyboard after we're done with init
the libinput backend does wl_display roundtrips, during which there is a small window where keystrokes can be handled before the rest of the example compositor is ready. Setting the callback later ensures we're not called at this point
This commit is contained in:
parent
a1c3636d69
commit
2948f53721
1 changed files with 2 additions and 1 deletions
|
@ -143,7 +143,6 @@ int main() {
|
|||
struct compositor_state compositor = { 0,
|
||||
.data = &state,
|
||||
.output_frame_cb = handle_output_frame,
|
||||
.keyboard_key_cb = handle_keyboard_key
|
||||
};
|
||||
compositor_init(&compositor);
|
||||
|
||||
|
@ -178,6 +177,8 @@ int main() {
|
|||
break;
|
||||
}
|
||||
|
||||
compositor.keyboard_key_cb = handle_keyboard_key;
|
||||
|
||||
wl_display_run(compositor.display);
|
||||
|
||||
close(state.keymap_fd);
|
||||
|
|
Loading…
Reference in a new issue