altTab: Fix window-switcher on HiDPI displays

We need to take the scale factor into account to avoid tiny window
previews on HiDPI.

https://bugzilla.gnome.org/show_bug.cgi?id=758676
This commit is contained in:
Florian Müllner 2015-11-26 00:04:11 +01:00
parent 293bc98394
commit 491e511a96

View File

@ -685,15 +685,17 @@ const WindowIcon = new Lang.Class({
this._icon.destroy_all_children(); this._icon.destroy_all_children();
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
switch (mode) { switch (mode) {
case AppIconMode.THUMBNAIL_ONLY: case AppIconMode.THUMBNAIL_ONLY:
size = WINDOW_PREVIEW_SIZE; size = WINDOW_PREVIEW_SIZE;
this._icon.add_actor(_createWindowClone(mutterWindow, WINDOW_PREVIEW_SIZE)); this._icon.add_actor(_createWindowClone(mutterWindow, size * scaleFactor));
break; break;
case AppIconMode.BOTH: case AppIconMode.BOTH:
size = WINDOW_PREVIEW_SIZE; size = WINDOW_PREVIEW_SIZE;
this._icon.add_actor(_createWindowClone(mutterWindow, WINDOW_PREVIEW_SIZE)); this._icon.add_actor(_createWindowClone(mutterWindow, size * scaleFactor));
if (this.app) if (this.app)
this._icon.add_actor(this._createAppIcon(this.app, this._icon.add_actor(this._createAppIcon(this.app,
@ -705,7 +707,7 @@ const WindowIcon = new Lang.Class({
this._icon.add_actor(this._createAppIcon(this.app, size)); this._icon.add_actor(this._createAppIcon(this.app, size));
} }
this._icon.set_size(size, size); this._icon.set_size(size * scaleFactor, size * scaleFactor);
}, },
_createAppIcon: function(app, size) { _createAppIcon: function(app, size) {