alternate-tab: don't crash if a window is not associated with an app
A dialog for which the parent application is closed may end up without an app. In that case, show only the thumbnail, or if showing icons only, show a missing icon.
This commit is contained in:
@@ -363,17 +363,27 @@ const WindowIcon = new Lang.Class({
|
||||
y_expand: true });
|
||||
this._iconBin.add_actor(this.clone);
|
||||
|
||||
this.appIcon = this.app.create_icon_texture(size / 2);
|
||||
this.appIcon.x_expand = this.appIcon.y_expand = true;
|
||||
this.appIcon.x_align = Clutter.ActorAlign.END;
|
||||
this.appIcon.y_align = Clutter.ActorAlign.END;
|
||||
this._iconBin.add_actor(this.appIcon);
|
||||
if (this.app) {
|
||||
this.appIcon = this.app.create_icon_texture(size / 2);
|
||||
this.appIcon.x_expand = this.appIcon.y_expand = true;
|
||||
this.appIcon.x_align = Clutter.ActorAlign.END;
|
||||
this.appIcon.y_align = Clutter.ActorAlign.END;
|
||||
this._iconBin.add_actor(this.appIcon);
|
||||
}
|
||||
break;
|
||||
|
||||
case AppIconMode.APP_ICON_ONLY:
|
||||
size = 96;
|
||||
this.appIcon = this.app.create_icon_texture(size);
|
||||
this.appIcon.x_expand = this.appIcon.y_expand = true;
|
||||
if (this.app) {
|
||||
this.appIcon = this.app.create_icon_texture(size);
|
||||
this.appIcon.x_expand = this.appIcon.y_expand = true;
|
||||
} else {
|
||||
this.appIcon = new St.Icon({ icon_name: 'icon-missing',
|
||||
icon_type: St.IconType.FULLCOLOR,
|
||||
icon_size: size,
|
||||
x_expand: true,
|
||||
y_expand: true });
|
||||
}
|
||||
this._iconBin.add_actor(this.appIcon);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user