зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
f214413b6c
Коммит
ae1ee13587
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче