clutter: Move evdev evcode data to Clutter button/key events

We have this as platform-dependent data in the native backend, and
a bunch of fallback code done in place in the evcode users. Stop
making this platform-dependent data, and move it to the relevant
ClutterEvents.

The fallback code for the X11 backend case is about the same, but
now it is done directly by the X11 backend.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1623>
This commit is contained in:
Carlos Garnacho
2020-12-08 12:28:01 +01:00
committed by Marge Bot
parent 09b956997c
commit 9f5c453fc7
9 changed files with 58 additions and 114 deletions

View File

@ -36,13 +36,6 @@
#include "backends/meta-input-settings-private.h"
#include "backends/meta-logical-monitor.h"
#ifdef HAVE_NATIVE_BACKEND
#include <linux/input-event-codes.h>
#include "backends/native/meta-backend-native.h"
#include "backends/native/meta-event-native.h"
#endif
#include "tablet-unstable-v2-server-protocol.h"
#define TABLET_AXIS_MAX 65535
@ -657,23 +650,9 @@ broadcast_button (MetaWaylandTabletTool *tool,
const ClutterEvent *event)
{
struct wl_resource *resource;
guint32 button;
#ifdef HAVE_NATIVE_BACKEND
MetaBackend *backend = meta_get_backend ();
if (META_IS_BACKEND_NATIVE (backend))
{
button = meta_event_native_get_event_code (event);
}
else
#endif
{
/* We can't do much better here, there's several
* different BTN_ ranges to cover.
*/
button = event->button.button;
}
uint32_t button;
button = clutter_event_get_event_code (event);
tool->button_serial = wl_display_next_serial (tool->seat->manager->wl_display);
wl_resource_for_each (resource, &tool->focus_resource_list)