Commit graph

161 commits

Author SHA1 Message Date
Martin Gräßlin
568a036762 [autotests] Add test case for verifying that (un)shade keeps window geometry
This adds a new test case which creates an x11 window, shades it,
unshades it and verifies that the geometry is still the same.

CCBUG: 362501
2016-05-11 10:43:27 +02:00
Martin Gräßlin
d19690ce98 Honor input mask set on internal windows
Summary:
This ensures that QWindow::setMask works for KWin internal windows.
Without KWin sends all pointer events to the QWindow, even if the
mask says it shouldn't get events.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1509
2016-05-03 11:10:25 +02:00
Martin Gräßlin
319869881c Connect Application::screensCreated to WaylandServer::initOutputs
Summary:
Instead of having the Application invoke initOutputs after creating
the Screens, we can just connect to the signal emitted there.

This allows to make initOutputs a private, WaylandServer internal
method.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1482
2016-05-02 15:52:07 +02:00
Martin Gräßlin
e64450c807 Merge branch 'Plasma/5.6' 2016-04-26 13:13:17 +02:00
Martin Gräßlin
6d60f01ad9 Skip DontCrashEmptyDecorationTest if we don't have a /dev/dri/card0 device
Without the /dev/dri/card0 mesa fails to initialize egl and the test
fails. In order to silence the failure till the system provides the
device file, we better skip the test.

A nullptr crash in that case is fixed in WaylandServer tear-down.
2016-04-26 12:47:02 +02:00
Luigi Toscano
654a17686e Conditionally compile tests which depend on XCB_ICCCM
Summary: Move/Resize and Strut tests Wayland tests are affected.

Test Plan: Successful compilation when XCB_ICCCM is not found

Reviewers: graesslin

Reviewed By: graesslin

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1476
2016-04-25 11:27:51 +02:00
Martin Gräßlin
e2e6d8b08b Warp the cursor pos to the specificed global position in a NET::Move request
Summary:
The cursor position is the reference KWin uses while moving a window.
If we don't warp the cursor position the window "jumps" to the cursor
position on first movement.

For requests triggered by the client (e.g. widget style) this does not
matter as the cursor is at the correct position. But for tools such as
task bars we should ensure the cursor is at the right pos.

Reviewers: #plasma, hein

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1421
2016-04-18 07:50:06 +02:00
Martin Gräßlin
380c5e0bd8 [autotests] Only start Xwayland if compositor created a scene
Same as df2c26e3d9 for
WaylandTestApplication.
2016-04-14 10:29:27 +02:00
Martin Gräßlin
0df4406c2c Fix crash on repainting an invalid sizes decoration
Summary:
If a window has an invalid size the decoration also has an invalid
size. This results in the texture used by the
SceneOpenGLDecorationRenderer to be invalid and being reset to null.
Of course we shouldn't try to use this texture to render to.

The change comes with a test case to simulate the situation. We cannot
simulate it with Wayland clients as the geometry can never be empty.
Thus we create an X11 client, resize it to an empty size and unmap it.

This is the first integration test case which creates an X11 Client!
It's also a test case which needs the OpenGL compositor. This will most
likely not work on build.kde.org yet - we need to see what to do about
it. Will need adjustments to get it at least skip on build.kde.org.

BUG: 361551
FIXED-IN: 5.6.3

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1383
2016-04-14 07:35:51 +02:00
Martin Gräßlin
bc25677caf Strut sanity checking: ignore struts which would exclude a complete screen
Summary:
Mostly meant for multi-screen setups: we don't want that a strut set on
a window on screen 0 results in screen 1 completely being excluded. Even
if that's strictly seen a client bug, it's better to just ignore the
strut from KWin's side.

The sanity check is implemented in Client::adjustedClientArea.

From a pure standard point of view this change is a EWMH violation and
thus can cause regressions: struts by clients no longer working.

