Backed out changeset acc3d38ec70b (bug 1768360) for causing build bustages on nsWindow.cpp. CLOSED TREE

This commit is contained in:
criss 2022-05-19 15:25:48 +03:00
Родитель 85bfbfeed8
Коммит 5de2f96173
2 изменённых файлов: 14 добавлений и 28 удалений

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

@ -2108,7 +2108,7 @@ void nsWindow::NativeMoveResizeWaylandPopup(bool aMove, bool aResize) {
bool trackedInHierarchy = WaylandPopupConfigure();
// Read popup position from layout if it was moved or newly created.
// Read popup position from layout if it was moved.
// This position is used by move-to-rect method as we need anchor and other
// info to place popup correctly.
// We need WaylandPopupConfigure() to be called before to have all needed
@ -2356,14 +2356,10 @@ nsWindow::WaylandPopupGetPositionFromLayout() {
}
return {
anchorRect,
rectAnchor,
menuAnchor,
hints,
anchorRect, rectAnchor, menuAnchor, hints,
DevicePixelsToGdkPointRoundDown(LayoutDevicePoint::FromAppUnitsToNearest(
popupMargin.mPopupOffset,
popupFrame->PresContext()->AppUnitsPerDevPixel())),
true};
popupFrame->PresContext()->AppUnitsPerDevPixel()))};
}
void nsWindow::WaylandPopupMove() {
@ -2374,28 +2370,19 @@ void nsWindow::WaylandPopupMove() {
GdkWindow*, const GdkRectangle*, GdkGravity, GdkGravity, GdkAnchorHints,
gint, gint))dlsym(RTLD_DEFAULT, "gdk_window_move_to_rect");
GdkWindow* gdkWindow = gtk_widget_get_window(GTK_WIDGET(mShell));
nsMenuPopupFrame* popupFrame = GetMenuPopupFrame(GetFrame());
LOG(" original widget popup position [%d, %d]\n", mPopupPosition.x,
mPopupPosition.y);
LOG(" relative widget popup position [%d, %d]\n", mRelativePopupPosition.x,
mRelativePopupPosition.y);
if (mPopupUseMoveToRect && !sGdkWindowMoveToRect) {
LOG(" can't use move-to-rect due missing gdk_window_move_to_rect()");
mPopupUseMoveToRect = false;
if (mPopupUseMoveToRect) {
mPopupUseMoveToRect = sGdkWindowMoveToRect && gdkWindow && popupFrame;
}
GdkWindow* gdkWindow = gtk_widget_get_window(GTK_WIDGET(mShell));
nsMenuPopupFrame* popupFrame = GetMenuPopupFrame(GetFrame());
if (mPopupUseMoveToRect && !gdkWindow || !popupFrame) {
LOG(" can't use move-to-rect due missing gdkWindow or popupFrame");
mPopupUseMoveToRect = false;
}
if (mPopupUseMoveToRect && !mPopupMoveToRectParams.mAnchorSet) {
LOG(" can't use move-to-rect due missing anchor");
mPopupUseMoveToRect = false;
}
LOG(" popup use move to rect %d\n", mPopupUseMoveToRect);
LOG(" popup use move to rect %d\n", mPopupUseMoveToRect);
if (!mPopupUseMoveToRect) {
if (mNeedsShow && mPopupType != ePopupTypeTooltip) {

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

@ -705,12 +705,11 @@ class nsWindow final : public nsBaseWidget {
// we need to reuse last GdkWindowMoveToRect params to avoid
// popup movement.
struct WaylandPopupMoveToRectParams {
LayoutDeviceIntRect mAnchorRect = {0, 0, 0, 0};
GdkGravity mAnchorRectType = GDK_GRAVITY_NORTH_WEST;
GdkGravity mPopupAnchorType = GDK_GRAVITY_NORTH_WEST;
GdkAnchorHints mHints = GDK_ANCHOR_SLIDE;
GdkPoint mOffset = {0, 0};
bool mAnchorSet = false;
LayoutDeviceIntRect mAnchorRect;
GdkGravity mAnchorRectType;
GdkGravity mPopupAnchorType;
GdkAnchorHints mHints;
GdkPoint mOffset;
};
WaylandPopupMoveToRectParams mPopupMoveToRectParams;