keyboard: Only set toplevel when there is a valid output

Graphics / Wayland / Weston - Armin Krezović [gmail.com] - 27 June 2016 06:23 UTC

Currently, the keyboard client is created and the input panel surface is set as toplevel on the first output it finds. This does not work in a scenario when there are no outputs, resulting in weston-keyboard to crash at startup due to operating on an invalid output pointer.

This makes input panel toplevel setting depend on a
valid output, and if there was no output present at startup, it will be set toplevel as soon as an output gets plugged in.

v2:

- Remove dependency on output pointer at startup- Only setup output_configure_handler after the keyboard has been created- Let the output_configure_handler handle toplevel setting in all cases

ea0316a keyboard: Only set toplevel when there is a valid output
clients/keyboard.c | 42 ++++++++++++++++++++++++++++++------------
1 file changed, 30 insertions(+), 12 deletions(-)

Upstream: cgit.freedesktop.org


  • Share