Commit graph

58 commits

Author SHA1 Message Date
Martin Gräßlin
f5b83d18b8 [platforms/drm] Apply new global position on DrmOutput for a changeset
Summary:
When we get a configuration request, we also need to update the global
position on the DrmOutput, otherwise Wayland will know about the new
position, but KWin internally does not.

In addition we also need to trigger the changed signal on KWin::Screens,
so that internally code can react on the change.

With this change configuring layout of connected screens in KScreen
does work also in KWin.

Reviewers: #kwin, #plasma_on_wayland, sebas

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D1858
2016-06-14 13:42:25 +02:00
Martin Gräßlin
2b196bfa29 Move the loadTexture for X11 pixmap functionality to the EglOnXBackend
Summary:
To use eglCreateImageKhr for an X11 pixmap we need an EGLDisplay created
for the same XDisplay as the X11 pixmap. This means if we created an
EGLDisplay for a GBM device, we are not allowed to load a texture from
the X11 pixmap and can result in a crash in the driver.

Similar in the nested X11 setup the EGLDisplay is created for the
rendering window, but the X11 pixmaps are from the Xwayland server KWin
started. They don't belong to the same windowing system.

This change addresses this problem by moving the loading of X11 pixmaps
from AbstractEglTexture to EglTexture of the EglOnX11Backend. Thus for
any usage on a non X11 platform we cannot hit the code path any more.
In addition the nested X11 platform can indicate that it doesn't support
it and thus also doesn't go through the code path.

Test Plan: Tested standalone and nested X11 platform

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D1857
2016-06-14 09:10:09 +02:00
David Fort
935f8875fe [drm] correctly initialize the second cursor
Summary: There were a trivial copy'n paste error.

Reviewers: graesslin

Reviewed By: graesslin

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D1806
2016-06-09 17:00:07 +02:00
Martin Gräßlin
5344bf1619 [plugins/qpa] Handle case that qtvirtualkeyboard plugin is not available more gracefully
We didn't check whether creating the QPlatfromInputContext worked and
accessed the m_inputContext unconditionally which obviously crashed.

Now the connects related to QInputMethods are not setup if we failed
to create the QPlatfromInputContext.

Reviewed-By: bshah
2016-06-02 15:25:31 +02:00
Martin Gräßlin
f26f2fe181 Integrate QtVirtualKeyboard into KWin/Wayland
Summary:
The idea is to have KWin provide a virtual keyboard. To support this
KWin uses the QT_IM_MODULE qtvirtualkeyboard and makes sure that the
QPA plugin loads it.

KWin has a new class VirtualKeyboard which acts as the focus object and
the "proxy" for input methods. The QPA plugin ensures that this is the
focusObject, so that all input method related events are sent to this
class. From there it will be possible to delegate to other applications
through the Wayland interfaces.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1638
2016-06-02 11:26:53 +02:00
Martin Gräßlin
d0a6aa0836 [platforms/virtual] Support setting random screen geometries
A signal is added to the VirtualBackend to change all screen geometries.
This can be used from auto tests to change the screens. But it's not yet
correctly reflected in other areas. E.g. not forwarded to Wayland Output,
etc.
2016-06-02 09:28:02 +02:00
l10n daemon script
0990566c63 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-05-31 11:06:54 +00:00
Martin Gräßlin
b5b2adc5a2 [platforms/drm] Only show cursor if a pointer device is available
Summary:
When the pointer device gets plugged off the cursor is hidden, when
a pointer device gets plugged in the cursor is shown again.

This allows to easily turn a tablet into a proper system by showing
the cursor only when it makes sense.

Test Plan: Tested on exopc with external mouse

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1682
2016-05-25 12:14:00 +02:00
Martin Gräßlin
7c822fadee Move the OpenGL unsafe check into the Platform
Summary:
A new virtual method createOpenGLSafePoint is added to Platform.
This is invoked through the Compositor with a PreInit and a PostInit
argument pre and post creating the SceneOpenGL.

The Platform plugin can implement this and use it for detecting whether
creating the OpenGL compositor on this platform crashed in the past.
Thus it's the base for the openGLIsBroken platform check.

The x11 standalone plugin is the first to implement this functionality
using the previous code which was designed for X11.

This also means that a crash of the OpenGL compositor during init on
Wayland won't result in OpenGL being disabled.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1582
2016-05-17 14:29:29 +02:00
Martin Gräßlin
48e69b77d9 If glx is not available try to create egl backend
Summary:
So far the OpenGL is unsafe check functionality in Compositor disabled
OpenGL compositing if glx is not available and we are in standalone X11
mode.

This is technically no longer correct for quite some time. Just because
GLX is not available doesn't mean that OpenGL doesn't work. We have an
EGL backend. So let's try to use that if glx is not available.

