clutter/backend/x11: Stop keeping track of the screen and root window
They are now only ever accessed via the actual X11 backend. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2014>
This commit is contained in:
parent
cf00ee9724
commit
e4e0eaac9d
@ -121,7 +121,6 @@ meta_clutter_backend_x11_finish_init (ClutterBackend *clutter_backend,
|
|||||||
meta_clutter_backend_x11_get_instance_private (clutter_backend_x11);
|
meta_clutter_backend_x11_get_instance_private (clutter_backend_x11);
|
||||||
MetaBackendX11 *backend_x11 = META_BACKEND_X11 (priv->backend);
|
MetaBackendX11 *backend_x11 = META_BACKEND_X11 (priv->backend);
|
||||||
Atom atoms[N_ATOM_NAMES];
|
Atom atoms[N_ATOM_NAMES];
|
||||||
Screen *xscreen;
|
|
||||||
|
|
||||||
clutter_backend_x11->xdisplay = meta_backend_x11_get_xdisplay (backend_x11);
|
clutter_backend_x11->xdisplay = meta_backend_x11_get_xdisplay (backend_x11);
|
||||||
|
|
||||||
@ -130,12 +129,6 @@ meta_clutter_backend_x11_finish_init (ClutterBackend *clutter_backend,
|
|||||||
cogl_xlib_filter,
|
cogl_xlib_filter,
|
||||||
clutter_backend);
|
clutter_backend);
|
||||||
|
|
||||||
xscreen = DefaultScreenOfDisplay (clutter_backend_x11->xdisplay);
|
|
||||||
clutter_backend_x11->xscreen_num = XScreenNumberOfScreen (xscreen);
|
|
||||||
|
|
||||||
clutter_backend_x11->xwin_root = RootWindow (clutter_backend_x11->xdisplay,
|
|
||||||
clutter_backend_x11->xscreen_num);
|
|
||||||
|
|
||||||
if (clutter_synchronise)
|
if (clutter_synchronise)
|
||||||
XSynchronize (clutter_backend_x11->xdisplay, True);
|
XSynchronize (clutter_backend_x11->xdisplay, True);
|
||||||
|
|
||||||
@ -154,13 +147,6 @@ meta_clutter_backend_x11_finish_init (ClutterBackend *clutter_backend,
|
|||||||
clutter_backend_x11->atom_NET_WM_NAME = atoms[8];
|
clutter_backend_x11->atom_NET_WM_NAME = atoms[8];
|
||||||
clutter_backend_x11->atom_UTF8_STRING = atoms[9];
|
clutter_backend_x11->atom_UTF8_STRING = atoms[9];
|
||||||
|
|
||||||
g_debug ("X Display '%s'[%p] opened (screen:%d, root:%u, dpi:%f)",
|
|
||||||
g_getenv ("DISPLAY"),
|
|
||||||
clutter_backend_x11->xdisplay,
|
|
||||||
clutter_backend_x11->xscreen_num,
|
|
||||||
(unsigned int) clutter_backend_x11->xwin_root,
|
|
||||||
clutter_backend_get_resolution (clutter_backend));
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -479,66 +465,6 @@ meta_clutter_x11_untrap_x_errors (void)
|
|||||||
return TrappedErrorCode;
|
return TrappedErrorCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
Display *
|
|
||||||
meta_clutter_x11_get_default_display (void)
|
|
||||||
{
|
|
||||||
ClutterBackend *clutter_backend = clutter_get_default_backend ();
|
|
||||||
|
|
||||||
if (clutter_backend == NULL)
|
|
||||||
{
|
|
||||||
g_critical ("The Clutter backend has not been initialised");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!META_IS_CLUTTER_BACKEND_X11 (clutter_backend))
|
|
||||||
{
|
|
||||||
g_critical ("The Clutter backend is not a X11 backend");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return META_CLUTTER_BACKEND_X11 (clutter_backend)->xdisplay;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
meta_clutter_x11_get_default_screen (void)
|
|
||||||
{
|
|
||||||
ClutterBackend *clutter_backend = clutter_get_default_backend ();
|
|
||||||
|
|
||||||
if (clutter_backend == NULL)
|
|
||||||
{
|
|
||||||
g_critical ("The Clutter backend has not been initialised");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!META_IS_CLUTTER_BACKEND_X11 (clutter_backend))
|
|
||||||
{
|
|
||||||
g_critical ("The Clutter backend is not a X11 backend");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return META_CLUTTER_BACKEND_X11 (clutter_backend)->xscreen_num;
|
|
||||||
}
|
|
||||||
|
|
||||||
Window
|
|
||||||
meta_clutter_x11_get_root_window (void)
|
|
||||||
{
|
|
||||||
ClutterBackend *clutter_backend = clutter_get_default_backend ();
|
|
||||||
|
|
||||||
if (clutter_backend == NULL)
|
|
||||||
{
|
|
||||||
g_critical ("The Clutter backend has not been initialised");
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!META_IS_CLUTTER_BACKEND_X11 (clutter_backend))
|
|
||||||
{
|
|
||||||
g_critical ("The Clutter backend is not a X11 backend");
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
|
|
||||||
return META_CLUTTER_BACKEND_X11 (clutter_backend)->xwin_root;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_clutter_backend_x11_add_filter (MetaClutterBackendX11 *clutter_backend_x11,
|
meta_clutter_backend_x11_add_filter (MetaClutterBackendX11 *clutter_backend_x11,
|
||||||
MetaX11FilterFunc func,
|
MetaX11FilterFunc func,
|
||||||
|
@ -36,10 +36,6 @@ struct _MetaClutterBackendX11
|
|||||||
|
|
||||||
Display *xdisplay;
|
Display *xdisplay;
|
||||||
|
|
||||||
int xscreen_num;
|
|
||||||
|
|
||||||
Window xwin_root;
|
|
||||||
|
|
||||||
/* event source */
|
/* event source */
|
||||||
GSList *event_filters;
|
GSList *event_filters;
|
||||||
|
|
||||||
@ -79,8 +75,6 @@ MetaClutterBackendX11 * meta_clutter_backend_x11_new (MetaBackend *backend);
|
|||||||
void meta_clutter_x11_trap_x_errors (void);
|
void meta_clutter_x11_trap_x_errors (void);
|
||||||
gint meta_clutter_x11_untrap_x_errors (void);
|
gint meta_clutter_x11_untrap_x_errors (void);
|
||||||
|
|
||||||
Display *meta_clutter_x11_get_default_display (void);
|
|
||||||
int meta_clutter_x11_get_default_screen (void);
|
|
||||||
Window meta_clutter_x11_get_root_window (void);
|
Window meta_clutter_x11_get_root_window (void);
|
||||||
|
|
||||||
void meta_clutter_backend_x11_add_filter (MetaClutterBackendX11 *clutter_backend_x11,
|
void meta_clutter_backend_x11_add_filter (MetaClutterBackendX11 *clutter_backend_x11,
|
||||||
|
Loading…
Reference in New Issue
Block a user