[workspaces] Don't crash trying to get an icon for untracked app

Use ShellApp directly rather than trying to handle null-safety
with .get_info().
This commit is contained in:
Colin Walters 2009-10-15 16:17:18 -04:00
parent d705c1bb52
commit 51c41aed90

View File

@ -1227,13 +1227,13 @@ Workspace.prototype = {
_createWindowIcon: function(window) { _createWindowIcon: function(window) {
let appSys = Shell.AppSystem.get_default(); let appSys = Shell.AppSystem.get_default();
let appMon = Shell.AppMonitor.get_default() let appMon = Shell.AppMonitor.get_default()
let appInfo = appMon.get_window_app(window.metaWindow).get_info(); let app = appMon.get_window_app(window.metaWindow);
let iconTexture = null; let iconTexture = null;
// The design is application based, so prefer the application // The design is application based, so prefer the application
// icon here if we have it. FIXME - should move this fallback code // icon here if we have it. FIXME - should move this fallback code
// into ShellAppMonitor. // into ShellAppMonitor.
if (appInfo) { if (app) {
iconTexture = appInfo.create_icon_texture(48); iconTexture = app.create_icon_texture(48);
} else { } else {
let icon = window.metaWindow.icon; let icon = window.metaWindow.icon;
iconTexture = new Clutter.Texture({ width: 48, iconTexture = new Clutter.Texture({ width: 48,