summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmwindowstack.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmwindowstack.h')
-rw-r--r--src/plugins/platforms/wasm/qwasmwindowstack.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/plugins/platforms/wasm/qwasmwindowstack.h b/src/plugins/platforms/wasm/qwasmwindowstack.h
index 2eb48b0865..c75001157a 100644
--- a/src/plugins/platforms/wasm/qwasmwindowstack.h
+++ b/src/plugins/platforms/wasm/qwasmwindowstack.h
@@ -24,7 +24,7 @@ class QWasmWindow;
class Q_AUTOTEST_EXPORT QWasmWindowStack
{
public:
- using TopWindowChangedCallbackType = std::function<void()>;
+ using WindowOrderChangedCallbackType = std::function<void()>;
using StorageType = QList<QWasmWindow *>;
@@ -32,13 +32,20 @@ public:
using const_iterator = StorageType::const_reverse_iterator;
using const_reverse_iterator = StorageType::const_iterator;
- explicit QWasmWindowStack(TopWindowChangedCallbackType topWindowChangedCallback);
+ enum class PositionPreference {
+ StayOnBottom,
+ Regular,
+ StayOnTop,
+ };
+
+ explicit QWasmWindowStack(WindowOrderChangedCallbackType topWindowChangedCallback);
~QWasmWindowStack();
- void pushWindow(QWasmWindow *window);
+ void pushWindow(QWasmWindow *window, PositionPreference position);
void removeWindow(QWasmWindow *window);
void raise(QWasmWindow *window);
void lower(QWasmWindow *window);
+ void windowPositionPreferenceChanged(QWasmWindow *window, PositionPreference position);
// Iterates top-to-bottom
iterator begin();
@@ -55,14 +62,12 @@ public:
QWasmWindow *topWindow() const;
private:
- enum class FirstWindowTreatment { AlwaysAtBottom, Regular };
-
- QWasmWindow *rootWindow() const;
- StorageType::iterator regularWindowsBegin();
+ PositionPreference getWindowPositionPreference(StorageType::iterator windowIt) const;
- TopWindowChangedCallbackType m_topWindowChangedCallback;
+ WindowOrderChangedCallbackType m_windowOrderChangedCallback;
QList<QWasmWindow *> m_windowStack;
- FirstWindowTreatment m_firstWindowTreatment = FirstWindowTreatment::AlwaysAtBottom;
+ StorageType::iterator m_regularWindowsBegin;
+ StorageType::iterator m_alwaysOnTopWindowsBegin;
};
QT_END_NAMESPACE