diff options
| author | Jøger Hansegård <[email protected]> | 2023-11-07 19:58:26 +0100 |
|---|---|---|
| committer | Jøger Hansegård <[email protected]> | 2023-11-08 18:24:18 +0100 |
| commit | 70404a2773293e4f3a763aa2f057f1d6569e8661 (patch) | |
| tree | aa4e2e75725b2359b2d5f507b8bc47f5a4ebd711 /tests/manual/wasm/selenium/qwasmwindow/qwasmwindow.py | |
| parent | a8df174369cecd90f14dac85bf162353b7cb25d1 (diff) | |
Prevent oversized QToolButton menu from moving to primary screen
The QMenu pop-up used with a QToolButton could unexpectedly move to the
primary screen if it was too big to fit on the owning widget's screen.
The cause of the issue is that QMenu is a top-level window, and can not
infer its screen from any parents. Its positioning is therefore done
using heuristics in QToolButton. These heuristics attempt to calculate a
best guess point relative to the screen that contains the QToolButton.
If these heuristics result in a point that is outside all screens, the
QMenu's own screen takes precedence, and this is always the primary
screen. This way, the QMenu ends up at the calculated position, but
relative to the wrong screen.
This patch works around this issue by ensuring that the first estimate
for the pop-up position is always within the same screen as the
QToolButton. The danger with this workaround is that the menu may end up
in an inconvenient location. This does, however, seem to be handled by
subsequent adjustments in QMenuPrivate::popup.
Fixes: QTBUG-118695
Pick-to: 6.6 6.5
Change-Id: Ibb4a1c82e827c57bbb0798a6c6f5eecb6d639c62
Reviewed-by: Richard Moe Gustavsen <[email protected]>
Diffstat (limited to 'tests/manual/wasm/selenium/qwasmwindow/qwasmwindow.py')
0 files changed, 0 insertions, 0 deletions
