Commit graph

332 commits

Author SHA1 Message Date
Martin Gräßlin
0eecb202e2 [autotests/integration] Try to fix InternalWindowTest::testKeyboard
It fails on build.kde.org, but failing condition is not reproducable
locally.
2016-08-16 11:10:26 +02:00
Martin Gräßlin
06d562a5ba Block modifier only shortcuts when screen is/gets locked
If the screen is locked the modifier only shortcuts should not trigger.
Also if the screen gets locked while a modifier is hold the shortcuts
should not trigger.

Reviewed-By: bshah
2016-08-16 10:32:29 +02:00
Martin Gräßlin
ca50a24728 [autotests/integration] Add ScreenLockerWatcher to the Test::lockScreen and ::unlockScreen
This extends the test helper for locking the screen and unlocking the
screen to also wait for the ScreenLockerWatcher to have that state.

This is going to fail on build.kde.org as we don't have EGL there and
the greeter crashes. This needs an extension to fake that we have a
screen lock window.
2016-08-16 10:23:37 +02:00
Martin Gräßlin
440d49da00 [autotests/integration] Test case for screen locked with mod-only-shortcuts
Currently expected failures as modifier only shortcuts don't check
for locked screen yet.
2016-08-16 08:19:45 +02:00
Martin Gräßlin
4651aa1d79 [wayland] Unset focused keyboard surface when handling key event internally
Summary:
So far when KWin intercepted a key event a leave was not sent to the
Wayland surface currently having keyboard focus. This could result in
the Wayland application to start repeating keys. E.g.

1. application gets key press event
2. This triggers an internal window to show
3. key release goes to KWin internal window
4. application starts to repeat key as there is no release

With this change whenever KWin intercepts the key event e.g. due to
 * internal window
 * Effects grabbing key event
 * Tabbox

the focused keyboard surface is set to null, thus triggering a leave
event and the client not starting to repeat the event.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2402
2016-08-16 07:40:59 +02:00
Martin Gräßlin
142aab2e24 Introduce an EffectsHandler::animationsSupported -> bool
Summary:
A new method to tell the effects system whether the compositor scene
is able to drive animations. E.g. on software emulation (llvmpipe) it's
better to not do any animations at all.

This information can be used by effects to adjust their behavior, e.g.
PresentWindows could skip transitions or effects can use it in their
supported check to completely disable themselves.

As a first step all scripted effects are considered to be unsupported
if animations are not supported. They inherit AnimationEffect and are
all about driving animations.

The information whether animations are supported comes from the Scene.
It's implemented in the following way:
 * XRender: animations are always supported
 * QPainter: animations are never supported
 * OpenGL: animations are supported, except for software emulation

In addition - for easier testing - there is a new env variable
KWIN_EFFECTS_FORCE_ANIMATIONS to overwrite the selection.

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2386
2016-08-15 17:38:33 +02:00
Martin Gräßlin
bfb2094c0a [autotests/integration] Fix TestLibinputDevice::testName
sysName may not be empty. Set a different name.
2016-08-15 17:21:45 +02:00
Martin Gräßlin
a9ac2739f7 [autotests/libinput] Set a valid sysName by default
The autotests are failing on build.kde.org due to the generated DBus
object path not being valid. This might be due to sysName having been
empty by default.
2016-08-15 16:55:10 +02:00
Martin Gräßlin
ab5d31426a [libinput] Expose all input devices through DBus
Summary:
The Connection exposes a new service called org.kde.KWin.InputDevice
and every Device registers an own object exposing all properties.

This allows an external configuration tool to change the behavior of
the devices at runtime. E.g. to test configuration settings.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2407
2016-08-15 16:10:50 +02:00
Martin Gräßlin
8bbd53a774 [wayland] Properly implement minimize of ShellClient
Summary:
We need to call Workspace::clientHidden when minimizing. Otherwise
Workspace doesn't update the active client and the now minimized
window is still active.

BUG: 366634

Test Plan:
Test case works now and also tested in nested setup that
active window changes.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2410
2016-08-15 16:10:11 +02:00
Martin Gräßlin
bd58d7792f Don't trigger modifier only shortcuts if pointer interaction
Summary:
If the user clicked a pointer button or scrolled a pointer axis the
held modifier was most likely intended to modify the pointer event.
Thus the modifier only shortcut should not be triggered.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2435
2016-08-15 16:09:03 +02:00
Martin Gräßlin
3a730fa51e Merge branch 'Plasma/5.7' 2016-08-15 16:07:50 +02:00
Martin Gräßlin
71c996fe33 Select also raw button press/release in XInput2 based polling
Summary:
The mouse polling is also used to detect mouse button press/release
events. This is used e.g. by the MouseClickEffect. The XInput2 filter
only selected for Raw Motion events which means mouse button events
are missed in case it's not combined with a motion.

This change makes the input filter also select for raw button press
and release events. To support this the X11EventFilter needed to
be adjusted to support multiple generic event types to filter for.

