@@ -13,6 +13,8 @@ import { MessageService } from '@theia/core/lib/common/message-service';
13
13
import { inject , injectable } from '@theia/core/shared/inversify' ;
14
14
import { ApplicationConnectionStatusContribution } from './connection-status-service' ;
15
15
import { ToolbarAwareTabBar } from './tab-bars' ;
16
+ import { find } from '@theia/core/shared/@phosphor/algorithm' ;
17
+ import { OutputWidget } from '@theia/output/lib/browser/output-widget' ;
16
18
17
19
@injectable ( )
18
20
export class ApplicationShell extends TheiaApplicationShell {
@@ -48,6 +50,38 @@ export class ApplicationShell extends TheiaApplicationShell {
48
50
return super . addWidget ( widget , { ...options , ref } ) ;
49
51
}
50
52
53
+ override doRevealWidget ( id : string ) : Widget | undefined {
54
+ let widget = find ( this . mainPanel . widgets ( ) , ( w ) => w . id === id ) ;
55
+ if ( ! widget ) {
56
+ widget = find ( this . bottomPanel . widgets ( ) , ( w ) => w . id === id ) ;
57
+ if ( widget ) {
58
+ this . expandBottomPanel ( ) ;
59
+ }
60
+ }
61
+ if ( widget ) {
62
+ const tabBar = this . getTabBarFor ( widget ) ;
63
+ if ( tabBar ) {
64
+ tabBar . currentTitle = widget . title ;
65
+ }
66
+ }
67
+ if ( ! widget ) {
68
+ widget = this . leftPanelHandler . expand ( id ) ;
69
+ }
70
+ if ( ! widget ) {
71
+ widget = this . rightPanelHandler . expand ( id ) ;
72
+ }
73
+ if ( widget ) {
74
+ // Prevent focusing the output widget when is updated
75
+ // See https://github.com/arduino/arduino-ide/issues/2679
76
+ if ( ! ( widget instanceof OutputWidget ) ) {
77
+ this . windowService . focus ( ) ;
78
+ }
79
+ return widget ;
80
+ } else {
81
+ return this . secondaryWindowHandler . revealWidget ( id ) ;
82
+ }
83
+ }
84
+
51
85
override handleEvent ( ) : boolean {
52
86
// NOOP, dragging has been disabled
53
87
return false ;
0 commit comments