diff --git a/src/backends/native/meta-backend-native.c b/src/backends/native/meta-backend-native.c index 22312d75f..3cd1d119d 100644 --- a/src/backends/native/meta-backend-native.c +++ b/src/backends/native/meta-backend-native.c @@ -537,21 +537,31 @@ meta_activate_session (void) void meta_backend_native_pause (MetaBackendNative *native) { + MetaBackend *backend = META_BACKEND (native); + MetaMonitorManager *monitor_manager = + meta_backend_get_monitor_manager (backend); + MetaMonitorManagerKms *monitor_manager_kms = + META_MONITOR_MANAGER_KMS (monitor_manager); + clutter_evdev_release_devices (); clutter_egl_freeze_master_clock (); + + meta_monitor_manager_kms_pause (monitor_manager_kms); } void meta_backend_native_resume (MetaBackendNative *native) { MetaBackend *backend = META_BACKEND (native); - MetaRenderer *renderer; + MetaMonitorManager *monitor_manager = + meta_backend_get_monitor_manager (backend); + MetaMonitorManagerKms *monitor_manager_kms = + META_MONITOR_MANAGER_KMS (monitor_manager); MetaCursorRenderer *cursor_renderer; MetaCursorRendererNative *cursor_renderer_native; ClutterActor *stage; MetaIdleMonitor *idle_monitor; - renderer = meta_backend_get_renderer (backend); - meta_renderer_native_queue_modes_reset (META_RENDERER_NATIVE (renderer)); + meta_monitor_manager_kms_resume (monitor_manager_kms); clutter_evdev_reclaim_devices (); clutter_egl_thaw_master_clock (); diff --git a/src/backends/native/meta-monitor-manager-kms.c b/src/backends/native/meta-monitor-manager-kms.c index 3cedde118..5256b4775 100644 --- a/src/backends/native/meta-monitor-manager-kms.c +++ b/src/backends/native/meta-monitor-manager-kms.c @@ -1783,6 +1783,21 @@ meta_monitor_manager_kms_disconnect_uevent_handler (MetaMonitorManagerKms *manag manager_kms->uevent_handler_id = 0; } +void +meta_monitor_manager_kms_pause (MetaMonitorManagerKms *manager_kms) +{ + meta_monitor_manager_kms_disconnect_uevent_handler (manager_kms); +} + +void +meta_monitor_manager_kms_resume (MetaMonitorManagerKms *manager_kms) +{ + MetaMonitorManager *manager = META_MONITOR_MANAGER (manager_kms); + + meta_monitor_manager_kms_connect_uevent_handler (manager_kms); + handle_hotplug_event (manager); +} + static void meta_monitor_manager_kms_init (MetaMonitorManagerKms *manager_kms) { diff --git a/src/backends/native/meta-monitor-manager-kms.h b/src/backends/native/meta-monitor-manager-kms.h index d4978b802..c641f28be 100644 --- a/src/backends/native/meta-monitor-manager-kms.h +++ b/src/backends/native/meta-monitor-manager-kms.h @@ -58,4 +58,8 @@ gboolean meta_monitor_manager_kms_flip_crtc (MetaMonitorManagerKms *manager_kms, void meta_monitor_manager_kms_wait_for_flip (MetaMonitorManagerKms *manager_kms); +void meta_monitor_manager_kms_pause (MetaMonitorManagerKms *manager_kms); + +void meta_monitor_manager_kms_resume (MetaMonitorManagerKms *manager_kms); + #endif /* META_MONITOR_MANAGER_KMS_H */