backends/x11: Drop platform-specific event data

This is largely unused, for long probably. We want to avoid adding
platform data to events, so that's convenient.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1623>
This commit is contained in:
Carlos Garnacho 2020-12-08 11:58:34 +01:00 committed by Marge Bot
parent 4a0c56f928
commit 09b956997c
3 changed files with 0 additions and 92 deletions

View File

@ -30,28 +30,6 @@
#include "clutter/clutter-mutter.h" #include "clutter/clutter-mutter.h"
#include "clutter/x11/clutter-x11.h" #include "clutter/x11/clutter-x11.h"
MetaEventX11 *
meta_event_x11_new (void)
{
return g_slice_new0 (MetaEventX11);
}
MetaEventX11 *
meta_event_x11_copy (MetaEventX11 *event_x11)
{
if (event_x11 != NULL)
return g_slice_dup (MetaEventX11, event_x11);
return NULL;
}
void
meta_event_x11_free (MetaEventX11 *event_x11)
{
if (event_x11 != NULL)
g_slice_free (MetaEventX11, event_x11);
}
/** /**
* meta_x11_handle_event: * meta_x11_handle_event:
* @xevent: pointer to XEvent structure * @xevent: pointer to XEvent structure
@ -136,30 +114,6 @@ out:
return result; return result;
} }
Time
meta_x11_get_current_event_time (void)
{
ClutterBackend *backend = clutter_get_default_backend ();
return CLUTTER_BACKEND_X11 (backend)->last_event_time;
}
gint
meta_x11_event_get_key_group (const ClutterEvent *event)
{
MetaEventX11 *event_x11;
g_return_val_if_fail (event != NULL, 0);
g_return_val_if_fail (event->type == CLUTTER_KEY_PRESS ||
event->type == CLUTTER_KEY_RELEASE, 0);
event_x11 = _clutter_event_get_platform_data (event);
if (event_x11 == NULL)
return 0;
return event_x11->key_group;
}
guint guint
meta_x11_event_sequence_get_touch_detail (const ClutterEventSequence *sequence) meta_x11_event_sequence_get_touch_detail (const ClutterEventSequence *sequence)
{ {

View File

@ -28,26 +28,6 @@
#include "clutter/x11/clutter-x11.h" #include "clutter/x11/clutter-x11.h"
typedef struct _MetaEventX11 MetaEventX11;
struct _MetaEventX11
{
/* additional fields for Key events */
gint key_group;
guint key_is_modifier : 1;
guint num_lock_set : 1;
guint caps_lock_set : 1;
};
MetaEventX11 * meta_event_x11_new (void);
MetaEventX11 * meta_event_x11_copy (MetaEventX11 *event_x11);
void meta_event_x11_free (MetaEventX11 *event_x11);
Time meta_x11_get_current_event_time (void);
gint meta_x11_event_get_key_group (const ClutterEvent *event);
guint meta_x11_event_sequence_get_touch_detail (const ClutterEventSequence *sequence); guint meta_x11_event_sequence_get_touch_detail (const ClutterEventSequence *sequence);
ClutterX11FilterReturn meta_x11_handle_event (XEvent *xevent); ClutterX11FilterReturn meta_x11_handle_event (XEvent *xevent);

View File

@ -1443,22 +1443,12 @@ meta_seat_x11_copy_event_data (ClutterSeat *seat,
const ClutterEvent *src, const ClutterEvent *src,
ClutterEvent *dest) ClutterEvent *dest)
{ {
gpointer event_x11;
event_x11 = _clutter_event_get_platform_data (src);
if (event_x11 != NULL)
_clutter_event_set_platform_data (dest, meta_event_x11_copy (event_x11));
} }
static void static void
meta_seat_x11_free_event_data (ClutterSeat *seat, meta_seat_x11_free_event_data (ClutterSeat *seat,
ClutterEvent *event) ClutterEvent *event)
{ {
gpointer event_x11;
event_x11 = _clutter_event_get_platform_data (event);
if (event_x11 != NULL)
meta_event_x11_free (event_x11);
} }
static ClutterVirtualInputDevice * static ClutterVirtualInputDevice *
@ -1803,7 +1793,6 @@ meta_seat_x11_translate_event (MetaSeatX11 *seat,
{ {
XIDeviceEvent *xev = (XIDeviceEvent *) xi_event; XIDeviceEvent *xev = (XIDeviceEvent *) xi_event;
MetaKeymapX11 *keymap_x11 = seat->keymap; MetaKeymapX11 *keymap_x11 = seat->keymap;
MetaEventX11 *event_x11;
char buffer[7] = { 0, }; char buffer[7] = { 0, };
gunichar n; gunichar n;
@ -1830,21 +1819,6 @@ meta_seat_x11_translate_event (MetaSeatX11 *seat,
&event->key.modifier_state, &event->key.modifier_state,
NULL); NULL);
/* KeyEvents have platform specific data associated to them */
event_x11 = meta_event_x11_new ();
_clutter_event_set_platform_data (event, event_x11);
event_x11->key_group =
meta_keymap_x11_get_key_group (keymap_x11,
event->key.modifier_state);
event_x11->key_is_modifier =
meta_keymap_x11_get_is_modifier (keymap_x11,
event->key.hardware_keycode);
event_x11->num_lock_set =
clutter_keymap_get_num_lock_state (CLUTTER_KEYMAP (keymap_x11));
event_x11->caps_lock_set =
clutter_keymap_get_caps_lock_state (CLUTTER_KEYMAP (keymap_x11));
clutter_event_set_source_device (event, source_device); clutter_event_set_source_device (event, source_device);
device = g_hash_table_lookup (seat->devices_by_id, device = g_hash_table_lookup (seat->devices_by_id,