x11: Let X11 connection owners call XSynchronize() themselves

Only make the context carry the boolean state, but move the two libX11
calls into their corresponding connection handler objects.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2444>
This commit is contained in:
Jonas Ådahl
2022-05-30 20:27:02 +02:00
committed by Marge Bot
parent 9a68fb19e4
commit fdde7e0f37
9 changed files with 47 additions and 54 deletions

View File

@ -821,6 +821,7 @@ meta_backend_x11_initable_init (GInitable *initable,
GCancellable *cancellable,
GError **error)
{
MetaContext *context = meta_backend_get_context (META_BACKEND (initable));
MetaBackendX11 *x11 = META_BACKEND_X11 (initable);
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
Display *xdisplay;
@ -842,6 +843,8 @@ meta_backend_x11_initable_init (GInitable *initable,
return FALSE;
}
XSynchronize (xdisplay, meta_context_is_x11_sync (context));
priv->xdisplay = xdisplay;
priv->xscreen = DefaultScreenOfDisplay (xdisplay);
priv->xcb = XGetXCBConnection (priv->xdisplay);