backends: Drop X11 ClutterBackend error traps

Replace these with Mtk error traps altogether, and avoid stacking
one API over the other here.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3230>
This commit is contained in:
Carlos Garnacho 2023-08-31 14:54:07 +02:00 committed by Marge Bot
parent 99bcd20f0a
commit 7224bb8a8d
8 changed files with 54 additions and 79 deletions

View File

@ -68,10 +68,6 @@ static const gchar *atom_names[] = {
/* various flags corresponding to pre init setup calls */ /* various flags corresponding to pre init setup calls */
static gboolean clutter_enable_stereo = FALSE; static gboolean clutter_enable_stereo = FALSE;
/* X error trap */
static int TrappedErrorCode = 0;
static int (* old_error_handler) (Display *, XErrorEvent *);
static gboolean static gboolean
meta_clutter_backend_x11_finish_init (ClutterBackend *clutter_backend, meta_clutter_backend_x11_finish_init (ClutterBackend *clutter_backend,
GError **error) GError **error)
@ -259,29 +255,6 @@ meta_clutter_backend_x11_new (MetaBackend *backend)
return clutter_backend_x11; return clutter_backend_x11;
} }
static int
error_handler (Display *xdisplay,
XErrorEvent *error)
{
TrappedErrorCode = error->error_code;
return 0;
}
void
meta_clutter_x11_trap_x_errors (void)
{
TrappedErrorCode = 0;
old_error_handler = XSetErrorHandler (error_handler);
}
gint
meta_clutter_x11_untrap_x_errors (void)
{
XSetErrorHandler (old_error_handler);
return TrappedErrorCode;
}
void void
meta_clutter_x11_set_use_stereo_stage (gboolean use_stereo) meta_clutter_x11_set_use_stereo_stage (gboolean use_stereo)
{ {

View File

@ -58,8 +58,5 @@ G_DECLARE_FINAL_TYPE (MetaClutterBackendX11, meta_clutter_backend_x11,
MetaClutterBackendX11 * meta_clutter_backend_x11_new (MetaBackend *backend); MetaClutterBackendX11 * meta_clutter_backend_x11_new (MetaBackend *backend);
void meta_clutter_x11_trap_x_errors (void);
gint meta_clutter_x11_untrap_x_errors (void);
void meta_clutter_x11_set_use_stereo_stage (gboolean use_stereo); void meta_clutter_x11_set_use_stereo_stage (gboolean use_stereo);
gboolean meta_clutter_x11_get_use_stereo_stage (void); gboolean meta_clutter_x11_get_use_stereo_stage (void);

View File

@ -26,6 +26,7 @@
#include "backends/x11/meta-clutter-backend-x11.h" #include "backends/x11/meta-clutter-backend-x11.h"
#include "backends/x11/meta-input-device-x11.h" #include "backends/x11/meta-input-device-x11.h"
#include "backends/x11/meta-seat-x11.h" #include "backends/x11/meta-seat-x11.h"
#include "mtk/mtk-x11.h"
struct _MetaInputDeviceX11 struct _MetaInputDeviceX11
{ {
@ -291,12 +292,12 @@ meta_input_device_x11_get_dimensions (ClutterInputDevice *device,
static gboolean atoms_initialized = FALSE; static gboolean atoms_initialized = FALSE;
static Atom abs_axis_atoms[4] = { 0, }; static Atom abs_axis_atoms[4] = { 0, };
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
info = XIQueryDevice (xdisplay, device_x11->device_id, &n_info); info = XIQueryDevice (xdisplay, device_x11->device_id, &n_info);
*width = *height = w = h = 0; *width = *height = w = h = 0;
if (meta_clutter_x11_untrap_x_errors ()) if (mtk_x11_error_trap_pop_with_return (xdisplay))
return FALSE; return FALSE;
if (!info) if (!info)
@ -402,6 +403,7 @@ meta_input_device_x11_query_pointer_location (MetaInputDeviceX11 *device_xi2)
MetaSeatX11 *seat_x11 = META_SEAT_X11 (seat); MetaSeatX11 *seat_x11 = META_SEAT_X11 (seat);
MetaBackendX11 *backend_x11 = MetaBackendX11 *backend_x11 =
META_BACKEND_X11 (meta_seat_x11_get_backend (seat_x11)); META_BACKEND_X11 (meta_seat_x11_get_backend (seat_x11));
Display *xdisplay = meta_backend_x11_get_xdisplay (backend_x11);
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 = { 0 }; XIButtonState button_state = { 0 };
@ -409,7 +411,7 @@ meta_input_device_x11_query_pointer_location (MetaInputDeviceX11 *device_xi2)
XIGroupState group_state; XIGroupState group_state;
int result; int result;
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
result = XIQueryPointer (meta_backend_x11_get_xdisplay (backend_x11), result = XIQueryPointer (meta_backend_x11_get_xdisplay (backend_x11),
device_xi2->device_id, device_xi2->device_id,
meta_backend_x11_get_root_xwindow (backend_x11), meta_backend_x11_get_root_xwindow (backend_x11),
@ -420,7 +422,7 @@ meta_input_device_x11_query_pointer_location (MetaInputDeviceX11 *device_xi2)
&button_state, &button_state,
&mod_state, &mod_state,
&group_state); &group_state);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
g_free (button_state.mask); g_free (button_state.mask);

View File

@ -31,7 +31,7 @@
#include "backends/x11/meta-backend-x11.h" #include "backends/x11/meta-backend-x11.h"
#include "backends/x11/meta-input-device-x11.h" #include "backends/x11/meta-input-device-x11.h"
#include "core/display-private.h" #include "core/display-private.h"
#include "meta/meta-x11-errors.h" #include "mtk/mtk-x11.h"
typedef struct typedef struct
{ {
@ -64,9 +64,9 @@ device_handle_free (gpointer user_data)
MetaBackend *backend = get_backend (settings); MetaBackend *backend = get_backend (settings);
Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend)); Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
XCloseDevice (xdisplay, handle->xdev); XCloseDevice (xdisplay, handle->xdev);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
g_free (handle); g_free (handle);
} }
@ -85,9 +85,9 @@ device_ensure_xdevice (MetaInputSettings *settings,
if (handle) if (handle)
return handle->xdev; return handle->xdev;
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
xdev = XOpenDevice (xdisplay, device_id); xdev = XOpenDevice (xdisplay, device_id);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
if (xdev) if (xdev)
{ {
@ -123,11 +123,11 @@ get_property (ClutterInputDevice *device,
device_id = meta_input_device_x11_get_device_id (device); device_id = meta_input_device_x11_get_device_id (device);
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
rc = XIGetProperty (xdisplay, device_id, property_atom, rc = XIGetProperty (xdisplay, device_id, property_atom,
0, 10, False, type, &type_ret, &format_ret, 0, 10, False, type, &type_ret, &format_ret,
&nitems_ret, &bytes_after_ret, &data_ret); &nitems_ret, &bytes_after_ret, &data_ret);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
if (rc == Success && type_ret == type && format_ret == format && nitems_ret >= nitems) if (rc == Success && type_ret == type && format_ret == format && nitems_ret >= nitems)
return data_ret; return data_ret;
@ -162,11 +162,12 @@ change_property (MetaInputSettings *settings,
if (!data_ret) if (!data_ret)
return; return;
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
XIChangeProperty (xdisplay, device_id, property_atom, type, XIChangeProperty (xdisplay, device_id, property_atom, type,
format, XIPropModeReplace, data, nitems); format, XIPropModeReplace, data, nitems);
XSync (xdisplay, False); XSync (xdisplay, False);
err = meta_clutter_x11_untrap_x_errors ();
err = mtk_x11_error_trap_pop_with_return (xdisplay);
if (err) if (err)
{ {
g_warning ("XIChangeProperty failed on device %d property \"%s\" with X error %d", g_warning ("XIChangeProperty failed on device %d property \"%s\" with X error %d",
@ -604,7 +605,7 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings,
XDevice *xdev; XDevice *xdev;
/* Grab the puke bucket! */ /* Grab the puke bucket! */
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
xdev = device_ensure_xdevice (settings, device); xdev = device_ensure_xdevice (settings, device);
if (xdev) if (xdev)
{ {
@ -613,7 +614,7 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings,
Absolute : Relative); Absolute : Relative);
} }
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
} }
static gboolean static gboolean
@ -753,7 +754,7 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings *setti
XDevice *xdev; XDevice *xdev;
/* Grab the puke bucket! */ /* Grab the puke bucket! */
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
xdev = device_ensure_xdevice (settings, device); xdev = device_ensure_xdevice (settings, device);
if (xdev) if (xdev)
{ {
@ -771,7 +772,7 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings *setti
XSetDeviceButtonMapping (xdisplay, xdev, map, G_N_ELEMENTS (map)); XSetDeviceButtonMapping (xdisplay, xdev, map, G_N_ELEMENTS (map));
} }
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
} }
static void static void

View File

@ -44,6 +44,7 @@
#include "backends/meta-crtc.h" #include "backends/meta-crtc.h"
#include "backends/x11/meta-monitor-manager-xrandr.h" #include "backends/x11/meta-monitor-manager-xrandr.h"
#include "meta/util.h" #include "meta/util.h"
#include "mtk/mtk-x11.h"
struct _MetaOutputXrandr struct _MetaOutputXrandr
{ {
@ -453,11 +454,11 @@ output_get_max_bpc_range_xrandr (Display *xdisplay,
atom = XInternAtom (xdisplay, "max bpc", False); atom = XInternAtom (xdisplay, "max bpc", False);
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
property_info = XRRQueryOutputProperty (xdisplay, property_info = XRRQueryOutputProperty (xdisplay,
(XID) output_id, (XID) output_id,
atom); atom);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
if (!property_info) if (!property_info)
return FALSE; return FALSE;

View File

@ -39,6 +39,7 @@
#include "clutter/clutter-mutter.h" #include "clutter/clutter-mutter.h"
#include "core/bell.h" #include "core/bell.h"
#include "meta-seat-x11.h" #include "meta-seat-x11.h"
#include "mtk/mtk-x11.h"
enum enum
{ {
@ -301,13 +302,13 @@ is_touchpad_device (MetaSeatX11 *seat_x11,
if (prop == None) if (prop == None)
return FALSE; return FALSE;
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
rc = XIGetProperty (xdisplay, rc = XIGetProperty (xdisplay,
info->deviceid, info->deviceid,
prop, prop,
0, 1, False, XA_INTEGER, &type, &format, &nitems, &bytes_after, 0, 1, False, XA_INTEGER, &type, &format, &nitems, &bytes_after,
(guchar **) &data); (guchar **) &data);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
/* We don't care about the data */ /* We don't care about the data */
XFree (data); XFree (data);
@ -330,13 +331,13 @@ get_device_ids (MetaSeatX11 *seat_x11,
int rc, format; int rc, format;
Atom type; Atom type;
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
rc = XIGetProperty (xdisplay, rc = XIGetProperty (xdisplay,
info->deviceid, info->deviceid,
XInternAtom (xdisplay, "Device Product ID", False), XInternAtom (xdisplay, "Device Product ID", False),
0, 2, False, XA_INTEGER, &type, &format, &nitems, &bytes_after, 0, 2, False, XA_INTEGER, &type, &format, &nitems, &bytes_after,
(guchar **) &data); (guchar **) &data);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
if (rc != Success || type != XA_INTEGER || format != 32 || nitems != 2) if (rc != Success || type != XA_INTEGER || format != 32 || nitems != 2)
{ {
@ -369,14 +370,14 @@ get_device_node_path (MetaSeatX11 *seat_x11,
if (prop == None) if (prop == None)
return NULL; return NULL;
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
rc = XIGetProperty (xdisplay, rc = XIGetProperty (xdisplay,
info->deviceid, prop, 0, 1024, False, info->deviceid, prop, 0, 1024, False,
XA_STRING, &type, &format, &nitems, &bytes_after, XA_STRING, &type, &format, &nitems, &bytes_after,
(guchar **) &data); (guchar **) &data);
if (meta_clutter_x11_untrap_x_errors ()) if (mtk_x11_error_trap_pop_with_return (xdisplay))
return NULL; return NULL;
if (rc != Success || type != XA_STRING || format != 8) if (rc != Success || type != XA_STRING || format != 8)
@ -442,13 +443,13 @@ guess_source_from_wacom_type (MetaSeatX11 *seat_x11,
if (prop == None) if (prop == None)
return FALSE; return FALSE;
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
rc = XIGetProperty (xdisplay, rc = XIGetProperty (xdisplay,
info->deviceid, info->deviceid,
prop, prop,
0, 1, False, XA_ATOM, &type, &format, &nitems, &bytes_after, 0, 1, False, XA_ATOM, &type, &format, &nitems, &bytes_after,
(guchar **) &data); (guchar **) &data);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
if (rc != Success || type != XA_ATOM || format != 32 || nitems != 1) if (rc != Success || type != XA_ATOM || format != 32 || nitems != 1)
{ {
@ -697,7 +698,7 @@ pad_passive_button_grab (MetaSeatX11 *seat_x11,
XISetMask (xi_event_mask.mask, XI_ButtonPress); XISetMask (xi_event_mask.mask, XI_ButtonPress);
XISetMask (xi_event_mask.mask, XI_ButtonRelease); XISetMask (xi_event_mask.mask, XI_ButtonRelease);
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
rc = XIGrabButton (xdisplay, rc = XIGrabButton (xdisplay,
device_id, XIAnyButton, device_id, XIAnyButton,
root_xwindow, None, root_xwindow, None,
@ -713,7 +714,7 @@ pad_passive_button_grab (MetaSeatX11 *seat_x11,
XIAllowEvents (xdisplay, device_id, XIAsyncDevice, CLUTTER_CURRENT_TIME); XIAllowEvents (xdisplay, device_id, XIAsyncDevice, CLUTTER_CURRENT_TIME);
} }
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
g_free (xi_event_mask.mask); g_free (xi_event_mask.mask);
} }
@ -864,12 +865,12 @@ device_get_tool_serial (MetaSeatX11 *seat_x11,
if (prop == None) if (prop == None)
return 0; return 0;
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
rc = XIGetProperty (xdisplay, rc = XIGetProperty (xdisplay,
meta_input_device_x11_get_device_id (device), meta_input_device_x11_get_device_id (device),
prop, 0, 4, FALSE, XA_INTEGER, &type, &format, &nitems, &bytes_after, prop, 0, 4, FALSE, XA_INTEGER, &type, &format, &nitems, &bytes_after,
(guchar **) &data); (guchar **) &data);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
if (rc == Success && type == XA_INTEGER && format == 32 && nitems >= 4) if (rc == Success && type == XA_INTEGER && format == 32 && nitems >= 4)
serial_id = data[3]; serial_id = data[3];
@ -899,11 +900,11 @@ translate_hierarchy_event (ClutterBackend *clutter_backend,
g_debug ("Hierarchy event: device enabled"); g_debug ("Hierarchy event: device enabled");
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
info = XIQueryDevice (xdisplay, info = XIQueryDevice (xdisplay,
ev->info[i].deviceid, ev->info[i].deviceid,
&n_devices); &n_devices);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
if (info != NULL) if (info != NULL)
{ {
ClutterInputDevice *device; ClutterInputDevice *device;
@ -1652,14 +1653,14 @@ meta_seat_x11_warp_pointer (ClutterSeat *seat,
Display *xdisplay = xdisplay_from_seat (seat_x11); Display *xdisplay = xdisplay_from_seat (seat_x11);
Window root_xwindow = root_xwindow_from_seat (seat_x11); Window root_xwindow = root_xwindow_from_seat (seat_x11);
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
XIWarpPointer (xdisplay, XIWarpPointer (xdisplay,
seat_x11->pointer_id, seat_x11->pointer_id,
None, None,
root_xwindow, root_xwindow,
0, 0, 0, 0, 0, 0, 0, 0,
x, y); x, y);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
} }
static void static void
@ -1671,14 +1672,14 @@ meta_seat_x11_init_pointer_position (ClutterSeat *seat,
Display *xdisplay = xdisplay_from_seat (seat_x11); Display *xdisplay = xdisplay_from_seat (seat_x11);
Window root_xwindow = root_xwindow_from_seat (seat_x11); Window root_xwindow = root_xwindow_from_seat (seat_x11);
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
XIWarpPointer (xdisplay, XIWarpPointer (xdisplay,
seat_x11->pointer_id, seat_x11->pointer_id,
None, None,
root_xwindow, root_xwindow,
0, 0, 0, 0, 0, 0, 0, 0,
(int) x, (int) y); (int) x, (int) y);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
} }
static uint32_t static uint32_t
@ -1744,14 +1745,14 @@ meta_seat_x11_query_state (ClutterSeat *seat,
XIModifierState modifier_state; XIModifierState modifier_state;
XIGroupState group_state; XIGroupState group_state;
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
XIQueryPointer (xdisplay, XIQueryPointer (xdisplay,
seat_x11->pointer_id, seat_x11->pointer_id,
meta_backend_x11_get_xwindow (backend_x11), meta_backend_x11_get_xwindow (backend_x11),
&root_ret, &child_ret, &root_ret, &child_ret,
&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 (meta_clutter_x11_untrap_x_errors ()) if (mtk_x11_error_trap_pop_with_return (xdisplay))
{ {
g_free (button_state.mask); g_free (button_state.mask);
return FALSE; return FALSE;

View File

@ -29,7 +29,7 @@
#include "backends/x11/meta-clutter-backend-x11.h" #include "backends/x11/meta-clutter-backend-x11.h"
#include "backends/x11/meta-seat-x11.h" #include "backends/x11/meta-seat-x11.h"
#include "core/display-private.h" #include "core/display-private.h"
#include "meta/meta-x11-errors.h" #include "mtk/mtk-x11.h"
#define DEFAULT_XKB_SET_CONTROLS_MASK XkbSlowKeysMask | \ #define DEFAULT_XKB_SET_CONTROLS_MASK XkbSlowKeysMask | \
XkbBounceKeysMask | \ XkbBounceKeysMask | \
@ -56,14 +56,14 @@ get_xkb_desc_rec (Display *xdisplay)
XkbDescRec *desc; XkbDescRec *desc;
Status status = Success; Status status = Success;
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
desc = XkbGetMap (xdisplay, XkbAllMapComponentsMask, XkbUseCoreKbd); desc = XkbGetMap (xdisplay, XkbAllMapComponentsMask, XkbUseCoreKbd);
if (desc != NULL) if (desc != NULL)
{ {
desc->ctrls = NULL; desc->ctrls = NULL;
status = XkbGetControls (xdisplay, XkbAllControlsMask, desc); status = XkbGetControls (xdisplay, XkbAllControlsMask, desc);
} }
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
g_return_val_if_fail (desc != NULL, NULL); g_return_val_if_fail (desc != NULL, NULL);
g_return_val_if_fail (desc->ctrls != NULL, NULL); g_return_val_if_fail (desc->ctrls != NULL, NULL);
@ -76,10 +76,10 @@ static void
set_xkb_desc_rec (Display *xdisplay, set_xkb_desc_rec (Display *xdisplay,
XkbDescRec *desc) XkbDescRec *desc)
{ {
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
XkbSetControls (xdisplay, DEFAULT_XKB_SET_CONTROLS_MASK, desc); XkbSetControls (xdisplay, DEFAULT_XKB_SET_CONTROLS_MASK, desc);
XSync (xdisplay, FALSE); XSync (xdisplay, FALSE);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
} }
void void

View File

@ -43,8 +43,8 @@
#include "core/meta-workspace-manager-private.h" #include "core/meta-workspace-manager-private.h"
#include "core/workspace-private.h" #include "core/workspace-private.h"
#include "meta/compositor.h" #include "meta/compositor.h"
#include "meta/meta-x11-errors.h"
#include "meta/prefs.h" #include "meta/prefs.h"
#include "mtk/mtk-x11.h"
#include "x11/meta-x11-display-private.h" #include "x11/meta-x11-display-private.h"
#include "x11/window-x11.h" #include "x11/window-x11.h"
@ -1203,7 +1203,7 @@ meta_change_button_grab (MetaKeyBindingManager *keys,
mods = calc_grab_modifiers (keys, modmask); mods = calc_grab_modifiers (keys, modmask);
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
if (window->frame) if (window->frame)
xwindow = window->frame->xwindow; xwindow = window->frame->xwindow;
@ -1225,7 +1225,7 @@ meta_change_button_grab (MetaKeyBindingManager *keys,
XSync (xdisplay, False); XSync (xdisplay, False);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
g_array_free (mods, TRUE); g_array_free (mods, TRUE);
} }
@ -1447,7 +1447,7 @@ meta_change_keygrab (MetaKeyBindingManager *keys,
mods = calc_grab_modifiers (keys, resolved_combo->mask); mods = calc_grab_modifiers (keys, resolved_combo->mask);
meta_clutter_x11_trap_x_errors (); mtk_x11_error_trap_push (xdisplay);
for (i = 0; i < resolved_combo->len; i++) for (i = 0; i < resolved_combo->len; i++)
{ {
@ -1473,7 +1473,7 @@ meta_change_keygrab (MetaKeyBindingManager *keys,
XSync (xdisplay, False); XSync (xdisplay, False);
meta_clutter_x11_untrap_x_errors (); mtk_x11_error_trap_pop (xdisplay);
g_array_free (mods, TRUE); g_array_free (mods, TRUE);
} }