File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -276,15 +276,15 @@ class IndicatorStatusIcon extends BaseStatusIcon {
276
276
yAlign : Clutter . ActorAlign . CENTER ,
277
277
} ) ;
278
278
this . _label = new St . Label ( ) ;
279
- this . _labelBin . add_actor ( this . _label ) ;
280
- this . _box . add_actor ( this . _labelBin ) ;
279
+ Util . addActor ( this . _labelBin , this . _label ) ;
280
+ Util . addActor ( this . _box , this . _labelBin ) ;
281
281
}
282
282
this . _label . set_text ( label ) ;
283
283
if ( ! this . _box . contains ( this . _labelBin ) )
284
- this . _box . add_actor ( this . _labelBin ) ; // FIXME: why is it suddenly necessary?
284
+ Util . addActor ( this . _box , this . _labelBin ) ; // FIXME: why is it suddenly necessary?
285
285
} else if ( this . _label ) {
286
286
this . _labelBin . destroy_all_children ( ) ;
287
- this . _box . remove_actor ( this . _labelBin ) ;
287
+ Util . removeActor ( this . _box , this . _labelBin ) ;
288
288
this . _labelBin . destroy ( ) ;
289
289
delete this . _labelBin ;
290
290
delete this . _label ;
Original file line number Diff line number Diff line change @@ -375,6 +375,20 @@ export function tryCleanupOldIndicators() {
375
375
new Set ( indicators ) . forEach ( i => i . destroy ( ) ) ;
376
376
}
377
377
378
+ export function addActor ( obj , actor ) {
379
+ if ( obj . add_actor )
380
+ obj . add_actor ( actor )
381
+ else
382
+ obj . add_child ( actor )
383
+ }
384
+
385
+ export function removeActor ( obj , actor ) {
386
+ if ( obj . remove_actor )
387
+ obj . remove_actor ( actor )
388
+ else
389
+ obj . remove_child ( actor )
390
+ }
391
+
378
392
export const CancellableChild = GObject . registerClass ( {
379
393
Properties : {
380
394
'parent' : GObject . ParamSpec . object (
You can’t perform that action at this time.
0 commit comments