mutter/src/backends
Jonas Ådahl 8008f0b7b0 Explicitly create the clutter context and backend
This changes the setup phase of clutter to not be result of calling an
init function that sets up a few global singletons, via global singleton
setup vfuncs.

The way it worked was that mutter first did some initial setup
(connecting to the X11 server), then set a "custom backend" setup vfunc
global, before calling clutter_init().

During the clutter_init() call, the context and backend was setup by
calling the global singleton getters, which implicitly created the
backend and context on-demand.

This has now changed to mutter explicitly creating a `ClutterContext`
(which is actually a `ClutterMainContext`, but with the name shortened to
be consistent with `CoglContext` and `MetaContext`), calling it with a
backend constructor vfunc and user data pointer.

This function now explicitly creates the backend, without having to go
via the previously set global vfunc.

This changes the behavior of some "get_default()" like functions, which
will now fail if called after mutter has shut down, as when it does so,
it now destroys the backends and contexts, not only its own, but the
clutter ones too.

The "ownership" of the clutter backend is also moved to
`ClutterContext`, and MetaBackend is changed to fetch it via the clutter
context.

This also removed the unused option parsing that existed in clutter.

In some places, NULL checks for fetching the clutter context, or
backend, and fetching the cogl context from the clutter backend, had to
be added.

