Bug 1863409 [Wayland] Count CSD decoration size borders for CSD windows with system titlebar off r=emilio

Right now we count CSD decoration size borders only for CSD windows with system titlebar on
which is incorrect as such windows also have CSD borders on Wayland.

Differential Revision: https://phabricator.services.mozilla.com/D193787
This commit is contained in:
stransky 2023-11-21 12:01:27 +00:00
Родитель b723d6a79a
Коммит 0a55cd6b63
1 изменённых файлов: 9 добавлений и 1 удалений

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

@ -889,9 +889,17 @@ bool nsWindow::DrawsToCSDTitlebar() const {
}
void nsWindow::AddCSDDecorationSize(int* aWidth, int* aHeight) {
if (!DrawsToCSDTitlebar()) {
if (mSizeMode != nsSizeMode_Normal ||
mGtkWindowDecoration != GTK_DECORATION_CLIENT) {
return;
}
// We add decoration borders if titlebar is off or on Wayland
// where CSD is always used.
if (!mDrawInTitlebar && !GdkIsWaylandDisplay()) {
return;
}
GtkBorder decorationSize = GetCSDDecorationSize(IsPopup());
*aWidth += decorationSize.left + decorationSize.right;
*aHeight += decorationSize.top + decorationSize.bottom;