A test case for struts is added, including some invalid combinations
whose strut is ignored with this change.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1386
2016-04-12 16:55:19 +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
10632f09ca Rename AbstractBackend to Platform 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
7996d954c5 Provide the platform() -> AbstractBackend* in KWin::Application
Summary:
This is the first change in a refactoring series. The aim is to:
* rename AbstractBackend to Platform
* move backends/ to plugins/platforms/
* don't bind platforms to Wayland only
* provide a platform plugin for "normal" X11
* share more code between X11 and Wayland

This change moves the platform/backend from waylandServer to Application.
The init of the plugin happens directly in the Application from the
KPluginMetaData. There is no need to externally init it and set the
parent.

WaylandServer::backend() currently just delegates to
kwinApp()->platform(), the idea is to drop this method completely.

The test infrastructure is also adjusted to this change.

Test Plan: kwin_wayland still works, all tests pass

Reviewers: #plasma, sebas

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1331
2016-04-07 08:00:12 +02:00
Martin Gräßlin
7437c3836f [autotest] Validate set options in PointerInputTest::testModifierClickUnrestrictedMove
Just to be sure, the code did what we wanted it to do.
2016-04-06 17:25:24 +02:00
Martin Gräßlin
1ed6f8ba63 Merge branch 'Plasma/5.6' 2016-04-05 10:36:15 +02:00
Martin Gräßlin
09dd9153d8 [autotests] Use DMZ-White as cursor theme
On build.kde.org we cannot use the breeze cursor theme. Instead we have
DMZ-White (debian package dmz-cursor-theme).

This change adjusts the PointerInput test to enforce DMZ-White and uses
SizeAllCursor instead of OpenHandCursor as that one seems to be missing
in that theme.

Hopefully with these changes the test starts to pass on build.kde.org.
2016-04-05 08:36:53 +02:00
Martin Gräßlin
c1b709b250 [autotests] Fix heap-use-after-free
Thanks build.kde.org!
2016-03-29 11:08:04 +02:00
Martin Gräßlin
d49189276f Merge branch 'Plasma/5.6' 2016-03-21 16:55:39 +01:00
Martin Gräßlin
23c505d71e Ensure panel, desktop and onscreendisplay windows cannot be moved/resized
Summary:
A user shouldn't be able to manually move/resize a desktop window or
a panel. So far this wasn't ensured.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1155
2016-03-21 16:44:46 +01:00
Martin Gräßlin
6a19f50cac Add a debugging console to KWin
Summary:
The idea behind the debugging console is to have a feature comparable
to xprop and xwininfo just for Wayland. We cannot have command line
utils as that violates the security restrictions, thus it needs to be
exposed directly in KWin.

The debugging console is invoked through DBus:
qdbus org.kde.KWin /KWin showDebugConsole