BUG: 366612
FIXED-IN: 5.7.4

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2406
2016-08-15 16:06:30 +02:00
Martin Gräßlin
03f66b02c3 [autotest/integration] Add pointer axis events to ModifiersOnlyShortcutTest
If a pointer axis is scrolled while a modifier is hold, the modifier only
shortcuts should not trigger. The user wanted to use the modifier for the
pointer axis.

This is not implemented yet, thus all is QEXPECT_FAIL.
2016-08-13 15:15:54 +02:00
Martin Gräßlin
280663fede [autotest/integration] Add pointer button events to ModifiersOnlyShortcutTest
If a pointer button is pressed or gets pressed while a modifier is
hold, the modifier only shortcuts should not trigger. The user wanted
to use the modifier for the pointer button.

This is not implemented yet, thus all is QEXPECT_FAIL.
2016-08-13 15:09:21 +02:00
Martin Gräßlin
fcd9a15186 [autotest/integration] Add a test case for modifier only shortcuts
This test verifies the functionality of modifier only shortcut
activation. The base test case uses a helper object which is exported
to DBus and has a slot which can get triggered.

The test configures the individual modifiers to call that DBus method
when the shortcut is triggered. It simulates pressing the modifier and
verifies the DBus method was invoked or not.
2016-08-13 14:35:01 +02:00
Martin Gräßlin
83d8181675 [libkwinglutils] Revert version hack for Qualcomm Adreno on libhybris
The idea to set proper version is good, but it results in epoxy
thinking it does not have the entry points and terminating KWin.
2016-08-12 15:46:55 +02:00
David Edmundson
6c8f0e6cc0 Include setOnActivity in the test 2016-08-12 13:21:09 +01:00
David Edmundson
628fe79d3e Fix activites_test check
client->isOnActivity("foo") will return true if the client is on no
activities, as that's the equivalent of saying we are on all activities.

In our case we do want to check activities() shows the right thing.
2016-08-12 13:21:09 +01:00
Martin Gräßlin
b14618994b [autotests/integration] Add a first test case for activities
Verifies the condition from D1982 with expected_fail. That is sets
a Client on non existing activities and expects that it should be on
all activities.
2016-08-12 12:52:47 +02:00
Martin Gräßlin
a5c8356d40 [libkwineffects] Add detection code for Qualcomm Adreno to GLPlatform
Summary:
The Qualcom Adreno classes are recognized and a version detection
workaround is added for libhybris which only announces GLES version 2
although GLES version 3 is supported. KWin at least used to work with
GLES version 3 which gives us e.g. framebuffer blit.

Reviewers: #kwin, bshah

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2415
2016-08-12 09:59:38 +02:00
Martin Gräßlin
79641df928 [autotests/libkwineffects] Add test data for Adreno 330
This is the device used in Nexus 5 and reference for Plasma Mobile.
The output is with using libhybris on top of hwcomposer backend.
2016-08-12 09:16:28 +02:00
Martin Gräßlin
7586394b81 [autotests] Don't try to load StartupFeedbackEffect on GL compositor
The test terminated cleanly as it tried to load a shader which obviously
fails.
2016-08-12 08:24:43 +02:00
Martin Gräßlin
ec596519c6 [autotests/integration] Add test case for minimizing active ShellClient
When minimizing an active ShellClient it should become inactive.
This is not the case as the test case shows through expected failures.

CCBUG: 366634
2016-08-11 17:08:08 +02:00
Martin Gräßlin
cd6d82fcbc [libinput] Add device configuration for tap-drag-lock
From libinput documentation:
Also optional is a feature called "drag lock". With drag lock disabled,
lifting the finger will stop any drag process. When enabled, libinput
will ignore a finger up event during a drag process, provided the finger
is set down again within a implementation-specific timeout.
2016-08-11 16:32:00 +02:00
Martin Gräßlin
02cf9e8a64 [libinput] Add support for tap and drag
From libinput documentation:
A tap immediately followed by a finger down and that finger being held
down emulates a button press. Moving the finger around can thus drag
the selected item on the screen.
2016-08-11 16:02:26 +02:00
Martin Gräßlin
e18e2eb57c [libinput] Rename Device::tapEnabledByDefault to tapToClickEnabledByDefault
Slightly more descriptive name what the feature is about.
2016-08-11 15:18:40 +02:00
Martin Gräßlin
2f7298bed5 [libinput] Add support for tapToClick configuration
New property added to Device which allows reading and setting the
tap to click configuration.
2016-08-11 15:13:36 +02:00
Martin Gräßlin
7bca270f97 Force windows of type desktop to be opaque
Summary:
Plasmashell's desktop windows are RGBA which forces the compositor to
perform blending and render the background. That is absolutely pointless
as there is no window behind the desktop window it could blend to. All it
does is destroying KWin's more optimized code path and forcing additional
rendering which will never be visible (including shader push/pop).

With this change KWin forces desktop windows (both X11 and Wayland) to
be considered as opaque by setting the depth to 24. Thus blending is
disabled and the background is not rendered.

Test Plan:
Verified with apitrace that KWin goes in the opaque rendering
path for desktop windows.

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2382
2016-08-10 15:10:22 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
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