Skip to content

Commit 3db3f89

Browse files
committedOct 8, 2024
Bug 1923289 - Don't report popups as transparent in uncomposited screens. r=stransky
This makes us choose the right rounding mode in nsView::CalcWidgetBounds in order to prevent seams. Remove composited screen special case which is no longer relevant now that the X11 shape mask code is gone. Differential Revision: https://phabricator.services.mozilla.com/D224918
1 parent a2fc32e commit 3db3f89

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed
 

‎view/nsView.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ void nsView::NotifyEffectiveVisibilityChanged(bool aEffectivelyVisible) {
400400

401401
SetForcedRepaint(true);
402402

403-
if (nullptr != mWindow) {
403+
if (mWindow) {
404404
ResetWidgetBounds(false, false);
405405
}
406406

‎widget/gtk/nsWindow.cpp

+11-7
Original file line numberDiff line numberDiff line change
@@ -758,13 +758,9 @@ bool nsWindow::WidgetTypeSupportsAcceleration() {
758758
if (IsSmallPopup()) {
759759
return false;
760760
}
761-
// Workaround for Bug 1479135
762-
// We draw transparent popups on non-compositing screens by SW as we don't
763-
// implement X shape masks in WebRender.
764761
if (mWindowType == WindowType::Popup) {
765-
return HasRemoteContent() && mCompositedScreen;
762+
return HasRemoteContent();
766763
}
767-
768764
return true;
769765
}
770766

@@ -5911,7 +5907,7 @@ nsresult nsWindow::Create(nsIWidget* aParent, const LayoutDeviceIntRect& aRect,
59115907
ConstrainSize(&mBounds.width, &mBounds.height);
59125908
mLastSizeRequest = mBounds.Size();
59135909

5914-
bool popupNeedsAlphaVisual =
5910+
const bool popupNeedsAlphaVisual =
59155911
mWindowType == WindowType::Popup && aInitData &&
59165912
aInitData->mTransparencyMode == TransparencyMode::Transparent;
59175913

@@ -6009,6 +6005,9 @@ nsresult nsWindow::Create(nsIWidget* aParent, const LayoutDeviceIntRect& aRect,
60096005
gtk_widget_set_visual(mShell, visual);
60106006
mHasAlphaVisual = true;
60116007
}
6008+
} else {
6009+
// We can't really provide transparency...
6010+
mIsTransparent = false;
60126011
}
60136012
}
60146013

@@ -6830,11 +6829,16 @@ void nsWindow::SetTransparencyMode(TransparencyMode aMode) {
68306829
// Ignore the request so as to workaround that.
68316830
// mIsTransparent is set in Create() if transparency may be required.
68326831
if (isTransparent) {
6833-
NS_WARNING("Transparent mode not supported on non-popup windows.");
6832+
NS_WARNING(
6833+
"Non-initial transparent mode not supported on non-popup windows.");
68346834
}
68356835
return;
68366836
}
68376837

6838+
if (!mCompositedScreen) {
6839+
return;
6840+
}
6841+
68386842
mIsTransparent = isTransparent;
68396843

68406844
if (!mHasAlphaVisual) {

0 commit comments

Comments
 (0)
Failed to load comments.