The reason for this is that some code that handles EGL contexts attempts
to restore the cogl EGL context tracking so that the right EGL context
is used by cogl the next time. This makes no sense to do before Cogl and
Clutter are even initialized, which was the case. It wasn't noticed
because the relevant singletons were initialized on demand via their
"getters".

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2002>
2021-10-18 14:36:15 +00:00
..
native Explicitly create the clutter context and backend 2021-10-18 14:36:15 +00:00
x11 Explicitly create the clutter context and backend 2021-10-18 14:36:15 +00:00
edid-parse.c
edid.h
gsm-inhibitor-flag.h idle-monitor: Take idle inhibition into account 2018-04-16 13:28:03 +02:00
meta-backend-private.h monitor-unit-tests: Add tests with dynamic orientation changes 2021-09-04 10:04:01 +02:00
meta-backend-types.h context: Make the context own MetaWaylandCompositor 2021-07-15 11:34:37 +02:00
meta-backend.c Explicitly create the clutter context and backend 2021-10-18 14:36:15 +00:00
meta-barrier-private.h
meta-barrier.c src: Stop using GSlice 2021-02-22 13:52:27 +01:00
meta-crtc-mode.c
meta-crtc-mode.h crtc-mode-info: Add vblank duration field 2021-07-13 08:09:42 +00:00
meta-crtc.c monitor-manager: Connect assigned CRTCs to their outputs both ways 2021-01-22 16:47:08 +00:00
meta-crtc.h monitor-manager: Connect assigned CRTCs to their outputs both ways 2021-01-22 16:47:08 +00:00
meta-cursor-renderer.c cursor-renderer: Remove meta_cursor_renderer_is_overlay_visible 2021-09-20 14:00:08 +00:00
meta-cursor-renderer.h cursor-renderer: Remove meta_cursor_renderer_is_overlay_visible 2021-09-20 14:00:08 +00:00
meta-cursor-sprite-xcursor.c cursor-sprite/xcursor: Fall back to gray square if missing theme 2020-11-16 13:49:05 +00:00
meta-cursor-sprite-xcursor.h
meta-cursor-tracker-private.h backend: Cleanup cursor tracker on shutdown 2021-05-05 19:52:04 +00:00
meta-cursor-tracker.c cursor-tracker: Add meta_cursor_tracker_get_scale () 2021-08-22 15:02:38 +00:00
meta-cursor.c
meta-cursor.h backends: Add argument for best scale on MetaCursorSprite::prepare-at 2020-11-27 15:14:33 +00:00
meta-dbus-session-watcher.c
meta-dbus-session-watcher.h
meta-display-config-shared.h
meta-dnd-private.h
meta-egl-ext.h
meta-egl.c egl: Add eglBindAPI helper 2021-07-07 21:03:26 +02:00
meta-egl.h egl: Add eglBindAPI helper 2021-07-07 21:03:26 +02:00
meta-gles3-table.h
meta-gles3.c
meta-gles3.h Fix const qualifier usage 2019-01-22 18:31:53 +01:00
meta-gpu.c
meta-gpu.h
meta-idle-manager.c context: Move 'replace-current-wm' tracking to the context 2021-07-15 11:34:37 +02:00
meta-idle-manager.h backends: Introduce MetaIdleManager 2021-05-18 13:19:36 +00:00
meta-idle-monitor-private.h backends: Introduce MetaIdleManager 2021-05-18 13:19:36 +00:00
meta-idle-monitor.c backends: Introduce MetaIdleManager 2021-05-18 13:19:36 +00:00
meta-input-device-private.h
meta-input-device.c
meta-input-mapper-private.h
meta-input-mapper.c input-mapper: Fix (libwacom) tablet mapping to monitor 2021-07-01 06:36:33 +02:00
meta-input-settings-dummy.c input-settings: Make set_matrix() vfunc take const float array pointer 2021-04-14 19:16:22 +00:00
meta-input-settings-dummy.h backends/x11: Add dummy input-settings implementation 2021-03-10 13:56:54 +00:00
meta-input-settings-private.h input-settings: Make set_matrix() vfunc take const float array pointer 2021-04-14 19:16:22 +00:00
meta-input-settings.c backends: Drop MetaInputSettings::seat property 2021-05-05 19:07:26 +00:00
meta-keymap-utils.c
meta-keymap-utils.h
meta-logical-monitor.c
meta-logical-monitor.h
meta-monitor-config-manager.c monitor-transform: Add function to compute from orientation 2021-09-04 10:04:01 +02:00
meta-monitor-config-manager.h monitor-manager: Add config relationships and use it for orientation events 2021-09-04 10:01:29 +02:00
meta-monitor-config-migration.c monitor-manager: Pass the Logical mode when computing the monitor scale 2021-07-22 13:14:01 +02:00
meta-monitor-config-migration.h
meta-monitor-config-store.c monitor-config-store: Properly escape monitor spec 2021-01-29 16:49:58 +00:00
meta-monitor-config-store.h
meta-monitor-manager-dummy.c monitor-manager: Pass the Logical mode when computing the monitor scale 2021-07-22 13:14:01 +02:00
meta-monitor-manager-dummy.h
meta-monitor-manager-private.h monitor-manager: Use connect_object to connect to settings signals 2021-09-20 15:37:59 +00:00
meta-monitor-manager.c monitor-manager: Use connect_object to connect to settings signals 2021-09-20 15:37:59 +00:00
meta-monitor-transform.c monitor-transform: Add function to compute from orientation 2021-09-04 10:04:01 +02:00
meta-monitor-transform.h monitor-transform: Add function to compute from orientation 2021-09-04 10:04:01 +02:00
meta-monitor.c monitor: Add hash function 2021-08-22 16:40:42 +00:00
meta-monitor.h monitor: Add hash function 2021-08-22 16:40:42 +00:00
meta-orientation-manager.c orientation-manager: Use an idle to apply monitor orientation changes 2021-09-04 10:04:01 +02:00
meta-orientation-manager.h tests: Add MetaOrientationManager tests via SensorsProxy mock 2021-09-04 10:04:00 +02:00
meta-output.c kms: Only emit resources-changed signal if we recorded a change 2021-09-20 15:37:59 +00:00
meta-output.h kms: Only emit resources-changed signal if we recorded a change 2021-09-20 15:37:59 +00:00
meta-pointer-constraint.c
meta-pointer-constraint.h
meta-profiler.c
meta-profiler.h
meta-remote-access-controller-private.h
meta-remote-access-controller.c
meta-remote-desktop-session.c remote-desktop: Check pipe fd before assuming existing read() operation 2021-07-28 15:26:04 +00:00
meta-remote-desktop-session.h remote-desktop/session: Add support for SelectionTransfer/Write 2021-02-05 16:44:27 +00:00
meta-remote-desktop.c remote-desktop: Close sessions on prepare-shutdown 2021-05-11 16:18:13 +00:00
meta-remote-desktop.h remote-desktop: Add backend getter 2021-03-04 17:39:08 +00:00
meta-renderer-view.c backends: Rename ClutterStage[View]Cogl API and types 2021-07-16 19:08:06 +02:00
meta-renderer-view.h backends: Excise MetaStageView to its own file 2021-07-16 19:08:06 +02:00
meta-renderer.c renderer: Cleanup views in dispose 2021-05-05 19:52:04 +00:00
meta-renderer.h tests/monitor: Check that the CRTC "layout" is correct 2021-01-22 16:47:08 +00:00
meta-screen-cast-area-stream-src.c screen-cast/area-src: Add before-paint watch to catch scanouts 2021-07-05 15:57:20 +00:00
meta-screen-cast-area-stream-src.h
meta-screen-cast-area-stream.c remote-desktop/session: Handle unable to transform coordinate gracefully 2021-03-12 15:09:45 +00:00
meta-screen-cast-area-stream.h
meta-screen-cast-monitor-stream-src.c screen-cast/monitor-src: Use clutter_stage_paint_to_buffer 2021-09-20 14:00:08 +00:00
meta-screen-cast-monitor-stream-src.h ScreenCast: Pass PipeWire stream node ID directly 2017-08-29 14:39:04 +08:00
meta-screen-cast-monitor-stream.c screencast: Fix transform_position(), when using fractional scaling 2021-05-17 16:11:47 +02:00
meta-screen-cast-monitor-stream.h
meta-screen-cast-session.c screen-cast: Clean up sessions on 'prepare-shutdown' 2021-06-09 17:40:34 +00:00
meta-screen-cast-session.h screen-cast: Clean up sessions on 'prepare-shutdown' 2021-06-09 17:40:34 +00:00
meta-screen-cast-stream-src.c screen-cast/src: Allow for source with adaptive stream size 2021-03-12 15:09:45 +00:00
meta-screen-cast-stream-src.h screen-cast/src: Allow for source with adaptive stream size 2021-03-12 15:09:45 +00:00
meta-screen-cast-stream.c remote-desktop/session: Handle unable to transform coordinate gracefully 2021-03-12 15:09:45 +00:00
meta-screen-cast-stream.h remote-desktop/session: Handle unable to transform coordinate gracefully 2021-03-12 15:09:45 +00:00
meta-screen-cast-virtual-stream-src.c screen-cast/session: Introduce RecordVirtual D-Bus API 2021-03-12 15:09:45 +00:00
meta-screen-cast-virtual-stream-src.h screen-cast/session: Introduce RecordVirtual D-Bus API 2021-03-12 15:09:45 +00:00
meta-screen-cast-virtual-stream.c screen-cast/session: Introduce RecordVirtual D-Bus API 2021-03-12 15:09:45 +00:00
meta-screen-cast-virtual-stream.h screen-cast/session: Introduce RecordVirtual D-Bus API 2021-03-12 15:09:45 +00:00
meta-screen-cast-window-stream-src.c screen-cast/src: Allow for source with adaptive stream size 2021-03-12 15:09:45 +00:00
meta-screen-cast-window-stream-src.h
meta-screen-cast-window-stream.c remote-desktop/session: Handle unable to transform coordinate gracefully 2021-03-12 15:09:45 +00:00
meta-screen-cast-window-stream.h
meta-screen-cast-window.c
meta-screen-cast-window.h
meta-screen-cast.c screen-cast: Clean up sessions on 'prepare-shutdown' 2021-06-09 17:40:34 +00:00
meta-screen-cast.h screen-cast/session: Introduce RecordVirtual D-Bus API 2021-03-12 15:09:45 +00:00
meta-settings-private.h xwayland: Enable Xwayland on demand by default 2021-01-19 09:33:33 +01:00
meta-settings.c xwayland: Enable Xwayland on demand by default 2021-01-19 09:33:33 +01:00
meta-stage-impl-private.h backends: Excise MetaStageView to its own file 2021-07-16 19:08:06 +02:00
meta-stage-impl.c backends: Promote g_debug() MetaStageImpl message to meta_topic() 2021-07-16 19:12:01 +02:00
meta-stage-private.h tests: Add reference test framework 2021-03-12 15:09:45 +00:00
meta-stage-view-private.h backends: Excise MetaStageView to its own file 2021-07-16 19:08:06 +02:00
meta-stage-view.c backends: Excise MetaStageView to its own file 2021-07-16 19:08:06 +02:00
meta-stage.c src: Stop using GSlice 2021-02-22 13:52:27 +01:00
meta-viewport-info.c main: Move rect related macro to util-private.h 2021-05-17 16:08:42 +00:00
meta-viewport-info.h backends: Store whether views are scaled in MetaViewportInfo 2021-04-13 10:32:14 +00:00
meta-virtual-monitor.c Introduce virtual monitors 2021-03-12 15:09:45 +00:00
meta-virtual-monitor.h tests: Add virtual monitor tests 2021-03-12 15:09:45 +00:00