summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2012-02-10 15:43:59 +0100
committerJørgen Lind <jorgen.lind@nokia.com>2012-02-10 16:04:33 +0100
commit20f10e77329651204d6c1152f45f5555f0c3ccf4 (patch)
treee8034b1d0f2fc024252548ea8e8b9dd266b5ca37 /src/plugins
parentf089f453ae6ea3766a0ec41059371f6dc81ce9df (diff)
Added window flags to the surface-extension protocol
Change-Id: I1b53c5f0b0f908490dcd0ab30e46ab681f885954 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/wayland/qwaylandextendedsurface.cpp14
-rw-r--r--src/plugins/platforms/wayland/qwaylandextendedsurface.h2
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindow.cpp5
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindow.h2
4 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandextendedsurface.cpp b/src/plugins/platforms/wayland/qwaylandextendedsurface.cpp
index 58dfac4b0..41ccdec95 100644
--- a/src/plugins/platforms/wayland/qwaylandextendedsurface.cpp
+++ b/src/plugins/platforms/wayland/qwaylandextendedsurface.cpp
@@ -162,6 +162,20 @@ void QWaylandExtendedSurface::set_generic_property(void *data, wl_extended_surfa
nativeInterface->emitWindowPropertyChanged(extended_window->m_window,QString::fromLatin1(name));
}
+Qt::WindowFlags QWaylandExtendedSurface::setWindowFlags(Qt::WindowFlags flags)
+{
+ uint wlFlags = 0;
+ if (flags & Qt::WindowStaysOnTopHint) wlFlags |= WL_EXTENDED_SURFACE_WINDOWFLAG_STAYSONTOP;
+ if (flags & Qt::WindowOverridesSystemGestures) wlFlags |= WL_EXTENDED_SURFACE_WINDOWFLAG_OVERRIDESSYSTEMGESTURES;
+
+ wl_extended_surface_set_window_flags(m_extended_surface, wlFlags);
+
+ return flags & (
+ Qt::WindowStaysOnTopHint
+ | Qt::WindowOverridesSystemGestures
+ );
+}
+
const struct wl_extended_surface_listener QWaylandExtendedSurface::extended_surface_listener = {
QWaylandExtendedSurface::onscreen_visibility,
QWaylandExtendedSurface::set_generic_property
diff --git a/src/plugins/platforms/wayland/qwaylandextendedsurface.h b/src/plugins/platforms/wayland/qwaylandextendedsurface.h
index 184fc0d47..9efb638cf 100644
--- a/src/plugins/platforms/wayland/qwaylandextendedsurface.h
+++ b/src/plugins/platforms/wayland/qwaylandextendedsurface.h
@@ -74,6 +74,8 @@ public:
QVariant property(const QString &name);
QVariant property(const QString &name, const QVariant &defaultValue);
+ Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
+
private:
QWaylandWindow *m_window;
struct wl_extended_surface *m_extended_surface;
diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp
index 2f2b78442..1142c31f3 100644
--- a/src/plugins/platforms/wayland/qwaylandwindow.cpp
+++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp
@@ -221,3 +221,8 @@ Qt::ScreenOrientation QWaylandWindow::requestWindowOrientation(Qt::ScreenOrienta
return Qt::PrimaryOrientation;
}
+
+Qt::WindowFlags QWaylandWindow::setWindowFlags(Qt::WindowFlags flags)
+{
+ return mExtendedWindow->setWindowFlags(flags);
+}
diff --git a/src/plugins/platforms/wayland/qwaylandwindow.h b/src/plugins/platforms/wayland/qwaylandwindow.h
index d102f4e6e..b67e11d54 100644
--- a/src/plugins/platforms/wayland/qwaylandwindow.h
+++ b/src/plugins/platforms/wayland/qwaylandwindow.h
@@ -88,6 +88,8 @@ public:
void handleContentOrientationChange(Qt::ScreenOrientation orientation);
Qt::ScreenOrientation requestWindowOrientation(Qt::ScreenOrientation orientation);
+ Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
+
protected:
QWaylandDisplay *mDisplay;
struct wl_surface *mSurface;