Bug 1600414 [Linux] Apply window aspect ratio to PIP on Gnome only, r=jhorak

Window aspect ratio is known to work correctly on Gnome only so apply it only there.

Differential Revision: https://phabricator.services.mozilla.com/D62548

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Martin Stransky 2020-02-12 09:20:29 +00:00
Родитель f214413b6c
Коммит ae1ee13587
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -7769,6 +7769,13 @@ GtkTextDirection nsWindow::GetTextDirection() {
}
void nsWindow::LockAspectRatio(bool aShouldLock) {
static const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP");
static bool setLock =
currentDesktop ? (strstr(currentDesktop, "GNOME") != nullptr) : false;
if (!setLock) {
return;
}
if (aShouldLock) {
float width = (float)DevicePixelsToGdkCoordRoundDown(mBounds.width);
float height = (float)DevicePixelsToGdkCoordRoundDown(mBounds.height);