@@ -163,6 +163,7 @@ export class TrayContainer extends PanelMenu.Button {
163163 declare private _userInteracted : boolean ;
164164 declare private _attentionTimeoutSeconds : number ;
165165 declare private _autoCollapseTimeoutId : number ;
166+ declare private _debugPostAllocateId : number ;
166167 declare private _opacityTargets : WeakMap < TrayIconItem , number > ;
167168 declare private _scrollTarget : number ;
168169 declare private _smoothScrollAccumulator : number ;
@@ -206,6 +207,7 @@ export class TrayContainer extends PanelMenu.Button {
206207 this . _opacityTargets = new WeakMap ( ) ;
207208 this . _scrollTarget = 0 ;
208209 this . _smoothScrollAccumulator = 0 ;
210+ this . _debugPostAllocateId = 0 ;
209211
210212 // Chevron button (collapse/expand toggle)
211213 this . _chevronIcon = new St . Icon ( {
@@ -569,7 +571,9 @@ export class TrayContainer extends PanelMenu.Button {
569571 ) ;
570572 } ,
571573 ) ;
572- GLib . idle_add ( GLib . PRIORITY_DEFAULT_IDLE , ( ) => {
574+ if ( this . _debugPostAllocateId > 0 ) GLib . Source . remove ( this . _debugPostAllocateId ) ;
575+ this . _debugPostAllocateId = GLib . idle_add ( GLib . PRIORITY_DEFAULT_IDLE , ( ) => {
576+ this . _debugPostAllocateId = 0 ;
573577 logger . log (
574578 `Viewport post-allocate chevronX=${ Math . round ( this . _chevron . translationX ) } ${ this . _clipArea . layoutSnapshot ( ) } ` ,
575579 { prefix : LOG_PREFIX } ,
@@ -638,6 +642,10 @@ export class TrayContainer extends PanelMenu.Button {
638642 GLib . Source . remove ( this . _autoCollapseTimeoutId ) ;
639643 this . _autoCollapseTimeoutId = 0 ;
640644 }
645+ if ( this . _debugPostAllocateId > 0 ) {
646+ GLib . Source . remove ( this . _debugPostAllocateId ) ;
647+ this . _debugPostAllocateId = 0 ;
648+ }
641649 destroyTooltip ( ) ;
642650 for ( const widget of this . _items . values ( ) ) widget . destroy ( ) ;
643651 this . _items . clear ( ) ;
0 commit comments