Bug 1755706 - Fix SetDrawsInTitlebar for PiP windows. r=stransky

The previous code was not being called because it was only being called
when redundant. The more complex SetDrawsInTitlebar code causes size
changes which mess up PiP window positioning and restoration.

The PiP and window positioning code had other bugs, but with those fixed I get
perfect PiP on X11, which is nice.

Depends on D138914

Differential Revision: https://phabricator.services.mozilla.com/D138915
This commit is contained in:
Emilio Cobos Álvarez 2022-02-17 22:19:40 +00:00
parent 62f49051b0
commit bfa09bee48

View File

@ -8485,18 +8485,18 @@ void nsWindow::SetDrawsInTitlebar(bool aState) {
LOG("nsWindow::SetDrawsInTitlebar() State %d mGtkWindowDecoration %d\n",
aState, (int)mGtkWindowDecoration);
if (mIsPIPWindow && aState == mDrawInTitlebar) {
gtk_window_set_decorated(GTK_WINDOW(mShell), !aState);
LOG(" set decoration for PIP %d", aState);
return;
}
if (mGtkWindowDecoration == GTK_DECORATION_NONE ||
aState == mDrawInTitlebar) {
LOG(" already set, quit");
return;
}
if (mIsPIPWindow) {
gtk_window_set_decorated(GTK_WINDOW(mShell), !aState);
LOG(" set decoration for PIP %d", aState);
return;
}
if (mGtkWindowDecoration == GTK_DECORATION_SYSTEM) {
SetWindowDecoration(aState ? eBorderStyle_border : mBorderStyle);
} else if (mGtkWindowDecoration == GTK_DECORATION_CLIENT) {