@@ -44,7 +44,7 @@ const GLib: GLib = imports.gi.GLib;
4444const { Gio, Meta, St, Shell } = imports . gi ;
4545const { GlobalEvent, WindowEvent } = Events ;
4646const { cursor_rect, is_move_op } = Lib ;
47- const { layoutManager, loadTheme, overview, panel, setThemeStylesheet, screenShield, sessionMode } = imports . ui . main ;
47+ const { layoutManager, loadTheme, overview, panel, setThemeStylesheet, screenShield, sessionMode, windowAttentionHandler } = imports . ui . main ;
4848const { ScreenShield } = imports . ui . screenShield ;
4949const { AppSwitcher, AppIcon, WindowSwitcherPopup } = imports . ui . altTab ;
5050const { SwitcherList } = imports . ui . switcherPopup ;
@@ -2454,6 +2454,8 @@ function enable() {
24542454 ext . injections_add ( ) ;
24552455 ext . signals_attach ( ) ;
24562456
2457+ disable_window_attention_handler ( )
2458+
24572459 layoutManager . addChrome ( ext . overlay ) ;
24582460
24592461 if ( ! indicator ) {
@@ -2503,6 +2505,25 @@ function disable() {
25032505 indicator . destroy ( ) ;
25042506 indicator = null ;
25052507 }
2508+
2509+ enable_window_attention_handler ( )
2510+ }
2511+
2512+ const handler = windowAttentionHandler
2513+
2514+ function enable_window_attention_handler ( ) {
2515+ if ( handler && ! handler . _windowDemandsAttentionId ) {
2516+ handler . _windowDemandsAttentionId = global . display . connect ( 'window-demands-attention' , ( display , window ) => {
2517+ handler . _onWindowDemandsAttention ( display , window )
2518+ } )
2519+ }
2520+ }
2521+
2522+ function disable_window_attention_handler ( ) {
2523+ if ( handler && handler . _windowDemandsAttentionId ) {
2524+ global . display . disconnect ( handler . _windowDemandsAttentionId ) ;
2525+ handler . _windowDemandsAttentionId = null
2526+ }
25062527}
25072528
25082529function stylesheet_path ( name : string ) { return Me . path + "/" + name + ".css" ; }
0 commit comments