This opens a window with a tree view. The DebugConsoleModel which is
used by the tree view groups all windows into four categories:
* x11 clients (that is Workspace::clientList() and Workspace::desktopList())
* x11 unmanaged (Workspace::unmanagedList())
* wayland shell clients (WaylandServer::clients())
* wayland internal clients (KWin's own QWindows - WaylandServer::internalClients())

Each window is a child to one of the four categories. Each window itself
has all it's QProperties exposed as children.

This allows to properly inspect KWin's internal knowledge for windows and
should make it easier to investigate problems. E.g. what's a window's
geometry, what's it's window type and so on.

The debugging console is intended as a developer tool and not expected to
be used by users. That's why it's invokation is rather hidden. Due to
the fact that it's internal to KWin it results in:
* no window decoration
* stealing keyboard focus
* no way to resize, close, move from KWin side
* rendered above all other windows

There is a dedicated close button to get rid of it again. While the
console is shown it's hardly possible to interact with the system in
a normal way anymore. This is something which might be improved in
future.

At the moment the model is able to update when windows are added/removed,
but not yet when a property changes. Due to the lack of interaction with
the existing system, that's not a high priority at the moment, but can
be added in future.

Reviewers: #plasma

Differential Revision: https://phabricator.kde.org/D1146
2016-03-16 14:30:19 +01:00
Martin Gräßlin
bf932c4e97 Fix crash when accessing ShellClient::iconGeometry for a not mapped window
It uses windowManagementInterface which is null until the window
is mapped. A not mapped window obviously has an invalid iconGeometry.
2016-03-14 10:24:13 +01:00
Martin Gräßlin
0b9e6a4aa2 Fix start move through drag distance on window decoration
We need to call handleMoveResize on the mouse move with button down.

Auto tests adjusted to include all possible directions.
2016-03-11 12:48:01 +01:00
Martin Gräßlin
2787fdb873 [autotest] Fix build on build.kde.org (Try 3)
Qt::Orientation seems not to be a declared metatype with Qt 5.4.
2016-03-03 16:26:55 +01:00
Martin Gräßlin
04fdecdd59 Implement sanity checks when placing transients
A transient window should always be visible on the current screen.
This change ensures that a transient is always placed in a way that
the transient window is visible on the screen ignoring the transient
offset hint if it has to be.

Unfortunately QtWayland doesn't set the transient hint correctly:
a sub menu is a transient to the main window and not to the parent
menu resulting in quite off positioned menus, see:
https://bugreports.qt.io/browse/QTBUG-51640
2016-03-03 15:57:55 +01:00
Martin Gräßlin
fa774230f3 Fix transient placement for decorated parents
Need to add client pos to the transient's position. The offset is
relative to the parent surface, but the client doesn't know about the
size of the decoration, thus KWin needs to add it.
2016-03-03 15:57:55 +01:00
Martin Gräßlin
f2873dcd36 [autotest] Add test for transient placement positioning
Test creates windows and transients for it and verifies the position.
For decorated windows the position is currently broken as it does not
consider the adjusted client position.
2016-03-03 15:57:55 +01:00
Martin Gräßlin
166d282a9f [autotests] Specify XCUROSR_THEME and XCURSOR_SIZE in pointer input test
Try to fix test on CI system. With neither a config nor the env variables
the cursor selection falls back to the default cursor theme, which might
not contain the cursors we need.
2016-02-25 13:53:23 +01:00
Martin Gräßlin
ed7bf6e091 Send leave/enter pointer event when starting/stoping effect mouse interception
When starting effect mouse interception the current focused window
and or decoration should get a leave event. Similar when the effect mouse
interception ends the current pointer position needs to be evaluated and
a pointer enter be sent if needed.
2016-02-25 09:15:41 +01:00
Martin Gräßlin
6d495f1dc9 [autotests] New test case to verify cursor changes correctly in effects
The test case verifies that setting an override cursor during mouse
interception works and that it's also possible to change it. When
ending mouse interception the cursor image should be adjusted again.

The test shows that when mouse interception starts KWin should send
a pointer leave event to the current focused window and similar needs
to handle the stop of mouse interception.
2016-02-25 09:12:22 +01:00
Martin Gräßlin
b6677ca04e Reset stored window before setting it as focused pointer surface on seat
Updating the focused pointer surface results in the cursor to change.
The CursorImage needs the current focused window to evaluate which cursor
to use, though. Thus we need to make sure that the window reflects the
current state before updating the seat.
2016-02-25 08:14:48 +01:00
Martin Gräßlin
d15e94f326 [autotest] Add test case for cursor image
This test case verifies that the cursor image and hot spot changes
correctly when focusing a window, changes when damaged and hides.

Test shows that when focusing a window the cursor image is not
removed, neither that unfocus sets back to fallback cursor properly.
2016-02-25 08:14:48 +01:00
Martin Gräßlin
9eeef2d9ca Fix mouse action on (in)active window
Small regression: the command didn't get updated at all, so it was always
MouseNothing.

To prevent such a regression to sneak in again the change comes with
autotest for the action on inactive and active window.
2016-02-22 10:07:02 +01:00
Martin Gräßlin
cb3c6a4780 Implement internal keyboard repeat
As a Wayland server KWin does not have to emit additional key repeat
events (unlike X11). The clients are responsible for handling this based
on the provided key repeat information.

Internally KWin needs key repeat, though. E.g. the effects need key
repeat (filtering in Present Windows), window moving by keyboard needs
repeat, etc. etc.

This change introduces the internal key repeat. For each key press a
QTimer is started which gets canceled again on the key release. If the
timer fires it invoked processKey with a new KeyboardKeyAutoRepeat state.
This is handled just like a KeyPress, but states are not updated and
the QKeyEvent has autorepeat set to true.

The event filters check for the autorepeat state and filter the event
out if they are not interested in it. E.g. the filters passing the event
to the Wayland client need to filter it out.

Currently auto-repeat is bound to using libinput. This needs to be
modified. The only backend sending repeated events is X11, thus for
other backends it should be enabled.

Whether creating a timer on each key event is a good idea is something to
evaluate in future.

Reviewed-By: Bhushan Shah
2016-02-19 08:22:53 +01:00
Martin Gräßlin
b59593bd9d Invoke AbstractClient::enterEvent and ::leaveEvent on updating pointer window
This implements auto raise and focus follows mouse for Wayland.

The decoration interaction needs to be autotested.
2016-02-18 16:12:22 +01:00
Martin Gräßlin
6d47839e95 Fix scroll direction on window wheel command
Experimental testing in real world showed it's just a signing issue
in this specific case. The events passed to wayland clients scroll
in correct direction.
2016-02-18 10:11:20 +01:00
Martin Gräßlin
f1e3c9f191 [autotests] Add test case for touch down triggers a mouse action 2016-02-18 09:57:18 +01:00
Martin Gräßlin
2a98c681d0 Implement whell command in input handling
With that all the actions are implemented just like on X11.

There are two not yet implemented differences:
* hide splash window when clicking it
* replay event on special window
2016-02-18 09:18:39 +01:00
Martin Gräßlin
1f1a4ac6e8 Add support for modifier+wheel action
Implemented in the ForwardEventFilter: before forwarding the event
to the window we check whether a modifier is pressed and perform the
wheel command.

Possible improvements: each axis event triggers the same change, there
is no adjusted scaling.
2016-02-18 08:27:28 +01:00
Martin Gräßlin
f8f13a7fba Implement modifier+click in InputRedirection for Wayland
This change implements the mouse command for modifier (alt/meta) plus
click in InputRedirection so that it also works on Wayland.

Modifier plus mouse wheel is not implemented yet.

For easier code in Options a new method is added which provides the
configured modifier as a Qt::KeyboardModifier instead of a Qt::Key code.

Test case is added which simulates all variants of modifiers plus
supported mouse buttons to trigger move.
2016-02-17 17:07:09 +01:00
Martin Gräßlin
093e56ff05 Move decoration double click logic to button press
Complements ed1d32288b for Wayland.
2016-02-17 14:41:26 +01:00
Martin Gräßlin
cc8b3a5a96 [autotest] Don't crash when cancel animation from animationEnded in scripted effect
Canceling the animation in the animationEnded handler triggers a crash.
This is due to multiple lists being iterated and manipulated at the same
time.

This adds a test case which simulates the crashy situation.

REVIEW: 126975
2016-02-17 13:59:55 +01:00
Martin Gräßlin
521470b04a Improve keyboard handling for internal windows
So far the key handler in the InternalWindowEventFilter used the
PointerInputRedirection's internal window. This had the result that
key events were only delivered to an internal window if the window
was under the cursor.

This change tries sending the event to the latest created and visible
window. Thus e.g. with nested context menus it goes to the current
sub menu as expected. The return value of sendEvent is used to filter
out the event.
2016-02-17 13:34:24 +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
44bb78c193 Map all pointer buttons to Qt::MouseButton
The mapping is slightly inspired by the mapping in QtWayland.
But the mapping in QtWayland seems wrong. E.g. there is a linux kernel
button called BTN_BACK which is not mapped to Qt::BackButton.

Anyway we are not really interested in the mapping being 100 % correct
for the case in KWin. KWin internally uses only very few mouse buttons
and all others are only relevant to figure out whether buttons are
pressed. The button code itself is passed to the seat with the native
code.
2016-02-17 11:16:57 +01:00
Martin Gräßlin
61428b164e [autotests] Test move ends when all pointer buttons are released
The MoveResizeWindowTest is extended by a test case to verify that
the move only ends once all mouse buttons are released. So far this
is not yet the case as KWin has an incorrect mapping of buttons to
Qt::MouseButtons.
2016-02-17 11:00:58 +01:00
Martin Gräßlin
5200a484ce [autotest] Adjust LockScreenTest to fix that KSldApp goes to Locked state
So far KSldApp was always either in state AcquiringLock or Unlocked
during the tests. Due to a fix in WaylandServer it now can also enter
the Locked state. But this is timing related and also depends on whether
the greeter works at all. E.g. on build.kde.org the greeter fails to
start, so it never enters the Locked state.

The adjusted test now considers that the state might have changed to
Locked and expects one additional signal to be emitted.
2016-02-17 09:41:17 +01:00
Martin Gräßlin
fed7a48112 Revert "[autotest] Let's dare enabling the OpenGL compositor in the tests"
This reverts commit 5e21963a3b.

Unfortunately all tests failed on the CI system, so no GL yet :-(
2016-02-12 15:22:55 +01:00
Martin Gräßlin
5e21963a3b [autotest] Let's dare enabling the OpenGL compositor in the tests
CI system is adjusted, so that OpenGL should work. At least latest
run didn't show the EGL warnings in the lock screen test. So let's
try to enable again. It's possible that this fails horribly. If that's
the case I'll revert again.

The dontCrashGlxgearsTest is kept on QPainter as locally it crashes
on teardown (needs fixing).
2016-02-12 14:18:14 +01:00
Martin Gräßlin
a51171720e Improve updating the pointer position after screen changes
The logic should not be tied to whether libinput is used. It's relevant
for all Wayland backends whether they use libinput or not.

In addition this should generate a pointer motion event, so that proper
processing can take place and we get proper pointer enter events.
2016-02-11 14:27:30 +01:00
Martin Gräßlin
79c274b942 [autotest] Add test case for update pointer focus after screen change
The test removes the second screen while the cursor is on it. This
should warp the pointer to the center of first screen and trigger
a focus enter event.

As can be seen by the expect failures currently it's bound to libinput
and also doesn't process the event as if it were a pointer event.
2016-02-11 14:25:04 +01:00
Martin Gräßlin
5b5a966e48 Process pointer warped positions like normal updates
If the pointer is warped the position change should be treated like
a change coming from the input device. Our normal processing should
take place.

A problem in this case is the timestamp to pass to the wayland server.
Normally our timestamps come from the backend/libinput and we don't
know the next one. As an intermediate solution we just use the last
timestamp on the seat. In future a solution could be to not use the
backend's timestamp at all, but have our own timestamp handling.
2016-02-11 12:56:26 +01:00
Martin Gräßlin
3aeec88449 [autotest] Add test for internal pointer warping
When warping a pointer through Cursor::setPos it should be processed
just like any other pointer event. It should generate enter/leave event,
create motion events, etc. This is currently not the case as the test
shows.
2016-02-11 12:48:42 +01:00
Martin Gräßlin
8e6f387a6e [autotest] Test case for stacking order changes should change focus
A new test case which ensures that when stacking order changes the
pointer focus gets re-evaluated and updated. I was positively surprised
to notice that this already works.

Noticed two other problems while writing the test case:
* warping pointer does not re-evaluate the pointer pos
* deleting a ShellSurface (client) does not destroy the ShellClient (server)
2016-02-11 10:47:21 +01:00
Martin Gräßlin
f4e28e2c9c Fix typo 2016-02-11 09:34:19 +01:00
Martin Gräßlin
c8c33ae398 Implement lock screen security for touch events
When the screen gets locked any existing sequence gets cancelled
and the focused touch surface gets reset. While screen is locked
touch events are filtered to only go to lock screen or input methods.

Test case is added for touch event during lock screen.

Reviewed-By: Bhushan Shah
2016-02-11 08:09:10 +01:00
Martin Gräßlin
a311f9bfda Add check for lock screen in InputRedirection::updateKeyboardWindow
Instead of only making the active client the focused keyboard surface,
the method now also performs the lock screen security restriction.

Also just like udatePointerWindow the method becomes public, so that
it can be used from the LockScreenEventFilter and is connected for
lock state changes. This means as soon as the screen locks the current
focused keyboard surface will get a leave event and get an enter event
once the screen unlocks.

The auto test is adjusted to verify these new conditions.

Reviewed-By: Bhushan Shah
2016-02-11 08:09:10 +01:00
Martin Gräßlin
16a33f662b Improve lock screen interaction for pointer in InputRedirection
InputRedirection connects to lockStateChanged to udate the current
pointer window. This way we can ensure that the current pointer
surface gets reset as soon as the screen locks (c.f. the expect
fail in the autotest) and also that it restores to the surface under
the mouse once the screen is unlocked.

The relevant code was not yet lock screen aware and performed an
early exit. Part of the code was fine, e.g. findToplevel is lock
screen aware. So this change adjusts the methods for updating the
internal window and decoration to be lock screen aware, that is they
get reset. With that updatePointerWindow is also lock screen aware.

Thus the LockScreenFilter can also use updatePointerWindow just like
the normal handling and does not need to reimplement parts of it. As
it now relies on other code being correct it has an additional check
to verify that the current pointer surface is a surface which is allowed
to get events. If it isn't the events are not forwarded.

Reviewed-By: Bhushan Shah
2016-02-11 08:09:10 +01:00
Martin Gräßlin
142e826191 Clear touch ids when canceling a touch sequence
Before calling touchUp would hit an abort in KWayland::Server.
2016-02-11 08:09:10 +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
4e907d6773 [autotest] Add test for touch input
Basic test validating:
* multiple touch points are handled
* cancel is handled
2016-02-09 11:35:15 +01:00
Martin Gräßlin
09cc134bfc [autotests] Test case for lock screen intercepts key events
Our active client should lose keyboard focus when screen gets locked
and re-gain after the screen unlocks.
2016-02-08 16:52:22 +01:00
Martin Gräßlin
500bc9c18c [autotest] Add test case for global shortcuts while screen is locked
They shouldn't be triggered if the screen is locked.
2016-02-08 15:23:06 +01:00
Martin Gräßlin
75261ab9f6 [autotests] Test case for key events on internal windows 2016-02-08 15:03:21 +01:00
Martin Gräßlin
037b3ba66e [autotests] Add test case for effects key handling during screen lock
Verifies that no key events are forwarded to the Effects during a
locked screen.
2016-02-08 12:36:39 +01:00
Martin Gräßlin
dfd0664fd6 [autotest] Add a test for a KWin internal QWindow
The test creates a QRasterWindow which through KWin's internal QPA
is considered an internal window. In the test methods we simulate
various pointer events (enter/leave, press/release, wheel).
2016-02-05 15:39:04 +01:00
Martin Gräßlin
66c77bcd31 [autotest] Move window through decoration
Interestingly just trigger the move and instant release doesn't move
the window.
2016-02-04 15:07:03 +01:00
Martin Gräßlin
a9f48ec62c [autotest] Test case for hover move on decoration
Verifies that the cursor shapes are adjusted correctly.
2016-02-04 14:20:36 +01:00
Martin Gräßlin
749ec28e23 [autotests] Add test case for double click on window decoration
Shows that currently a tripple-click triggers two double click events.
2016-02-04 11:56:45 +01:00
Martin Gräßlin
938a0ff7fc [autotests] New test for input on window decoration
First test case is whether wheel events are forwarded correctly.
From the code it seems to me like up/down is inversed. Needs manual
testing.

As this requires working decorations it's possible that this test
will fail on build.kde.org.
2016-02-04 11:20:28 +01:00
Martin Gräßlin
7558fcd4b4 [autotest] Extend LockScreen test for global pointer and axis shortcuts
The global shortcuts may not be triggered while screen is locked.
2016-02-04 09:06:15 +01:00
Martin Gräßlin
25d07c22da [autotests] Extend LockScreenTest for locking while moving window
Things which weren't possible on X11 are possible now.
2016-02-03 09:36:12 +01:00
Martin Gräßlin
a0cc3aac63 [autotest] Reduce code duplication in LockScreenTest 2016-02-02 16:18:37 +01:00
Martin Gräßlin
1baba74611 [autotests] Verify that Effects don't get pointer events on locked screen
Interesting approach I would not have expected to work. A dummy Effect
class is created in the test and an instance is passed to
EffectsHandler's startMouseInterception. It doesn't verify whether it's
an Effect it knows or has created, so it's totally happy with the dummy.

It shows that motion and press/release are passed to the Effect when
screen is not locked and doesn't while the screen is locked.
2016-02-02 14:41:28 +01:00
Martin Gräßlin
87d1f87cc0 [autotest] Extend lockscreen test
* verifies that pointer axis isn't passed to windows
* verifies that screen edge is not activated while screen is locked
2016-02-02 13:50:13 +01:00
Martin Gräßlin
b905fa0f68 [autotests] Adjust lockscreen test to improvements in KSld
On the CI system our tests failed due to the greeter failing to start
due to OpenGL problems. This was because we waited for a window to show
which never happened. Thus the test failed.

This change makes use of the new lockStateChanged signal to determine
when the screen gets locked/unlocked.

It's still possible that the test fails as I'm not able to reproduce
the failure condition on the CI system.
2016-02-02 10:22:37 +01:00
Martin Gräßlin
803d499287 [autotest] Add test case for pointer buttons on locked screen
Extends the lock screen tests by verifying that pointer button
press/release events will be intercepted by the lock screen.
2016-02-01 17:57:38 +01:00
Martin Gräßlin
7de9a402df [autotest] Add a test for locking the screen
First test case is to ensure that pointer motion events trigger a
leave event on the surface the pointer is on.

The test case shows errors in the input handling.

More tests need to be added.
2016-02-01 15:10:00 +01:00
Martin Gräßlin
1790168fb3 [autotests] Test quick tiling when moving a window with the Pointer
Just like the keyboard case. Too much code duplication.
2016-02-01 09:28:06 +01:00
Martin Gräßlin
a12fb5ed03 [autotest] Extend QuickTilingTest for keyboard window move
Trigger quick tiling by moving the window. For moving the window only
keyboard keys are used.

The test experienced some problems with the Outline triggering crashes.
To work around them the test disables the Outline by specifying an
invalid configuration.
2016-01-29 09:54:07 +01:00
Martin Gräßlin
5f502c141a [autotests/wayland] Disable KActivities in the tests
Makes our tests time out, we're too fast in shutting down.
2015-12-18 16:40:52 +01:00
Martin Gräßlin
3be016fba4 [wayland] Destroy all ClientConnections on tear down
Ensures that all Wayland objects are destroyed and the cleanup handling
is performed before tearing down the Compositor. This fixes for example
a crash if a Surface with a Shadow is still around at tear down.
2015-11-18 10:29:10 +01:00
Martin Gräßlin
f6ef9e8d8c [wayland] Don't use waitForFinished on the Xwayland QProcess
WaitForFinished blocks our main thread, but Xwayland wants to talk
to Wayland and blocks as well. So let's ensure events are processed
while terminating Xwayland.
2015-11-12 15:15:44 +01:00
Martin Gräßlin
240e7ba337 [wayland] Emit signal before x11 connection gets destroyed
Used in Compositor to destroy the cm_selection. This would crash
otherwise as it calls into xcb after Xwayland is destroyed.
2015-11-12 15:13:42 +01:00
Martin Gräßlin
f2bdb4818a [wayland] Disable Compositor during tear-down
Prevents rendering an incomplete state and as well prevents from
running performCompositing() which could access Workspace and crash.
2015-11-12 15:12:01 +01:00
Martin Gräßlin
238ff89edb [wayland] Don't exit due to Xwayland exiting on tear down
Our Xwayland exit error handler should not run during tearing down
Xwayland. Yes we expect Xwayland to exit as a response to KWin telling
it to exit.
2015-11-12 14:06:28 +01:00
Martin Gräßlin
c1e9280efa [wayland] Unload all effects prior to destroying Xwayland connection
Some effects do X11 calls in their cleanup code through external
libraries (e.g. KSelectionOwner). As we cannot control that we need
to ensure the effects are unloaded prior to destroying the Xwayland
connection.
2015-11-12 11:33:00 +01:00
Martin Gräßlin
affcbac7e7 [wayland] Destroy Xwayland's ClientConnection on tear down
We need to destroy the ClientConnections we create. Also we need
to disconnect our Xwayland error handling before destroying it, otherwise
it would trigger the abort for crashing Xwayland.
2015-11-10 14:21:48 +01:00
Martin Gräßlin
f75e53af60 [wayland] Ensure to not call into x11 on Compositor tear-down
During Compositor tear down Xwayland is already destroyed. Thus it
doesn't make sense to try to delete the support properties: either
it freezes in xcb or it crashes because the connection is null.

At the same time we also ensure that the connection internally is
reset to null. Note: the one in kwinglobals.h caches and could cause
use-after-free errors. Any tear-down code must be migrated to
kwinApp()->x11Connection().
2015-11-10 13:54:26 +01:00
Martin Gräßlin
51b44f4a87 [autotests/wayland] Fix with Qt 5.6
Test need to disable HighDPI, otherwise they crash.
2015-11-10 10:58:33 +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
f1215e44d4 Move implementation of (shrow|grow)(Horizontal|Vertical) to AbstractClient
Methods are no longer virtual. The only x11 specific usage in these
methods (resizeInc) is replaced by a virtual method. Default resize
increments is QSize(1,1) for AbstractClient.
2015-10-26 15:49:03 +01:00
Martin Gräßlin
8f2b01b549 [wayland] Fix quick tiling auto test
Don't emit both geometryShapeChanged and geometryChanged: the one
is set up to call the other.

Also adjust tests because maximize changes triggers too many geometry
changed signals.
2015-10-26 13:50:08 +01:00
Martin Gräßlin
45fb1680fc Consider all client in Workspace::packPositionFoo
We need to use m_allClients (AbstractClient) instead of clients (just
Client). Thus packing against another AbstractClient works.
2015-10-26 13:25:47 +01:00
Martin Gräßlin
b19da3cb14 Move implementation of Client::packTo to AbstractClient
Method no longer virtual and only implemented in AbstractClient.
The implementaton works in a generic way nowadyas.

Added an autotest for the basic packTo behavior for packing against
a screen border. Packing towards other clients still needs adjustments
in the Placement code.
2015-10-26 11:30:34 +01:00
Martin Gräßlin
1a66472494 Merge setting up client and shell client connections in EffectsHandlerImpl
The signals operate on AbstractClient nowadays, so we can have one
implementation for both Client and ShellClient.

Only X specific connections are only done for Client.
2015-10-26 10:43:36 +01:00
Martin Gräßlin
5d4cd0b26c Move geometry related connects from Client to AbstractClient 2015-10-26 10:14:54 +01:00
Martin Gräßlin
4e7521fe64 Allow moving of Wayland windows
So far only moving through useractions menu is possible and only through
cursor control (mouse events are lost).

A basic first autotest is added to validate the moving of Windows.
2015-10-26 09:21:36 +01:00
Martin Gräßlin
58bcf66ecf [autotests] Test case for 10ad9262a1
The problem we had was closing a glxgears through an Aurorae theme
crashed KWin inside QtQuick.

This test case simulates the sequence:
1. starts glxgears
2. wait till we have a Client for it
3. send mouse move to guessed close button position
4. send mouse press/release at that position
5. verify the window is closed
6. verify glxgears exits

With the given commit reverted this crashes, with it in place it passes.

Please note: on CI it might fail as glxgears is not yet installed. [1]
Also we cannot enforce using Aurorae from the test yet, though on
the CI system it should get picked automatically as no other deco
plugin should be installed.

[1] Sysadmin ticket already created
2015-10-22 10:08:49 +02:00