diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2018-06-15 14:59:26 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-06-19 06:19:13 +0000 |
commit | cf86659c874fcb1d3f88a784cd88a51942e5926b (patch) | |
tree | 07933efbc88a58420f6248111ac6018bf6f547e7 /src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp | |
parent | 9b3260164da42b5edabc6cf6d73b7a35ab38e93d (diff) |
Client: Get rid of QWaylandShellSurface::setType
This shouldn't change any behavior, but lets the shell integrations choose
if they want to use the extremely hacky QWaylandWindow::transientParent().
Hint: Not all shells need the hacks, and not all shells need them in all cases,
and some shells may need even more hacks.
Change-Id: Id105e4feb83cc9c14dcf07dcca55fcd5e63d4a2b
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp')
-rw-r--r-- | src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp b/src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp index 9f2bcc00c..d9bc83059 100644 --- a/src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp +++ b/src/plugins/shellintegration/wl-shell/qwaylandwlshellsurface.cpp @@ -59,6 +59,15 @@ QWaylandWlShellSurface::QWaylandWlShellSurface(struct ::wl_shell_surface *shell_ { if (window->display()->windowExtension()) m_extendedWindow = new QWaylandExtendedSurface(window); + + Qt::WindowType type = window->window()->type(); + auto *transientParent = window->transientParent(); + if (type == Qt::Popup && transientParent && transientParent->object()) + setPopup(transientParent, m_window->display()->lastInputDevice(), m_window->display()->lastInputSerial()); + else if (transientParent && transientParent->object()) + updateTransientParent(transientParent->window()); + else + setTopLevel(); } QWaylandWlShellSurface::~QWaylandWlShellSurface() @@ -250,16 +259,6 @@ void QWaylandWlShellSurface::setPopup(QWaylandWindow *parent, QWaylandInputDevic transientPos.x(), transientPos.y(), 0); } -void QWaylandWlShellSurface::setType(Qt::WindowType type, QWaylandWindow *transientParent) -{ - if (type == Qt::Popup && transientParent && transientParent->object()) - setPopup(transientParent, m_window->display()->lastInputDevice(), m_window->display()->lastInputSerial()); - else if (transientParent && transientParent->object()) - updateTransientParent(transientParent->window()); - else - setTopLevel(); -} - void QWaylandWlShellSurface::shell_surface_ping(uint32_t serial) { pong(serial); |