backends/x11: Free button state mask allocated by XIQueryPointer
XIQueryPointer allocates the button state mask that we were leaking in some places. We need to manually free this, because there is no XI function that would do this for us. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1728>
This commit is contained in:
parent
335a85ab84
commit
7dd4ae339c
@ -401,7 +401,7 @@ meta_input_device_x11_query_pointer_location (MetaInputDeviceX11 *device_xi2)
|
|||||||
{
|
{
|
||||||
Window xroot_window, xchild_window;
|
Window xroot_window, xchild_window;
|
||||||
double xroot_x, xroot_y, xwin_x, xwin_y;
|
double xroot_x, xroot_y, xwin_x, xwin_y;
|
||||||
XIButtonState button_state;
|
XIButtonState button_state = { 0 };
|
||||||
XIModifierState mod_state;
|
XIModifierState mod_state;
|
||||||
XIGroupState group_state;
|
XIGroupState group_state;
|
||||||
int result;
|
int result;
|
||||||
@ -419,6 +419,8 @@ meta_input_device_x11_query_pointer_location (MetaInputDeviceX11 *device_xi2)
|
|||||||
&group_state);
|
&group_state);
|
||||||
clutter_x11_untrap_x_errors ();
|
clutter_x11_untrap_x_errors ();
|
||||||
|
|
||||||
|
g_free (button_state.mask);
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -1559,7 +1559,7 @@ meta_seat_x11_query_state (ClutterSeat *seat,
|
|||||||
MetaSeatX11 *seat_x11 = META_SEAT_X11 (seat);
|
MetaSeatX11 *seat_x11 = META_SEAT_X11 (seat);
|
||||||
Window root_ret, child_ret;
|
Window root_ret, child_ret;
|
||||||
double root_x, root_y, win_x, win_y;
|
double root_x, root_y, win_x, win_y;
|
||||||
XIButtonState button_state;
|
XIButtonState button_state = { 0 };
|
||||||
XIModifierState modifier_state;
|
XIModifierState modifier_state;
|
||||||
XIGroupState group_state;
|
XIGroupState group_state;
|
||||||
|
|
||||||
@ -1571,7 +1571,10 @@ meta_seat_x11_query_state (ClutterSeat *seat,
|
|||||||
&root_x, &root_y, &win_x, &win_y,
|
&root_x, &root_y, &win_x, &win_y,
|
||||||
&button_state, &modifier_state, &group_state);
|
&button_state, &modifier_state, &group_state);
|
||||||
if (clutter_x11_untrap_x_errors ())
|
if (clutter_x11_untrap_x_errors ())
|
||||||
|
{
|
||||||
|
g_free (button_state.mask);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (sequence)
|
if (sequence)
|
||||||
{
|
{
|
||||||
@ -1579,7 +1582,10 @@ meta_seat_x11_query_state (ClutterSeat *seat,
|
|||||||
|
|
||||||
touch_info = g_hash_table_lookup (seat_x11->touch_coords, sequence);
|
touch_info = g_hash_table_lookup (seat_x11->touch_coords, sequence);
|
||||||
if (!touch_info)
|
if (!touch_info)
|
||||||
|
{
|
||||||
|
g_free (button_state.mask);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (coords)
|
if (coords)
|
||||||
{
|
{
|
||||||
@ -1599,6 +1605,7 @@ meta_seat_x11_query_state (ClutterSeat *seat,
|
|||||||
if (modifiers)
|
if (modifiers)
|
||||||
*modifiers = translate_state (&button_state, &modifier_state, &group_state);
|
*modifiers = translate_state (&button_state, &modifier_state, &group_state);
|
||||||
|
|
||||||
|
g_free (button_state.mask);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user