@@ -662,25 +662,29 @@ export class ShellWindow {
662
662
663
663
/// Activates a window, and moves the mouse point.
664
664
export function activate ( ext : Ext , move_mouse : boolean , default_pointer_position : Config . DefaultPointerPosition , win : Meta . Window ) {
665
- if ( win . is_override_redirect ( ) ) return
665
+ try {
666
+ if ( win . is_override_redirect ( ) ) return
666
667
667
- const workspace = win . get_workspace ( )
668
- if ( ! workspace ) return
668
+ const workspace = win . get_workspace ( )
669
+ if ( ! workspace ) return
669
670
670
- scheduler . setForeground ( win )
671
+ scheduler . setForeground ( win )
671
672
672
- win . unminimize ( ) ;
673
- workspace . activate_with_focus ( win , global . get_current_time ( ) )
674
- win . raise ( )
673
+ win . unminimize ( ) ;
674
+ workspace . activate_with_focus ( win , global . get_current_time ( ) )
675
+ win . raise ( )
675
676
676
- const pointer_placement_permitted = move_mouse
677
- && imports . ui . main . modalCount === 0
678
- && ext . settings . mouse_cursor_follows_active_window ( )
679
- && ! pointer_already_on_window ( win )
680
- && pointer_in_work_area ( )
677
+ const pointer_placement_permitted = move_mouse
678
+ && imports . ui . main . modalCount === 0
679
+ && ext . settings . mouse_cursor_follows_active_window ( )
680
+ && ! pointer_already_on_window ( win )
681
+ && pointer_in_work_area ( )
681
682
682
- if ( pointer_placement_permitted ) {
683
- place_pointer_on ( default_pointer_position , win )
683
+ if ( pointer_placement_permitted ) {
684
+ place_pointer_on ( default_pointer_position , win )
685
+ }
686
+ } catch ( error ) {
687
+ log . error ( `failed to activate window: ${ error } ` )
684
688
}
685
689
}
686
690
0 commit comments