File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -617,22 +617,25 @@ class CancellableChild extends Gio.Cancellable {
617617} ) ;
618618
619619function getMonitorManager ( ) {
620- if ( global . backend . get_monitor_manager !== undefined )
621- return global . backend . get_monitor_manager ( ) ;
622- else
623- return Meta . MonitorManager . get ( ) ;
620+ return global . backend . get_monitor_manager ?. ( ) ?? Meta . MonitorManager . get ( ) ;
624621}
625622
626- function laterAdd ( when , func ) {
627- if ( global . compositor . get_laters !== undefined )
628- return global . compositor . get_laters ( ) . add ( when , func ) ;
629- else
630- return Meta . later_add ( when , func ) ;
623+ /**
624+ * @param laterType
625+ * @param callback
626+ */
627+ function laterAdd ( laterType , callback ) {
628+ return global . compositor ?. get_laters ?. ( ) . add ( laterType , callback ) ??
629+ Meta . later_add ( laterType , callback ) ;
631630}
632631
633- function laterRemove ( later ) {
634- if ( global . compositor . get_laters !== undefined )
635- return global . compositor . get_laters ( ) . remove ( later ) ;
632+ /**
633+ * @param id
634+ */
635+ function laterRemove ( id ) {
636+ if ( global . compositor ?. get_laters )
637+ global . compositor ?. get_laters ( ) . remove ( id ) ;
636638 else
637- Meta . later_remove ( later ) ;
639+ Meta . later_remove ( id ) ;
638640}
641+
You can’t perform that action at this time.
0 commit comments