<request name="authenticate_with_token">
<arg name="processid" type="string" />
</request>
-
+ <event name="hints">
+ <arg name="show_is_fullscreen" type="int"/>
+ </event>
</interface>
</protocol>
m_compositor->overrideSelection(data);
}
+void WaylandCompositor::setClientFullScreenHint(bool value)
+{
+ m_compositor->setClientFullScreenHint(value);
+}
+
const char *WaylandCompositor::socketName() const
{
if (m_socket_name.isEmpty())
virtual void retainedSelectionReceived(QMimeData *mimeData);
void overrideSelection(QMimeData *data);
+ void setClientFullScreenHint(bool value);
+
const char *socketName() const;
void setScreenOrientation(Qt::ScreenOrientation orientation);
return m_output_global.geometry();
}
+void Compositor::setClientFullScreenHint(bool value)
+{
+ m_windowManagerIntegration->setShowIsFullScreen(value);
+}
+
InputDevice* Compositor::defaultInputDevice()
{
return m_default_input_device;
void setOutputGeometry(const QRect &geometry);
QRect outputGeometry() const;
+ void setClientFullScreenHint(bool value);
+
void enableTouchExtension();
TouchExtensionGlobal *touchExtension() { return m_touchExtension; }
void configureTouchExtension(int flags);
WindowManagerServerIntegration::WindowManagerServerIntegration(QObject *parent)
: QObject(parent)
+ , m_showIsFullScreen(false)
{
}
emit clientAuthenticated(client);
}
+void WindowManagerServerIntegration::setShowIsFullScreen(bool value)
+{
+ m_showIsFullScreen = value;
+ struct wl_resource *resource;
+ wl_list_for_each(resource,&client_resources, link) {
+ wl_resource_post_event(resource, WL_WINDOWMANAGER_HINTS, int32_t(m_showIsFullScreen));
+ }
+}
+
void WindowManagerServerIntegration::bind_func(struct wl_client *client, void *data,
uint32_t version, uint32_t id)
{
Q_UNUSED(version);
WindowManagerServerIntegration *win_mgr = static_cast<WindowManagerServerIntegration *>(data);
- struct wl_resource *resource = wl_client_add_object(client,&wl_windowmanager_interface,&windowmanager_interface,id,data);
+ wl_resource *resource = wl_client_add_object(client,&wl_windowmanager_interface,&windowmanager_interface,id,data);
win_mgr->registerResource(resource);
+ wl_resource_post_event(resource, WL_WINDOWMANAGER_HINTS, int32_t(win_mgr->m_showIsFullScreen));
}
WaylandManagedClient *managedClient(wl_client *client) const;
- void setScreenOrientation(wl_client *client, struct wl_resource *output_resource, Qt::ScreenOrientation orientationInDegrees);
+ void setShowIsFullScreen(bool value);
signals:
void clientAuthenticated(wl_client *client);
void authenticateWithToken(wl_client *client, const char *token);
private:
+ bool m_showIsFullScreen;
QMap<wl_client*, WaylandManagedClient*> m_managedClients;
static void bind_func(struct wl_client *client, void *data,
#include "gl_integration/qwaylandglintegration.h"
#endif
+#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
+#include "windowmanager_integration/qwaylandwindowmanagerintegration.h"
+#endif
+
QWaylandIntegration::QWaylandIntegration()
: mFontDb(new QGenericUnixFontDatabase())
, mEventDispatcher(createUnixEventDispatcher())
{
return mInputContext;
}
+
+QVariant QWaylandIntegration::styleHint(StyleHint hint) const
+{
+#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
+ if (hint == ShowIsFullScreen && mDisplay->windowManagerIntegration())
+ return mDisplay->windowManagerIntegration()->showIsFullScreen();
+#endif
+ return QPlatformIntegration::styleHint(hint);
+}
QPlatformInputContext *inputContext() const;
+ QVariant styleHint(StyleHint hint) const;
+
private:
QPlatformFontDatabase *mFontDb;
QAbstractEventDispatcher *mEventDispatcher;
{
mBuffer = buffer;
- if (window()->visible()) {
+ if (window()->isVisible()) {
wl_surface_attach(mSurface, mBuffer->buffer(),0,0);
if (buffer)
QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRect(QPoint(), geometry().size()));
return Qt::PrimaryOrientation;
}
+Qt::WindowState QWaylandWindow::setWindowState(Qt::WindowState state)
+{
+ if (state == Qt::WindowFullScreen || state == Qt::WindowMaximized) {
+ QScreen *screen = window()->screen();
+
+ QRect geometry = screen->mapBetween(window()->windowOrientation(), screen->primaryOrientation(), screen->geometry());
+ setGeometry(geometry);
+
+ QWindowSystemInterface::handleGeometryChange(window(), geometry);
+
+ return state;
+ }
+
+ return Qt::WindowNoState;
+}
+
Qt::WindowFlags QWaylandWindow::setWindowFlags(Qt::WindowFlags flags)
{
return mExtendedWindow->setWindowFlags(flags);
void handleContentOrientationChange(Qt::ScreenOrientation orientation);
Qt::ScreenOrientation requestWindowOrientation(Qt::ScreenOrientation orientation);
+ Qt::WindowState setWindowState(Qt::WindowState state);
Qt::WindowFlags setWindowFlags(Qt::WindowFlags flags);
protected:
QWaylandDisplay *m_waylandDisplay;
struct wl_windowmanager *m_waylandWindowManager;
QHash<QWindow*, QVariantMap> m_queuedProperties;
-
+ bool m_showIsFullScreen;
};
QWaylandWindowManagerIntegrationPrivate::QWaylandWindowManagerIntegrationPrivate(QWaylandDisplay *waylandDisplay)
: m_blockPropertyUpdates(false)
, m_waylandDisplay(waylandDisplay)
, m_waylandWindowManager(0)
+ , m_showIsFullScreen(false)
{
}
QWaylandWindowManagerIntegration *QWaylandWindowManagerIntegration::m_instance = 0;
-
QWaylandWindowManagerIntegration *QWaylandWindowManagerIntegration::createIntegration(QWaylandDisplay *waylandDisplay)
{
return new QWaylandWindowManagerIntegration(waylandDisplay);
return d->m_waylandWindowManager;
}
+bool QWaylandWindowManagerIntegration::showIsFullScreen() const
+{
+ Q_D(const QWaylandWindowManagerIntegration);
+ return d->m_showIsFullScreen;
+}
+
void QWaylandWindowManagerIntegration::wlHandleListenerGlobal(wl_display *display, uint32_t id, const char *interface, uint32_t version, void *data)
{
Q_UNUSED(version);
QWaylandWindowManagerIntegration *integration = static_cast<QWaylandWindowManagerIntegration *>(data);
integration->d_ptr->m_waylandWindowManager =
static_cast<struct wl_windowmanager *>(wl_display_bind(display, id, &wl_windowmanager_interface));
+ wl_windowmanager_add_listener(integration->d_ptr->m_waylandWindowManager, &windowmanager_listener, integration);
}
}
+const struct wl_windowmanager_listener QWaylandWindowManagerIntegration::windowmanager_listener = {
+ QWaylandWindowManagerIntegration::handle_hints
+};
+
+void QWaylandWindowManagerIntegration::handle_hints(void *data, wl_windowmanager *ext, int32_t showIsFullScreen)
+{
+ Q_UNUSED(ext);
+ QWaylandWindowManagerIntegration *self = static_cast<QWaylandWindowManagerIntegration *>(data);
+ self->d_func()->m_showIsFullScreen = showIsFullScreen;
+}
+
void QWaylandWindowManagerIntegration::mapClientToProcess(long long processId)
{
Q_D(QWaylandWindowManagerIntegration);
void mapClientToProcess(long long processId);
void authenticateWithToken(const QByteArray &token = QByteArray());
+ bool showIsFullScreen() const;
+
private:
static void wlHandleListenerGlobal(wl_display *display, uint32_t id,
const char *interface, uint32_t version, void *data);
QScopedPointer<QWaylandWindowManagerIntegrationPrivate> d_ptr;
static QWaylandWindowManagerIntegration *m_instance;
+ static const struct wl_windowmanager_listener windowmanager_listener;
+
+ static void handle_hints(void *data,
+ struct wl_windowmanager *ext,
+ int32_t showIsFullScreen);
+
static const struct wl_windowmanager_listener m_windowManagerListener;
};