Commit graph

14662 commits

Author SHA1 Message Date
Martin Gräßlin
4cdb078376 [autotest/libkwineffects] Add more test data for glplatformtest 2016-08-09 08:40:37 +02:00
Martin Gräßlin
1e13c5ad8f [autotests/libkwineffects] Test GLPlatform::driverToString and chipClassToString 2016-08-09 08:30:09 +02:00
Martin Gräßlin
0778cab42d [autotest/libkwineffects] Add more test data for the glplatform test
Example data harvested from bugs.kde.org: open bugs against kwin with
a comment containing supportInformation.

We can see that especially detecting modern radeon gpus is not working.
2016-08-08 17:40:04 +02:00
Martin Gräßlin
a79dc5585a [libkwineffects] Fix includes in kwingltexture.h
The header used GL types like GLenum without including gl through
epoxy.
2016-08-08 15:46:25 +02:00
Martin Gräßlin
14730d1f7c [wayland] Place transient windows every time they are shown
The parent window might have moved, they should always be placed
according to their placement hint.

Reviewed-By: bshah
2016-08-08 14:55:26 +02:00
Martin Gräßlin
981b312323 [Wayland] Make it possible to have internal windows decorated
Summary:
With this change KWin can create window decorations for internal windows.
Thus it's also possible to move internal windows and resize them which is
especially important for the debug console.

Reviewers: #kwin, #plasma_on_wayland, sebas

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2371
2016-08-08 14:00:32 +02:00
Martin Gräßlin
18397c1028 Merge branch 'Plasma/5.7' 2016-08-08 13:39:54 +02:00
Martin Gräßlin
921e27257c [wayland] Ensure that pointer enter event carries the correct coordinates
So far KWin's pointer surface enter handling was:
1. update fouced surface
2. update the global position

On client side this resulted in:
1. Enter with incorrect coordinates
2. move event to correct coordinate

With QtWayland this results in the case of multiple surfaces in one
application that Qt doesn't properly process the enter event and the
Window never getting pointer focus and not reacting on any pointer
input events.

The root problem is that the KWayland server API is not ideal for
supporting this situation. There is an API call for setting the global
position (which causes a pointer motion for the focused surface) and
an API call to update the focused surface. But a combination for both
is (still) missing.

This change addresses the problem by first unsetting the entered surface,
then updating the global position and afterwards setting the new surface.
Thus the position is correct. While this needs to be made better in
KWayland, this is an urgency bug fix to get the behavior correct and thus
first working around the API deficit and not first extending in KWayland.

Reviewed-By: bshah
2016-08-08 13:38:43 +02:00
Martin Gräßlin
f31989f701 [autotest/intergration] Wait for pointer enter before simulating button press
The test LockScreenTest::testPointerButton and testPointerAxis both
fail on Neon's CI infrastructure. In order to make the test more reliable
the tests first wait for the pointer enter after unlock before simulating
another button press.
2016-08-08 13:38:02 +02:00
Martin Gräßlin
a1490905e9 [autotest/intergration] Wait for pointer enter before simulating button press
The test LockScreenTest::testPointerButton and testPointerAxis both
fail on Neon's CI infrastructure. In order to make the test more reliable
the tests first wait for the pointer enter after unlock before simulating
another button press.
2016-08-08 11:12:22 +02:00
Martin Gräßlin
23bfa05f46 [autotests/integration] Try hardening destroyWaylandConnection
Destroying the connection is threaded. Only wait if the signal was
not already caught.
2016-08-08 10:11:31 +02:00
Martin Gräßlin
a902ba8ea3 [platforms/x11] Support output removal in nested setup
Summary:
When closing a nested window kwin_wayland only terminates if the closed
window is the last output window. In a simulated multi-screen setup
closing a window results in the output being removed.

Test Plan: Closed windows, verified with xrandr

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2234
2016-08-08 09:24:44 +02:00
Martin Gräßlin
e88a709f03 Raise minimum libinput version to 1.2
Now provided on build.kde.org, thus let's properly depend on it and
remove the ifdef.
2016-08-08 09:18:39 +02:00
Martin Gräßlin
8a83a6fef5 [libinput] Add support for gesture events
Summary:
Gesture events are swipe or pinch events on a touch pad.

