backend/native: Gracefully handle failing to create monitor manager

We tried to start listening to a signal even if it didn't construct
properly. Stop doing that.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1689>
This commit is contained in:
Jonas Ådahl 2021-01-18 22:35:35 +01:00 committed by Marge Bot
parent f75e9032c1
commit 35ecc6ba7c

View File

@ -204,6 +204,9 @@ meta_backend_native_create_monitor_manager (MetaBackend *backend,
manager = g_initable_new (META_TYPE_MONITOR_MANAGER_KMS, NULL, error,
"backend", backend,
NULL);
if (!manager)
return NULL;
g_signal_connect_swapped (manager, "monitors-changed-internal",
G_CALLBACK (update_viewports), backend);