зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1584139
[Linux/CSD] Add decoration size to nsWindow::LockAspectRatio() when CSD mode is used, r=jhorak
Depends on D47234 Differential Revision: https://phabricator.services.mozilla.com/D47235 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
ae44a5d195
Коммит
ded82a61e2
|
@ -7244,9 +7244,19 @@ GtkTextDirection nsWindow::GetTextDirection() {
|
|||
|
||||
void nsWindow::LockAspectRatio(bool aShouldLock) {
|
||||
if (aShouldLock) {
|
||||
mAspectRatio = (float)mBounds.Width() / (float)mBounds.Height();
|
||||
LOG(("nsWindow::LockAspectRatio() [%p] width %d height %d aspect %f\n",
|
||||
(void*)this, mBounds.Height(), mBounds.Width(), mAspectRatio));
|
||||
float width = (float)mBounds.Width();
|
||||
float height = (float)mBounds.Height();
|
||||
|
||||
if (mCSDSupportLevel == CSD_SUPPORT_CLIENT) {
|
||||
GtkBorder decorationSize;
|
||||
GetCSDDecorationSize(GTK_WINDOW(mShell), &decorationSize);
|
||||
width += decorationSize.left + decorationSize.right;
|
||||
height += decorationSize.top + decorationSize.bottom;
|
||||
}
|
||||
|
||||
mAspectRatio = width / height;
|
||||
LOG(("nsWindow::LockAspectRatio() [%p] width %f height %f aspect %f\n",
|
||||
(void*)this, width, height, mAspectRatio));
|
||||
} else {
|
||||
mAspectRatio = 0.0;
|
||||
LOG(("nsWindow::LockAspectRatio() [%p] removed aspect ratio\n",
|
||||
|
|
Загрузка…
Ссылка в новой задаче