This change implements basic support by:
 * wrapping them in LibInput::Event
 * processing them in LibInput::Connection and emitting
   dedicated signals
 * Forwarding them in InputRedirection to PointerInputRedirection
 * Support them in the internal input event filter
 * Printing debug information in DebugConsole

Further handling is not yet done. In future the following should be
implemented:
 * activating e.g. zoom and present windows on pinch/swipe gesture
 * forwarding non global gestures to KWayland

Note that forwarding to KWayland is not yet useful as QtWayland does
not yet have support for the unstable protocol. No Qt application could
make use of it yet. So for the moment just global gestures is the best
we can get.

Test Plan: Looked at output of DebugConsole when triggering gestures

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2359
2016-08-08 09:15:06 +02:00
l10n daemon script
88bd746694 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-08-06 12:43:39 +00:00
l10n daemon script
50571b7921 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-08-06 10:02:15 +00:00
Martin Gräßlin
44e37aacdf Set initial count of screens before calling Screens::init
Screens::init sets up a Qt::QueuedConnection connect from countChanged
to changed. This means that when first setting up the connection a
changed signal will be delivered in the next event cycle. This can mess
with other code. E.g. WaylandServer recreating outputs which can make
Xwayland crash or KWin internally crash.

To solve this problem we just need to make sure to set the output count
to the initial value before performing the init.

Reviewed-By: bshah
2016-08-05 09:59:22 +02:00
Martin Gräßlin
31790dc00c [autotest] Introduce a test infrastructure for GLPlatform
The new test can load "profiles" from kconfig files in the test data.
Based on that the glGetString return values are mocked and GLPlatform
can perform detect without having to interact with a real GL library.

That way we can verify that the detect code works correctly. As a first
test the settings of one Intel/IvyBridge is included. More tests can be
added easily (e.g. looking at various supportInformation output in
bugs.kde.org). Also this allows to more easily add detect code for GPUs
we do not know yet. And to simulate conditions where the detect code
failed resulting in no compositing at all.
2016-08-05 08:47:32 +02:00
Martin Gräßlin
c61ed2b79f [libkwineffects] Cleanup includes of GLPlatform
Only include what's actually needed. Allows to use it stand alone (e.g.
for auto tests).
2016-08-05 08:46:38 +02:00
Martin Gräßlin
8cca80e510 [libkwineffects] Initialize all variables in GLPlatform
Ensures that a usage before calling detect doesn't return nonesense
values.
2016-08-04 17:10:46 +02:00
Martin Gräßlin
996ee34e14 Remove the unredirect fullscreen windows functionality
Summary:
Rational: unredirect fullscreen windows is a weird beast. It's intended
to make fullscreen windows "faster" by not compositing that screen. But
that doesn't really work as KWin jumps out of that condition pretty
quickly. E.g. whenever a tooltip window is shown. KWin itself has a
better functionality by supporting to block compositing completely.
The complete code was full of hacks around it to try to ensure that
things don't break.

Overall unredirect fullscreen has always been the odd one. We had it
because a compositor needs to have it, but it never got truly integrated.
E.g. effects don't interact with it properly so that some things randomly
work, others don't. Will it trigger the screenedge, probably yes, but
will it show the highlight: properly no.

By removing the functionality we finally acknowledge that this mode is
not maintained and has not been maintained for years and that we do not
intend to support it better in future. Over the years we tried to make
it more and more hidden: it's disabled for Intel GPUs, because it used
to crash KWin. It's marked as an "expert" option, etc.

It's clearly something we tried to hide from the user that it exists.

For Wayland the whole unredirect infrastructure doesn't make sense
either. There is no such thing as "unredirecting". We might make use
of passing buffers directly to the underlying stack, but that will be
done automatically when we know it can be done, not by some magic is
this a window of specific size.

