forked from mirrors/gecko-dev
Bug 1885933 - Simplify how we get the backdrop state on titlebar buttons. r=stransky
This is the bit we use for styling and everything else. Differential Revision: https://phabricator.services.mozilla.com/D204939
This commit is contained in:
parent
59c267ef4b
commit
41e4f3309f
3 changed files with 2 additions and 25 deletions
|
|
@ -167,9 +167,6 @@ bool nsNativeThemeGTK::GetGtkWidgetAndState(StyleAppearance aAppearance,
|
|||
ElementState elementState = GetContentState(aFrame, aAppearance);
|
||||
if (aState) {
|
||||
memset(aState, 0, sizeof(GtkWidgetState));
|
||||
|
||||
// For XUL checkboxes and radio buttons, the state of the parent
|
||||
// determines our state.
|
||||
if (aWidgetFlags) {
|
||||
if (elementState.HasState(ElementState::CHECKED)) {
|
||||
*aWidgetFlags |= MOZ_GTK_WIDGET_CHECKED;
|
||||
|
|
@ -241,7 +238,8 @@ bool nsNativeThemeGTK::GetGtkWidgetAndState(StyleAppearance aAppearance,
|
|||
aAppearance == StyleAppearance::MozWindowButtonMinimize ||
|
||||
aAppearance == StyleAppearance::MozWindowButtonMaximize ||
|
||||
aAppearance == StyleAppearance::MozWindowButtonRestore) {
|
||||
aState->backdrop = !nsWindow::GetTopLevelWindowActiveState(aFrame);
|
||||
aState->backdrop = !aFrame->PresContext()->Document()->State().HasState(
|
||||
dom::DocumentState::WINDOW_INACTIVE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9954,26 +9954,6 @@ void nsWindow::UnlockNativePointer() {
|
|||
}
|
||||
#endif
|
||||
|
||||
bool nsWindow::GetTopLevelWindowActiveState(nsIFrame* aFrame) {
|
||||
// Used by window frame and button box rendering. We can end up in here in
|
||||
// the content process when rendering one of these moz styles freely in a
|
||||
// page. Fail in this case, there is no applicable window focus state.
|
||||
if (!XRE_IsParentProcess()) {
|
||||
return false;
|
||||
}
|
||||
// All headless windows are considered active so they are painted.
|
||||
if (gfxPlatform::IsHeadless()) {
|
||||
return true;
|
||||
}
|
||||
// Get the widget. nsIFrame's GetNearestWidget walks up the view chain
|
||||
// until it finds a real window.
|
||||
nsWindow* window = static_cast<nsWindow*>(aFrame->GetNearestWidget());
|
||||
if (!window) {
|
||||
return false;
|
||||
}
|
||||
return !window->mTitlebarBackdropState;
|
||||
}
|
||||
|
||||
static nsIFrame* FindTitlebarFrame(nsIFrame* aFrame) {
|
||||
for (nsIFrame* childFrame : aFrame->PrincipalChildList()) {
|
||||
StyleAppearance appearance =
|
||||
|
|
|
|||
|
|
@ -411,7 +411,6 @@ class nsWindow final : public nsBaseWidget {
|
|||
*/
|
||||
static GtkWindowDecoration GetSystemGtkWindowDecoration();
|
||||
|
||||
static bool GetTopLevelWindowActiveState(nsIFrame* aFrame);
|
||||
static bool TitlebarUseShapeMask();
|
||||
bool IsRemoteContent() { return HasRemoteContent(); }
|
||||
void NativeMoveResizeWaylandPopupCallback(const GdkRectangle* aFinalSize,
|
||||
|
|
|
|||
Loading…
Reference in a new issue