mirror of
https://github.com/brl/mutter.git
synced 2025-01-27 20:08:56 +00:00
backends/x11: Drop clutter_event_set_state_full() helpers
Since the full decomposed modifier state is unused, and only the effective modifier mask matters to users, the new constructors take just this effective modifier mask. This means this helper went unused in the port to the new constructors, so can be now dropped. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3153>
This commit is contained in:
parent
a837b105d0
commit
2c86bff0cc
@ -379,84 +379,6 @@ meta_input_device_x11_init (MetaInputDeviceX11 *self)
|
||||
{
|
||||
}
|
||||
|
||||
static ClutterModifierType
|
||||
get_modifier_for_button (int i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 1:
|
||||
return CLUTTER_BUTTON1_MASK;
|
||||
case 2:
|
||||
return CLUTTER_BUTTON2_MASK;
|
||||
case 3:
|
||||
return CLUTTER_BUTTON3_MASK;
|
||||
case 4:
|
||||
return CLUTTER_BUTTON4_MASK;
|
||||
case 5:
|
||||
return CLUTTER_BUTTON5_MASK;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
meta_input_device_x11_translate_state (ClutterEvent *event,
|
||||
XIModifierState *modifiers_state,
|
||||
XIButtonState *buttons_state,
|
||||
XIGroupState *group_state)
|
||||
{
|
||||
uint32_t button = 0;
|
||||
uint32_t base = 0;
|
||||
uint32_t latched = 0;
|
||||
uint32_t locked = 0;
|
||||
uint32_t effective;
|
||||
|
||||
if (modifiers_state)
|
||||
{
|
||||
base = (uint32_t) modifiers_state->base;
|
||||
latched = (uint32_t) modifiers_state->latched;
|
||||
locked = (uint32_t) modifiers_state->locked;
|
||||
}
|
||||
|
||||
if (buttons_state)
|
||||
{
|
||||
int len, i;
|
||||
|
||||
len = MIN (N_BUTTONS, buttons_state->mask_len * 8);
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
if (!XIMaskIsSet (buttons_state->mask, i))
|
||||
continue;
|
||||
|
||||
button |= get_modifier_for_button (i);
|
||||
}
|
||||
}
|
||||
|
||||
/* The XIButtonState sent in the event specifies the
|
||||
* state of the buttons before the event. In order to
|
||||
* get the current state of the buttons, we need to
|
||||
* filter out the current button.
|
||||
*/
|
||||
switch (event->type)
|
||||
{
|
||||
case CLUTTER_BUTTON_PRESS:
|
||||
button |= (get_modifier_for_button (event->button.button));
|
||||
break;
|
||||
case CLUTTER_BUTTON_RELEASE:
|
||||
button &= ~(get_modifier_for_button (event->button.button));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
effective = button | base | latched | locked;
|
||||
if (group_state)
|
||||
effective |= (group_state->effective) << 13;
|
||||
|
||||
_clutter_event_set_state_full (event, button, base, latched, locked, effective);
|
||||
}
|
||||
|
||||
void
|
||||
meta_input_device_x11_update_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool)
|
||||
|
@ -42,10 +42,6 @@ typedef struct _MetaInputDeviceX11Class MetaInputDeviceX11Class;
|
||||
|
||||
GType meta_input_device_x11_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void meta_input_device_x11_translate_state (ClutterEvent *event,
|
||||
XIModifierState *modifiers_state,
|
||||
XIButtonState *buttons_state,
|
||||
XIGroupState *group_state);
|
||||
void meta_input_device_x11_update_tool (ClutterInputDevice *device,
|
||||
ClutterInputDeviceTool *tool);
|
||||
ClutterInputDeviceTool * meta_input_device_x11_get_current_tool (ClutterInputDevice *device);
|
||||
|
Loading…
x
Reference in New Issue
Block a user