Test Plan:
Compiles, cannot really test as I am an Intel user who never
had that working.

Reviewers: #kwin, #plasma, #vdg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2180
2016-08-04 14:48:35 +02:00
Martin Gräßlin
f0dc01b352 [wayland] Ensure that pointer enter event carries the correct coordinates
So far KWin's pointer surface enter handling was:
1. update fouced surface
2. update the global position

On client side this resulted in:
1. Enter with incorrect coordinates
2. move event to correct coordinate

With QtWayland this results in the case of multiple surfaces in one
application that Qt doesn't properly process the enter event and the
Window never getting pointer focus and not reacting on any pointer
input events.

The root problem is that the KWayland server API is not ideal for
supporting this situation. There is an API call for setting the global
position (which causes a pointer motion for the focused surface) and
an API call to update the focused surface. But a combination for both
is (still) missing.

This change addresses the problem by first unsetting the entered surface,
then updating the global position and afterwards setting the new surface.
Thus the position is correct. While this needs to be made better in
KWayland, this is an urgency bug fix to get the behavior correct and thus
first working around the API deficit and not first extending in KWayland.

Reviewed-By: bshah
2016-08-04 11:13:52 +02:00
Martin Gräßlin
b1f6d4b8ba [platforms/x11-windows] Delay x11 event processing till Workspace is started
If the event processing is started before everything is fully started
it can happen that we have "evil" events which may crash either Xwayland
or KWin itself. E.g. if the nested window is too large, the window
manager on the host X-Server will request a resize. If the backend does
that it can happen that the wl_output gets destroyed while Xwayland tries
to bind to it and will crash. Thus let's delay all events till we are
ready to process them.
2016-08-03 17:24:37 +02:00
Martin Gräßlin
671740dc70 Ensure that EffectsHandlerImpl::slotClientShown is only invoked once per Window
Summary:
This fixes a regression introduced with a1afeded6a.
The connections were setup every the windowShown signal got emitted.
This caused effects to get multiple singals and start multiple animations
which then do not get cancelled correctly.

The incorrect behavior was most visible in the translucency effect which
did not cancel the move animation and the window stayed translucent.

BUG: 366081

Test Plan:
New test case which simulates the behavior of the translucency
effect.

Reviewers: #kwin, #plasma, sebas

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2346
2016-08-03 16:16:00 +02:00
Martin Gräßlin
4c6c4e6717 [wayland] Always have a keyboard on the Seat
Summary:
This is a workaround for QTBUG-54371 resulting in QtWayland never
requesting the input methods panel without having keyboard focus.
Thus also the virtual keyboard is not working.

With this change we go back to always announcing a keyboard and
binding the virtual keyboard to whether we don't have an alpha-numeric
keyboard instead of whether there is a keyboard on the seat.

Reviewers: #kwin, #plasma_on_wayland, bshah

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2343
2016-08-03 11:27:00 +02:00
Martin Gräßlin
6a6af0e8b5 [libinput] Add optional device detection for cap tablet tool
The capability tablet tool is new in Libinput 1.2. As build.kde.org
does not yet support this version, it's only an optional check.

So far the code only detects whether the capability exists and reports
this accordingly.
2016-08-03 09:31:47 +02:00
Jonathan Riddell
4630d9da2c Update version number for 5.7.3
GIT_SILENT
2016-08-02 10:24:32 +01:00
Martin Gräßlin
17abac9db3 [autotest/integration] Add a test case for screenedge usage in Scripts
A new sub-directory scripting is added in autotests/integration to
gather all test cases related to scripting.

