Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 6bbd33a

Browse files
committed
Bug 1735294 [Wayland] Don't use global popup position for tooltips and use move-to-rect when possible, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D128202
1 parent cc06afa commit 6bbd33a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

widget/gtk/nsWindow.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,8 @@ void nsWindow::UpdateWaylandPopupHierarchy() {
20012001
// (mPopupAnchored).
20022002
// - Popup isn't anchored but it has toplevel as parent, i.e.
20032003
// it's first popup.
2004-
useMoveToRect = (popup->mPopupAnchored ||
2004+
useMoveToRect = (mPopupType == ePopupTypeTooltip) ||
2005+
(popup->mPopupAnchored ||
20052006
(!popup->mPopupAnchored &&
20062007
popup->mWaylandPopupPrev->mWaylandToplevel == nullptr));
20072008
}
@@ -2354,16 +2355,17 @@ void nsWindow::WaylandPopupMove() {
23542355
}
23552356

23562357
if (!mPopupUseMoveToRect) {
2357-
if (mNeedsShow) {
2358+
if (mNeedsShow && mPopupType != ePopupTypeTooltip) {
23582359
// Workaround for https://gitlab.gnome.org/GNOME/gtk/-/issues/4308
2360+
// Tooltips are created as subsurfaces with relative position.
23592361
LOG_POPUP(" use gtk_window_move(%d, %d) for hidden widget\n",
23602362
mPopupPosition.x + mRelativePopupOffset.x,
23612363
mPopupPosition.y + mRelativePopupOffset.y);
23622364
gtk_window_move(GTK_WINDOW(mShell),
23632365
mPopupPosition.x + mRelativePopupOffset.x,
23642366
mPopupPosition.y + mRelativePopupOffset.y);
23652367
} else {
2366-
LOG_POPUP(" use gtk_window_move(%d, %d)\n",
2368+
LOG_POPUP(" use gtk_window_move(%d, %d) for visible widget\n",
23672369
mRelativePopupPosition.x + mRelativePopupOffset.x,
23682370
mRelativePopupPosition.y + mRelativePopupOffset.y);
23692371
gtk_window_move(GTK_WINDOW(mShell),

0 commit comments

Comments
 (0)