diff --git a/src/backends/native/meta-cursor-renderer-native.c b/src/backends/native/meta-cursor-renderer-native.c index cf500f07c..b400a8740 100644 --- a/src/backends/native/meta-cursor-renderer-native.c +++ b/src/backends/native/meta-cursor-renderer-native.c @@ -2,6 +2,7 @@ /* * Copyright (C) 2014 Red Hat + * Copyright 2020 DisplayLink (UK) Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -1626,6 +1627,13 @@ init_hw_cursor_support_for_gpu (MetaGpuKms *gpu_kms) cursor_renderer_gpu_data->cursor_height = height; } +static void +on_gpu_added_for_cursor (MetaBackend *backend, + MetaGpuKms *gpu_kms) +{ + init_hw_cursor_support_for_gpu (gpu_kms); +} + static void init_hw_cursor_support (MetaCursorRendererNative *cursor_renderer_native) { @@ -1659,6 +1667,8 @@ meta_cursor_renderer_native_new (MetaBackend *backend) g_signal_connect_object (monitor_manager, "monitors-changed-internal", G_CALLBACK (on_monitors_changed), cursor_renderer_native, 0); + g_signal_connect (backend, "gpu-added", + G_CALLBACK (on_gpu_added_for_cursor), NULL); priv->backend = backend; priv->hw_state_invalidated = TRUE;