GNOME Bugzilla – Bug 758239
Fetch input event codes from ClutterEvent directly
Last modified: 2015-11-25 17:05:24 UTC
In bug #758238 I've attached some patches that let Clutter carry event codes in ClutterEvents, this can help making the places where we figure out the event codes ourselves a lot simpler, also in prevision to tablets/buttonsets being handled. I'm attaching here the mutter-side patches to make use of that.
Created attachment 315773 [details] [review] wayland: Fetch pointer button event codes from the ClutterEvent No more reverse mapping the 1-indexed button to an event code.
Created attachment 315774 [details] [review] wayland: Fetch keyboard event codes from ClutterEvents No more figuring out of event->key.hardware_keycode.
Uhm... I can't just remove that code, otherwise I break nested compositors. Attaching new patches.
Created attachment 315890 [details] [review] wayland: Fetch pointer button event codes from the ClutterEvent When running as a native compositor, we can just do that. However, the previous code must stay for whenever it's run as a X11 client.
Created attachment 315891 [details] [review] wayland: Fetch keyboard event codes from ClutterEvents When running as a native compositor, we can just do that. However, the previous code must stay for whenever it's run as a X11 client.
Review of attachment 315891 [details] [review]: ::: src/wayland/meta-wayland-keyboard.c @@ +457,3 @@ { gboolean is_press = event->type == CLUTTER_KEY_PRESS; + MetaBackend *backend = meta_get_backend (); I suppose we will never ever build this file without HAVE_NATIVE_BACKEND not defined, but this will cause an "unused variable" warning when its not.
Review of attachment 315890 [details] [review]: ::: src/wayland/meta-wayland-pointer.c @@ +309,3 @@ + default: + button = button + (BTN_LEFT - 1) + 4; + break; Already discussed this but the changes to the switch statement should either be documented in the commit message or split out in a separate commit.
Thanks for the review! Pushed with a HAVE_NATIVE_BACKEND check around that variable declaration, and further explanations in the meta-wayland-pointer.c patch commit log. Attachment 315890 [details] pushed as 7309b20 - wayland: Fetch pointer button event codes from the ClutterEvent Attachment 315891 [details] pushed as 3078f70 - wayland: Fetch keyboard event codes from ClutterEvents