Commit graph

4 commits

Author SHA1 Message Date
Martin Gräßlin
1350653d44 [plugins/qpa] Add support for QT_WAYLAND_FORCE_DPI env variable
Summary:
If a user specifies the QT_WAYLAND_FORCE_DPI env variable, KWin uses
it to force a logicalDPI, just like QtWayland.

Test Plan: Normally sized window decorations

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1605
2016-05-17 07:32:30 +02:00
Martin Gräßlin
51ee514227 [plugins/qpa] Add a dummy screen on startup
Qt has problems initializing everything correctly if there is no screen
at startup. E.g. the breeze widget style tries to initialize some pixmaps
and this fails. In worst case hitting asserts in Qt (debug build).

This change creates a dummy screen which gets destroyed as soon as there
is a real screen.

Reviewed-By: notmart and sebas
2016-03-10 17:02:06 +01:00
Martin Gräßlin
7d81e9cf22 [plugins/qpa] Implement a custom QPlatformCursor
This makes QCursor::pos and QCursor::setPos function correctly. KWin
actually wouldn't need it as KWin has the KWin::Cursor replacement, but
it allows Qt internal API to have it function correctly and also the
zoom effect does use QCursor::setPos.
2016-02-17 12:42:12 +01:00
Martin Gräßlin
26b3569a0b [wayland] Add a QPA plugin for kwin_wayland
This introduces an own QPA plugin for KWin. QtWayland's plugin is not
a good solution for KWin as QtWayland is meant for Wayland clients and
not for a Wayland server. Given that it makes more sense to have a very
minimal QPA plugin which supports the use cases we actually have.

With our own QPA plugin we should be able to improve the following
areas:
* no need to create Wayland server before QApplication
* Qt::BypassWindowManagerHint can be supported
* no workaround for creating OpenGL context in main thread
* sharing OpenGL context with Qt
* OpenGL context for Qt on libhybris backend

The plugin supports so far the following features:
* creating a QPlatformWindow using KWayland::Client (ShellSurface)
* creating a QPlatformBackingStore using a ShmPool
* creating a QPlatformOpenGLContext with Wayland::EGL
* or creating a QPlatformOpenGLContext which shares with KWin's scene
* creating a QPlatformScreen for each KWayland::Client::Output
* QPlatformNativeInterface compatible to QtWayland
2015-08-25 14:33:50 +02:00