The first added test case verifies the activation of screen edges. For
that it loads a helper script, which reserves an edge based on config.
When the edge is triggered showing desktop is activated.
2016-08-02 09:12:57 +02:00
l10n daemon script
0c69ca69ce 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-07-28 13:13:42 +00:00
l10n daemon script
4578eab797 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-07-28 09:56:48 +00:00
l10n daemon script
97e4b852e5 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-07-25 13:28:09 +00:00
l10n daemon script
81961f65c6 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-07-25 09:56:15 +00:00
l10n daemon script
e511f26782 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-07-23 13:39:58 +00:00
l10n daemon script
e3921a9a53 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-07-23 10:25:57 +00:00
l10n daemon script
710b5fb068 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-07-21 13:28:46 +00:00
l10n daemon script
aa3691b831 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-07-21 10:07:48 +00:00
Martin Gräßlin
ace506b5ca [platforms/x11] Fix init of EGL/X11
Incorrect variable naming.
2016-07-21 09:42:01 +02:00
Martin Gräßlin
56ce6689fd [platforms/virtual] Use rendernode or vgem device if available for egl
Summary:
The egl implementation for the virtual platform tries to use a render
node if available. If there is no render node it looks for a virtual
(kernel driver vgem) device, which unfortunately does not create a
render node in mainline kernel (there are patches in ChromiumOS).

For this the Udev wrapper is extended to search for renderNode devices
and for virtual dri devices.

If either render node or vgem dri device is found, it is tried to be
opened (without logind escalation) and on success a gbm device is
created on it. If any step of this fails the so far default behavior
of default device is tried for creating the EGLDisplay.

All of this is compile optional, so that the virtual platform does not
hard depend on udev and/or gbm.

Test Plan:
Auto tests which need OpenGL executed and verified that they
use the render node or vgem device.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2216
2016-07-21 09:13:57 +02:00
Martin Gräßlin
0286882b3f Handle restart of Compositor Scene correctly for Wayland client
Summary:
This change ensures that KWin doesn't crash in the QPainter scene if
the compositor gets restarted and if there are Wayland clients.

Cherry-picked from master

BUG: 365471
FIXED-IN: 5.7.3

Test Plan:
Test case added to scene qpainter which triggers a restart
of the Compositor with a window being shown. Verifies that rendering
is correct afterwards.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2185
2016-07-21 08:13:27 +02:00
Martin Gräßlin
3308f35984 Handle restart of Compositor Scene correctly for Wayland client
Summary:
This change ensures that KWin doesn't crash in the QPainter scene if
the compositor gets restarted and if there are Wayland clients.

BUG: 365471

Test Plan:
Test case added to scene qpainter which triggers a restart
of the Compositor with a window being shown. Verifies that rendering
is correct afterwards.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2185
2016-07-21 08:11:32 +02:00
Martin Gräßlin
904b18a421 Merge branch 'Plasma/5.7' 2016-07-20 14:44:21 +02:00
Martin Gräßlin
4d5d7a6d7e [autotests/integration] Fix PointerInputTest::testUpdateFocusAfterScreenChange
Change the way how a screen is removed. This ensures that Xwayland
doesn't die.
2016-07-20 14:42:22 +02:00
Martin Gräßlin
50645e8dbd [platforms/x11] Properly reposition nested windows on resize events
Summary:
The position of the output being resized was adjusted instead of only
the other outputs.

Test Plan: Resized windows, verified xrandr

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2235
2016-07-20 14:17:50 +02:00
Martin Gräßlin
44843f462f [plugins/qpa] Support SharingPlatformContext on the existing eglSurface and eglconfig
Summary:
So far SharingPlatformContext was only used if the OpenGL context
supports EGL_KHR_surfaceless_context. If not supported, KWin tried to
create a context through the Wayland API. Unfortunately on hwcomposer
platform this results in a crash as libhybris only supports the init
of EGLDisplay for one native platform.

This change tries to also use the SharingPlatformContext if there is
an OpenGL context in general. It reuses the native EGLSurface created
for the compositing scene and makes its own OpenGL context current on
that surface, too. As KWin creates an FBO, it never renders to it, so
it shouldn't matter at all.

In order to prevent EGL_BAD_MATCH errors when making Qt's OpenGL context
current also the EGLConfig from the scene is used to create the context.

