backend: Create the stage in the backend, rather than the compositor
This allows creating the stage much earlier than it otherwise would have been. Our initialization sequence has always been a bit haphazard, with first the MetaBackend created, then the MetaDisplay, and inside of that, the MetaScreen and MetaCompositor. Refactor this out so that the MetaBackend creates the Clutter stage. Besides the clarity of early initialization, we now have much easier access to the stage, allowing us to use it for things such as key focus and beyond.
This commit is contained in:
@@ -27,14 +27,15 @@
|
||||
#include "meta-cursor-renderer.h"
|
||||
#include "meta-cursor-private.h"
|
||||
|
||||
#include <meta/meta-backend.h>
|
||||
#include <meta/util.h>
|
||||
|
||||
#include <cogl/cogl.h>
|
||||
#include <cogl/cogl-wayland-server.h>
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#include "meta-stage.h"
|
||||
|
||||
#include "wayland/meta-wayland-private.h"
|
||||
|
||||
struct _MetaCursorRendererPrivate
|
||||
{
|
||||
int current_x, current_y;
|
||||
@@ -51,8 +52,8 @@ static void
|
||||
queue_redraw (MetaCursorRenderer *renderer)
|
||||
{
|
||||
MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
|
||||
MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
|
||||
ClutterActor *stage = compositor->stage;
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
ClutterActor *stage = meta_backend_get_stage (backend);
|
||||
|
||||
/* During early initialization, we can have no stage */
|
||||
if (!stage)
|
||||
|
Reference in New Issue
Block a user