author | Ehsan Akhgari <ehsan@mozilla.com> |
Fri, 21 Sep 2018 13:59:25 -0400 | |
changeset 437750 | bb920e4191661b821481bfc9cba14a5ab84dc241 |
parent 437712 | ce4e883f7642c2c8652e7c065f5bfb122a71cb95 |
child 437753 | 99723bad4d198575d4888af2cc103fa325719e5e |
push id | 108143 |
push user | btara@mozilla.com |
push date | Fri, 21 Sep 2018 22:06:44 +0000 |
treeherder | mozilla-inbound@f125ee6d1cef [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | Aryx |
bugs | 1490297, 1493081 |
milestone | 64.0a1 |
backs out | c5b3caf36ddf3e451feef98e271fea2107af6811 |
first release with | nightly linux32
bb920e419166
/
64.0a1
/
20180921180844
/
files
nightly linux64
bb920e419166
/
64.0a1
/
20180921180844
/
files
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
releases | nightly linux32
64.0a1
/
20180921180844
/
pushlog to previous
nightly linux64
64.0a1
/
20180921180844
/
pushlog to previous
|
view/nsView.cpp | file | annotate | diff | comparison | revisions | |
view/nsView.h | file | annotate | diff | comparison | revisions |
--- a/view/nsView.cpp +++ b/view/nsView.cpp @@ -229,27 +229,16 @@ bool nsView::IsEffectivelyVisible() { for (nsView* v = this; v; v = v->mParent) { if (v->GetVisibility() == nsViewVisibility_kHide) return false; } return true; } -uint32_t nsView::GetParentWindowScaleFactor() -{ - uint32_t scaleFactor = 1; - nsIWidget* parentWidget = - GetParent() ? GetParent()->GetNearestWidget(nullptr) : nullptr; - if (parentWidget) { - scaleFactor = parentWidget->RoundsWidgetCoordinatesTo(); - } - return scaleFactor; -} - LayoutDeviceIntRect nsView::CalcWidgetBounds(nsWindowType aType) { int32_t p2a = mViewManager->AppUnitsPerDevPixel(); nsRect viewBounds(mDimBounds); nsView* parent = GetParent(); nsIWidget* parentWidget = nullptr; @@ -326,19 +315,17 @@ void nsView::DoResetWidgetBounds(bool aM MOZ_ASSERT(mWindow, "Why was this called??"); // Hold this ref to make sure it stays alive. nsCOMPtr<nsIWidget> widget = mWindow; // Stash a copy of these and use them so we can handle this being deleted (say // from sync painting/flushing from Show/Move/Resize on the widget). LayoutDeviceIntRect newBounds; -#if !defined(MOZ_WIDGET_GTK) RefPtr<nsDeviceContext> dx = mViewManager->GetDeviceContext(); -#endif nsWindowType type = widget->WindowType(); LayoutDeviceIntRect curBounds = widget->GetClientBounds(); bool invisiblePopup = type == eWindowType_popup && ((curBounds.IsEmpty() && mDimBounds.IsEmpty()) || mVis == nsViewVisibility_kHide); @@ -368,25 +355,17 @@ void nsView::DoResetWidgetBounds(bool aM bool changedSize = curBounds.Size() != newBounds.Size(); // Child views are never attached to top level widgets, this is safe. // Coordinates are converted to desktop pixels for window Move/Resize APIs, // because of the potential for device-pixel coordinate spaces for mixed // hidpi/lodpi screens to overlap each other and result in bad placement // (bug 814434). -#if defined(MOZ_WIDGET_GTK) - // The GetDesktopToDeviceScale does not work under Wayland because we - // don't know the absolute position of the window in Wayland. We can - // use the same for X11, because it always returns 1 for both calls. - DesktopToLayoutDeviceScale scale = mozilla::DesktopToLayoutDeviceScale( - GetParentWindowScaleFactor()); -#else DesktopToLayoutDeviceScale scale = dx->GetDesktopToDeviceScale(); -#endif DesktopRect deskRect = newBounds / scale; if (changedPos) { if (changedSize && !aMoveOnly) { widget->ResizeClient(deskRect.X(), deskRect.Y(), deskRect.Width(), deskRect.Height(), aInvalidateChangedSize); } else {
--- a/view/nsView.h +++ b/view/nsView.h @@ -457,19 +457,16 @@ private: void ResetWidgetBounds(bool aRecurse, bool aForceSync); void AssertNoWindow(); void NotifyEffectiveVisibilityChanged(bool aEffectivelyVisible); // Update the cached RootViewManager for all view manager descendents. void InvalidateHierarchy(); - // Return current scale factor of the monitor where the parent window of the popup - // is mostly located. - uint32_t GetParentWindowScaleFactor(); nsViewManager *mViewManager; nsView *mParent; nsCOMPtr<nsIWidget> mWindow; nsCOMPtr<nsIWidget> mPreviousWindow; nsView *mNextSibling; nsView *mFirstChild; nsIFrame *mFrame;