Test Plan: Tested on Nexus5 with qtvirtualkeyboard in KWin

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2231
2016-07-20 14:17:11 +02:00
Martin Gräßlin
9d7ef58b2b Support restarting the OpenGL compositor on Wayland
Summary:
KWin needs to support restarting the OpenGL compositor in case of a
graphics reset event.

On Wayland the tricky part is that the applications should not notice
this. Most importantly KWin cannot just destroy the EGLDisplay and create
a new one. But this is how a restart works: the complete compositor gets
torn down and recreated - including the EGLDisplay.

This change moves ownership of the EGLDisplay to the Platform.
The AbstractEglBackend subclasses query the Platform whether there is
already an EGLDisplay. Only if there is no EGLDisplay the EGLDisplay is
created and only if no EGLDisplay is registered with Wayland the bind
is performed.

Another change is regarding the destruction: the AbstractEglDisplay does
no longer unbind the Wayland display and does no longer destroy the
EGLDisplay. The EGLDisplay is destroyed by the Platform - so very late
on application exit. The Wayland display is unbound when the Compositor
terminates.

Test Plan:
Limited testing with the added auto-test. This one needs to
be extended to fully verify that OpenGL applications continue to work.
But this requires build.kde.org to support OpenGL on Wayland.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2202
2016-07-20 14:08:23 +02:00
Martin Gräßlin
d0c488f4a2 Announce output changes to Wayland for platforms not handling outputs
Summary:
Most platforms like the nested and virtual do not handle the outputs
themselves and WaylandServer announces the Outputs to Wayland.

So far this was static: at startup it got announced once to Wayland
and any changes were not catched.

This change makes WaylandServer listen to changes to the Screens and
sync them to Wayland.

Unfortunately KWin's internal Screen information is not sufficient to
properly synchronize this to Wayland and also Wayland by not supporting
adding/removing modes does not help.

Thus the solution implemented here is to add new outputs reflecting the
changes and then removing the old ones. This creates situations with more
outputs being present than actually there, but prevents that there are
no outputs at all.

Test Plan: Auto test added which verifies this for the virtual platform

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2233
2016-07-20 13:53:02 +02:00
Martin Gräßlin
a95be71ec1 [plugins/hwcomposer] Use an RGBA_8888 format for rendering surface
Summary:
When sharing surface and config used by the compositor scene with
QtQuick's OpenGL context an RGBA surface makes Qt way more happy.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2232
2016-07-20 13:51:46 +02:00
Martin Gräßlin
8445008e85 Expose window geometry to PlasmaWindow
Summary: Needed for e.g. the pager.

Test Plan: Test case for PlasmaWindow verifies the geometry

Reviewers: #kwin, #plasma_on_wayland, hein

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2200
2016-07-20 13:49:10 +02:00
Martin Gräßlin
bec69b5705 [platforms/wayland] Use XdgShell if available and prefer it
Summary:
With this change the Wayland platform plugin uses the XdgShell to
create the window if available. This allows to close the window and
thus quit the nested kwin_wayland properly.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2201
2016-07-20 07:43:59 +02:00
Martin Gräßlin
d52944c2c7 [kcmkwin/compositing] Remove combobox to select between GLX and EGL
Summary:
The selection of whether GLX or EGL should be used doesn't work in
practice due to the following reasons:
* Intel/EGL/X11 results in rendering errors
* NVIDIA still doesn't support EGL
* OpenGLES forces to EGL (combobox only one entry)
* Wayland forces to EGL (combobox only one entry)

Offering the selection only offers the user a way to destroy the
system. We get too many bug reports about rendering errors and we
get too many complaints about this not working properly on social
media. E.g.: "The Meh: EGL mode causes bugs in the launcher"

The configuration interface showed a warning when selecting it, but
apparently users ignore warnings like "might be broken". If that's the
case let's better remove the option.

If users really want this they can still enable it manually through
editing the config file or through the env variable.

Change intended for Plasma/5.7 branch - I'm sick of users complaining
about it!

Test Plan: Opened KCM, verified Combobox is gone

Reviewers: #kwin, #plasma, #vdg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2224
2016-07-19 17:10:24 +02:00