Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.3
-
None
Description
I've written this as being against QtWayland, but ultimately all the work has to be in QWidgets.
Right now Qt tries to keep new popups on screen, this is duplicated in a few places but doesn't work on wayland as we don't have enough information about where our window is, therefore it can't try and keep a window on screen. If anything Qt's attempts are detrimental.
On wayland we need to supply the metadata to the compositor where it can make the right move. The API is quite good, so it's a good opportunity to de-duplicate the Qt code.
// Step 1:
Introduce QMenu::popup(QRect)
copying the code from QMenubar
then migrate QMenuBar to that, solving the QMenuBar problem
Step 2:
class QPopupPosition { QPopupPosition(QWindow *transientParent, QRect parentAnchorRect); setTransientParent(QWindow *transientParent); setParentAnchorRect(const QRect &parentAnchorRect); setParentAnchor(Qt::Edge anchorEdge); setClientAnchor(Qt::Edge anchorEdge); // this would be the inverse of gravity to be closer to Qt API setConstaintHandling(Constraint); // flip, slide, resize // offset? // used by QMenu to either follow or ignore struts, write that this may have no effect on the platform blah blah setUseFullscreenForPopup(bool useFullScreen); }; // add a method in QPlatformWindow (maybe surfaced in QWindow?) QPlatformWindow::position(const QPopupPosition &popupPosition) { setTransientParent(popupPosition.transientParent()); // position window (we can copy and paste all the kwin code's here) QPoint pos = ... move(pos); } QWaylandWindow::position(const QPopupPosition &popupPosition) { // on wayland we would cache the positioning m_popupPosition = position; // then somehow expose this to XdgShellPopup in the show method }
port the following to use this
QMenu
QComboBox
QDateTimeEdit
QTooltip
Attachments
Issue Links
- relates to
-
QTBUG-110425 Support xdg_popup_reposition for QtWayland
- Reported
- resulted from
-
QTBUG-85297 Menu location is offset depending on xdg_output.logical_layout in sway
- Closed