This change removes the check completely from Compositor. Instead the
standalone x11 plugin checks whether glx is available prior to createing
the glx backend. If not available it falls through to the egl backend.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1581
2016-05-17 14:25:33 +02:00
Martin Gräßlin
d15d3a5ff1 Provide functionality of CompositingPrefs through Platform
Summary:
CompositingPrefs is only relevant for X11 standalone. It had some
"hacks" to make it not block Compositing on Wayland. Thus it was in
its current form not really useful.

Now all the functionality is provided through Platform with a default
implementation which is sensible for Wayland platforms.

The X11 standalone platform implements the new methods with the
Wayland checks removed.

In addition all calls to CompositingPrefs now go through the platform
directly and CompositingPrefs is completely dropped.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1576
2016-05-17 13:59:52 +02:00
Martin Gräßlin
c45942a70c Move requiresCompositing from Application to Platform
Summary:
This change reduces the windowing system specific code pathes. Instead
of checking whether we are on X11 or Wayland to decide whether
compositing is required, we just ask the Platform.

The default is true, only x11 standalone allows to not require
compositing.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1575
2016-05-17 13:59:32 +02:00
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
8d7d51e4ef Merge branch 'Plasma/5.6'
dont_crash_aurorae_destroy_deco.cpp is adjusted to Platform.
2016-05-12 16:43:12 +02:00
Sebastian Kügler
8e36d9c8e1 add override to bufferForScreen
Summary: This seems to just have been forgotten here.

Test Plan: Builds

Reviewers: graesslin

Reviewed By: graesslin

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1499
2016-05-02 14:50:23 +02:00
Martin Gräßlin
64f7de4024 [platforms/hwcomposer] Remove integration with VirtualTerminal
The hwcomposer plugin doesn't need it. It was only created for the
need of libinput relying on it. As libinput doesn't need it any more,
hwcomposer doesn't need to integrate with VirtualTerminal.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1444
2016-04-22 14:18:56 +02:00
Martin Gräßlin
2ecd097e87 [plugins/drm] Drop dependency on VirtualTerminal
Only integrates with Logind to find out when the session is active.
2016-04-22 14:18:56 +02:00
l10n daemon script
21f246c279 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-04-21 10:02:53 +00:00
l10n daemon script
93034e04cf SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-04-20 09:37:30 +00:00
Martin Gräßlin
e73a86d420 Create screen edge through the Platform
Removes a diversion between X11 and Wayland. The base class Platform
creates an instance of class Edge with plugin implementations being
able to create a different type.

The X11StandalonePlugin does that and creates a WindowBasedEdge. For
this the implementation of WindowBasedEdge is moved from screenedges
into the plugin.

Unfortunately an ifdef is needed to make the screenedge test still
work as expected. This should be improved in future, e.g. have a good
way to load the platform plugin from the tests.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1419
2016-04-19 13:29:55 +02:00
l10n daemon script
1309b8c8a0 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-04-16 09:59:16 +00:00
Martin Gräßlin
e4c333a372 Move clients/ to plugins/kdecorations/
Summary:
KWin's plugins are now all in a plugins subdirectory. This is a good
argument to also move the window decoration plugins there. The name
clients was not really good anyway and makes it difficult for people
not familiar with the code base to find it. Having it under plugins
is the more expectable location.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1414
2016-04-15 15:21:03 +02:00
Martin Gräßlin
702b84b925 Move the EglOnXBackend to the x11 platforms
Summary:
The EglOnXBackend is no longer needed in the core. It's only needed by
the two x11 platform plugins. To best share it, it's moved into a common
directory and compiled into a static library which in turn is linked by
the two plugins.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1413
2016-04-15 09:15:20 +02:00
Martin Gräßlin
248991223b Move glxbackend to x11 standalone plugin
Summary:
It's only needed by the standalone x11 variant. This allows us to
simplify the creation of the OpenGLBackend: it's created by the
platform plugin - we don't need custom complex logic.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1392
2016-04-15 07:46:02 +02:00
l10n daemon script
a3cd28a87e SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-04-14 09:57:09 +00:00
Martin Gräßlin
b4b0b100df [plugins/platforms/drm] Fix includes
Incorrect includes resulted in build without GBM to fail.
2016-04-13 14:10:25 +02:00
l10n daemon script
9a10eabc11 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-04-13 09:34:52 +00:00
Martin Gräßlin
e5648dcf4c [plugins/platforms] Dedicated logging category for X11 standalone platform 2016-04-12 14:48:54 +02:00
l10n daemon script
11cca79ecf SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-04-12 11:13:09 +00:00
Martin Gräßlin
18939e17ed Move XRandrScreens to the x11/standalone plugin
By moving XRandrScreens the creation of screens gets simplified a lot
as there is no need to have windowing system specific init code. It all
just goes through the platform.

This also marks the point where the first X11 specific code is removed
from kwin_wayland.

Reviewers: #plasma, sebas

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1355
2016-04-12 08:04:16 +02:00
Martin Gräßlin
ee89f3f34f Add a very basic x11/standalone platform plugin
The plugin does not much. It's the most basic plugin we can have to
be loaded from kwin_x11.

