summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions/qwaylandxdgshellv5integration.cpp
diff options
context:
space:
mode:
authorPier Luigi Fiorini <pierluigi.fiorini@gmail.com>2016-08-14 13:28:30 +0200
committerPier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>2016-09-30 09:38:56 +0000
commit9e585fc849c80b04c02c671d908fb5ade6c441b0 (patch)
tree0eeb11777d59012f8298f1a5d05e0176fda48eb6 /src/compositor/extensions/qwaylandxdgshellv5integration.cpp
parent079b260e42cf394a8dbe823763ec455929fba091 (diff)
Compositor: Base shell class
Standard shell class with focus policy shared by all protocol implementations. The automatic focus policy gives focus to windows automatically as they are created, while the manual policy allows a compositor to decide what to do. Change-Id: Ica71271174b30e28217e31c53f1c8dd576752c5e Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/compositor/extensions/qwaylandxdgshellv5integration.cpp')
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv5integration.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/compositor/extensions/qwaylandxdgshellv5integration.cpp b/src/compositor/extensions/qwaylandxdgshellv5integration.cpp
index 768747e44..f15b5c275 100644
--- a/src/compositor/extensions/qwaylandxdgshellv5integration.cpp
+++ b/src/compositor/extensions/qwaylandxdgshellv5integration.cpp
@@ -56,6 +56,8 @@ XdgShellV5Integration::XdgShellV5Integration(QWaylandQuickShellSurfaceItem *item
m_item->setSurface(m_xdgSurface->surface());
connect(m_xdgSurface, &QWaylandXdgSurfaceV5::startMove, this, &XdgShellV5Integration::handleStartMove);
connect(m_xdgSurface, &QWaylandXdgSurfaceV5::startResize, this, &XdgShellV5Integration::handleStartResize);
+ connect(m_xdgSurface, &QWaylandXdgSurfaceV5::setTopLevel, this, &XdgShellV5Integration::handleSetTopLevel);
+ connect(m_xdgSurface, &QWaylandXdgSurfaceV5::setTransient, this, &XdgShellV5Integration::handleSetTransient);
connect(m_xdgSurface, &QWaylandXdgSurfaceV5::setMaximized, this, &XdgShellV5Integration::handleSetMaximized);
connect(m_xdgSurface, &QWaylandXdgSurfaceV5::unsetMaximized, this, &XdgShellV5Integration::handleUnsetMaximized);
connect(m_xdgSurface, &QWaylandXdgSurfaceV5::maximizedChanged, this, &XdgShellV5Integration::handleMaximizedChanged);
@@ -124,6 +126,18 @@ void XdgShellV5Integration::handleStartResize(QWaylandSeat *seat, QWaylandXdgSur
resizeState.initialized = false;
}
+void XdgShellV5Integration::handleSetTopLevel()
+{
+ if (m_xdgSurface->shell()->focusPolicy() == QWaylandShell::AutomaticFocus)
+ m_item->takeFocus();
+}
+
+void XdgShellV5Integration::handleSetTransient()
+{
+ if (m_xdgSurface->shell()->focusPolicy() == QWaylandShell::AutomaticFocus)
+ m_item->takeFocus();
+}
+
void XdgShellV5Integration::handleSetMaximized()
{
maximizeState.initialWindowSize = m_xdgSurface->windowGeometry().size();