Fix minimize animation in HiDPI monitor (#164) (#541)

* Fix minimize animation in HiDPI monitor (#164)
This commit is contained in:
statiolake 2019-06-01 07:44:37 +09:00 committed by Adam Bieńkowski
parent 3ae100da4b
commit 1024813560

View File

@ -1018,6 +1018,12 @@ namespace Gala
Rectangle icon = {}; Rectangle icon = {};
if (actor.get_meta_window ().get_icon_geometry (out icon)) { if (actor.get_meta_window ().get_icon_geometry (out icon)) {
// Fix icon position and size according to ui scaling factor.
int ui_scale = InternalUtils.get_ui_scaling_factor ();
icon.x *= ui_scale;
icon.y *= ui_scale;
icon.width *= ui_scale;
icon.height *= ui_scale;
float scale_x = (float)icon.width / actor.width; float scale_x = (float)icon.width / actor.width;
float scale_y = (float)icon.height / actor.height; float scale_y = (float)icon.height / actor.height;