Unlike the wayland platform plugins it gets installed to:
org.kde.kwin.platforms
2016-04-12 08:04:16 +02:00
Martin Gräßlin
33dffc0fd7 Move the x11 plugin sources into a x11/windowed directory
Preparation step for having two x11 backends: the windowed for Wayland
and a standalone for kwin_x11.
2016-04-12 08:04:16 +02:00
Martin Gräßlin
2bff90976e Move backends/ to plugins/platforms/
Summary:
Source code reorganization:
The base class AbstractBackend got renamed to Platform, thus the
"backends" are "platforms" now. As they are plugins they should go
together with other KWin plugins which are nowadays in the folder
plugins.

So new location is plugins/platforms/

Reviewers: #plasma, sebas

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1353
2016-04-12 08:01:27 +02:00
Martin Gräßlin
d31e9e88b4 Rename abstract_backend.(h|cpp) to platform.(h|cpp)
Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1340
2016-04-07 16:18:12 +02:00
Martin Gräßlin
146af48f22 waylandServer()->backend() replaced by kwinApp()->platform() 2016-04-07 15:00:11 +02:00
Martin Gräßlin
fe745177e0 [plugins/qpa] Add a roundtrip platform function
Summary:
Mostly intended for plugins loaded into KWin and wanting to use
KWayland::Client::ConnectionThread::roundtrip(). By providing this
function we can ensure that KWin does not block and nevertheless
perform the required roundtrip.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1153
2016-03-16 11:10:14 +01:00
Martin Gräßlin
68683873e3 [plugins/qpa] Fix build with Qt 5.4
PlatformIntegration::destroyScreen got added in 5.5.
2016-03-11 10:02:16 +01: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
7d08b08470 [plugins/qpa] Adjust to changes in Qt 5.7 QPA interface
BUG: 360269
2016-03-09 17:15:15 +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
Oleg Chernovskiy
61e1a98fb7 Maintenance - fixing naming typos
Fix typos in signal naming var
Fix typo in KWin QPA environment variable
2016-02-09 17:20:12 +01:00
Martin Gräßlin
ed3f55b953 [wayland] Fix heap-use-after-free in idle time plugin
We need to also destroy all idle objects when we tear down the
internal client connection. Otherwise the cleanup tries to free
the object after our Wayland connection is already destroyed.
2016-02-02 12:00:12 +01:00
Martin Gräßlin
6c746764b4 [plugins/qpa] Safety checks in native interface
During startup it might happen that the QPA is already loaded, but
the wayland server and it's internal connection not yet fully
created. Thus safety check for it.
2015-12-18 15:27:47 +01:00
Martin Gräßlin
d89777bcac Make Wayland::EGL optional again
This is needed to make KWin build-able on non-Linux, but is actually
only a workaround. The dependency should also be available on non-Linux.

This disables the EGL integration in the Wayland backend (QPainter still
available) and the EGL fallback in the qpa plugin (preferred context
sharing still available, but requires a working OpenGL Scene).

REVIEW: 126202
2015-12-01 07:58:47 +01:00
Martin Gräßlin
b383db2e2e Create robust egl context if possible 2015-11-16 09:08:14 +01:00
Martin Gräßlin
8175562a7a [wayland] Fix cleanup handling on tear down
ASAN righly complained: we need to delete our Wayland objects before
we destroy the internal client connection. Solved by better setting
parent relationships in the QPA plugin and correctly delete objects
in destroy of internal client connection.
2015-11-10 11:35:00 +01:00
Martin Gräßlin
1998d5ac1a [wayland] Improve tear-down to not crash if X11 applications are still around
We need to destroy the compositor after Xwayland terminated and after
the internal Wayland connection is destroyed. This means when destroying
the Workspace we may no longer destroy the Compositor at the same time.
Also we need to ensure that other tear down functionality doesn't call
into the no longer existing internal client connection.

With this change kwin doesn't crash when exiting with Wayland and/or
X11 windows still open.
2015-11-10 08:56:32 +01:00
Martin Gräßlin
a8ff9d39a7 Add a plugin for KIdleTime
Basically a simplified fork from kwayland-integration.

We cannot use the idletime plugin from kwayland-integration as it
a) doesn't react on our own qpa plugin name
b) performs blocking roundtrips in the main thread -> freeze

This simplifies by using our internal registry and we don't even check
whether Seat and Idle are announced: we know they are.

Reviewed-By: Bhushan Shah
2015-11-06 13:51:48 +01:00
Martin Gräßlin
f2ad98aa3a Add O2ES as possible value for KWIN_COMPOSE
If KWIN_COMPOSE is set to O2ES, an OpenGL ES context is tried to
be created instead of an OpenGL context.

REVIEW: 125919
2015-11-03 09:30:12 +01:00
Martin Gräßlin
2f065b9c6b [plugins/qpa] Runtime depend on OpenGLES instead of compile time
Using QOpenGLContext::openGLModuleType() to determine whether we
need a GLES or GL context.
2015-11-03 09:29:31 +01:00