Closed Bug 1546374 Opened 1 year ago Closed 1 year ago

[wayland] [gtk] popup wrongly placed when primary monitor has offset


(Core :: Widget: Gtk, defect, P3)




Tracking Status
firefox68 --- fixed


(Reporter: jhorak, Assigned: jhorak)


(Blocks 1 open bug, Regressed 3 open bugs)



(1 file)

When the primary screen has offset the popup menus are moved by this offset all the time:
[(null) 27130: Main Thread]: D/WidgetScreen New screen [0 2880 3840 2160 (0 2880 3840 2160) 32 2.000000 2.000000 288.757874]
[(null) 27130: Main Thread]: D/WidgetScreen New screen [527 0 2560 1440 (527 0 2560 1440) 32 1.000000 1.000000 117.987099] <- this is primary screen

This is because no GTK app knows on which monitor it is located in Wayland (ie. its absolute position), so the Firefox's ScreenManager returns the primary monitor all the time and in the nsMenuPopupFrame::SetPopupPosition the offset is used to ensure that menu is shown on monitor:

// Ensure that anchorRect is on screen.
anchorRect = anchorRect.Intersect(screenRect);

The Firefox needs to stop adjusting popup position in Wayland because it does not work and it should be executed by gdk_window_move_to_rect() which ensures the popup is shown in visible area.

gdk_window_move_to_rect() is implemented at Bug 1423598

Priority: -- → P3

Because adjusting position in the Wayland does not work
(because of unknown absolute position of the window), do not try
to adjust popup position under Wayland.

Pushed by
Do not adjust position of popup windows on Wayland; r=stransky

Keywords: checkin-needed
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Regressions: 1562576
Regressions: 1565401
Regressions: 1577589
Regressions: 1606010
You need to log in before you can comment on or make changes to this bug.