Bug 1667851 [Wayland] Guess subsurface offset from window decorations size, r=jhorak

- Try to set subsurface offset even if we mozcontainer size allocation is not finished. Use window decoration size for it.
- Add more logging to mozcontainer code.

Depends on D104549

Differential Revision: https://phabricator.services.mozilla.com/D104550
This commit is contained in:
stransky
2021-02-10 16:01:13 +00:00
parent 15b3cb2876
commit 4ab1f54d91
4 changed files with 49 additions and 36 deletions

View File

@@ -1072,13 +1072,26 @@ void nsWindow::SetSizeConstraints(const SizeConstraints& aConstraints) {
}
void nsWindow::AddCSDDecorationSize(int* aWidth, int* aHeight) {
if (mCSDSupportLevel == GTK_DECORATION_CLIENT && mDrawInTitlebar) {
if (mSizeState == nsSizeMode_Normal &&
mCSDSupportLevel == GTK_DECORATION_CLIENT && mDrawInTitlebar) {
GtkBorder decorationSize = GetCSDDecorationSize(!mIsTopLevel);
*aWidth += decorationSize.left + decorationSize.right;
*aHeight += decorationSize.top + decorationSize.bottom;
}
}
bool nsWindow::GetCSDDecorationOffset(int* aDx, int* aDy) {
if (mSizeState == nsSizeMode_Normal &&
mCSDSupportLevel == GTK_DECORATION_CLIENT && mDrawInTitlebar) {
GtkBorder decorationSize = GetCSDDecorationSize(!mIsTopLevel);
*aDx = decorationSize.left;
*aDy = decorationSize.top;
return true;
} else {
return false;
}
}
void nsWindow::ApplySizeConstraints(void) {
if (mShell) {
GdkGeometry geometry;