wayland/toplevel: add pending state for outputs entered before qscreen init

Fixes a crash in sway, and potentially other compositors, when a
toplevel enters an output before Qt has created a QScreen for it.
This commit is contained in:
outfoxxed 2025-01-31 23:54:11 -08:00
parent c3ed3b0ee2
commit aeb347ba91
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
2 changed files with 65 additions and 4 deletions

View file

@ -51,6 +51,7 @@ signals:
private slots:
void onParentClosed();
void onRectWindowDestroyed();
void onScreenAdded(QScreen* screen);
private:
void zwlr_foreign_toplevel_handle_v1_done() override;
@ -66,6 +67,7 @@ private:
QString mAppId;
QString mTitle;
QVector<QScreen*> mVisibleScreens;
QVector<wl_output*> mPendingVisibleScreens;
ToplevelHandle* mParent = nullptr;
bool mActivated = false;
bool mMaximized = false;