diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-08-04 02:27:50 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-08-04 02:27:50 +0200 |
commit | 87e81498b73d59e8173953079ca5d0d73c5c302f (patch) | |
tree | 8950646036c5019a47f201b9ccae8056716fd048 /src/ui | |
parent | Merge pull request #662 from LorenDB/qml-all-the-things (diff) | |
download | nheko-87e81498b73d59e8173953079ca5d0d73c5c302f.tar.xz |
Fix window placement on wayland and add close buttons
We explicitly set a parent. We can't assign to ApplicationWindow.transientParent though, only to Window.transientParent, so we just call setTransientParent in C++.
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/NhekoGlobalObject.cpp | 7 | ||||
-rw-r--r-- | src/ui/NhekoGlobalObject.h | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/ui/NhekoGlobalObject.cpp b/src/ui/NhekoGlobalObject.cpp index fea10839..9e0d706b 100644 --- a/src/ui/NhekoGlobalObject.cpp +++ b/src/ui/NhekoGlobalObject.cpp @@ -6,6 +6,7 @@ #include <QDesktopServices> #include <QUrl> +#include <QWindow> #include "Cache_p.h" #include "ChatPage.h" @@ -140,3 +141,9 @@ Nheko::openJoinRoomDialog() const MainWindow::instance()->openJoinRoomDialog( [](const QString &room_id) { ChatPage::instance()->joinRoom(room_id); }); } + +void +Nheko::reparent(QWindow *win) const +{ + win->setTransientParent(MainWindow::instance()->windowHandle()); +} diff --git a/src/ui/NhekoGlobalObject.h b/src/ui/NhekoGlobalObject.h index cfe982c5..d4d119dc 100644 --- a/src/ui/NhekoGlobalObject.h +++ b/src/ui/NhekoGlobalObject.h @@ -11,6 +11,8 @@ #include "Theme.h" #include "UserProfile.h" +class QWindow; + class Nheko : public QObject { Q_OBJECT @@ -49,6 +51,7 @@ public: Q_INVOKABLE void openLogoutDialog() const; Q_INVOKABLE void openCreateRoomDialog() const; Q_INVOKABLE void openJoinRoomDialog() const; + Q_INVOKABLE void reparent(QWindow *win) const; public slots: void updateUserProfile(); |