[PATCH weston v2 1/3] toytoolkit: Allow operation without a keymap

Rob Bradford robert.bradford at intel.com
Fri Jun 21 10:20:10 PDT 2013


From: Matt Roper <matthew.d.roper at intel.com>

In preparation for upcoming changes, we want to make sure that apps
written with the toy toolkit continue to operate properly if no XKB
keymap is received.  If there's no XKB keymap, then we shouldn't
try to figure out keyboard modifier states (since we probably don't
even have equivalents of PC-style modifiers).

Reviewed-by: Singh, Satyeshwar <satyeshwar.singh at intel.com>
Reviewed-by: Bob Paauwe <bob.j.paauwe at intel.com>
---
 clients/window.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/clients/window.c b/clients/window.c
index c13d207..c8e421b 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -3067,6 +3067,10 @@ keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard,
 	struct input *input = data;
 	xkb_mod_mask_t mask;
 
+	/* If we're not using a keymap, then we don't handle PC-style modifiers */
+	if (!input->xkb.keymap)
+		return;
+
 	xkb_state_update_mask(input->xkb.state, mods_depressed, mods_latched,
 			      mods_locked, 0, 0, group);
 	mask = xkb_state_serialize_mods(input->xkb.state,
-- 
1.8.2.1



More information about the wayland-devel mailing list