14539 Commits (f9725a6849b3f9e8a46fae460cae8be20849c158)
 

Author SHA1 Message Date
Martin Gräßlin f9725a6849 [tests] Fix build - missing include to QDebug
Sorry, worked on my system.
8 years ago
Martin Gräßlin e763abe91f [tests] Tool to read the X11 shadow on a window
Summary:
This new helper tool allows to read the X11 shadow from a window
and visualize the individual parts.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2101
8 years ago
Martin Gräßlin 3c04d5295d Handle situation of no XDG_RUNTIME_DIR gracefully
Summary:
If KWin fails to start the Wayland server due to XDG_RUNTIME_DIR not
being set, kwin_wayland should terminate with an error condition but
not crash.

This change makes sure that KWin detects that the Wayland server does
not work and terminates the startup early and ensures that it doesn't
crash while going down.

An error message is shown that we could not create the Wayland server.

Test Plan:
Test case added which verifies that WaylandServer fails to
init. Manual testing that kwin_wayland exits with error 1.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2078
8 years ago
Martin Gräßlin 76fa3026dd Merge branch 'Plasma/5.7' 8 years ago
Martin Gräßlin 56c2e158ee Call QCoreApplication::exit instead of stdlib exit to terminate if platform fails
Summary:
We need to properly tear down the application - this can be achieved
through QCoreApplication::exit. Otherwise there is a chance that the
cleanup handling crashes.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2136
8 years ago
Martin Gräßlin cd9a0afafa [platforms/drm] Properly handle case that mapping the blank buffer fails
Summary:
If it's not possible to create a buffer to blank the output, KWin won't
be able to render to the output. In that case the output should not be
added to the list of outputs.

To support this DrmOutput::blank and DrmOutput::init return bool to
indicate whether they succeeded. DrmBackend handles this situation and
doesn't add the output to the list of outputs if init failed.

If after init there are no outputs KWin is in a state where it won't
be functional. Thus the platform emits the initFailed signal to
terminate.

BUG: 365242
FIXED-IN: 5.7.2

Test Plan: No hardware to reproduce the condition

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2135
8 years ago
Martin Gräßlin aaf8ce16df [platforms/fbdev] Properly detect a BGR image format
Summary:
If the format of the framebuffer is BGR we cannot create an RGB image
format from it - the rendering is incorrect. Unfortunately QImage does
not support a BGR image format.

To solve this problem we still use an RGB image format but on rendering
the front buffer is rgbSwapped to convert the RGB image to a BGR image.

BUG: 365243
FIXED-IN: 5.7.2

Test Plan: Tested on a neon kvm

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2134
8 years ago
Martin Gräßlin f8d556e630 [autotests/integration] Test another multi-screen setup
The struts test is extended by a setup containing two horizontal
screens, bottom aligned with the left screen smaller than the right.
Thus there is a dead area in the top left corner. In addition there's
a panel on top left screen.

Apparently KWin allowed windows to open in the dead area. The test
case reconstructs this by opening a window with the same size hints,
but in the test it's working correctly.
8 years ago
Jonathan Riddell 66174846f1 Update version number for 5.7.1
GIT_SILENT
8 years ago
Jonathan Riddell 231132ea30 Revert "Update version number for 5.7.1"
This reverts commit d5d1f90a6d.
8 years ago
Jonathan Riddell d5d1f90a6d Update version number for 5.7.1
GIT_SILENT
8 years ago
David Edmundson 62d09fad12 Fix shadow rendering calculations
BUG: 365097

Reviewers: #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D2100
8 years ago
Martin Gräßlin 2b5747dccb [autotests/integration] Unload effects before destroying Workspace
Brings in line with behavior in main_wayland.cpp and is needed as
effects might call into Workspace during tear down.
8 years ago
Martin Gräßlin da36fd1c02 [autotests/integration] Try to make SceneQPainterTest::testWindow more robust
It was failing on the CI system due to timing. Reorder the signalspy
creation a little bit in the hope that this makes it pass.
8 years ago
Martin Gräßlin 7610ff49a8 [autotests/integration] Make MoveResizeWindowTest more robust
A few more cases where we need to ensure that the created window is
destroyed before going into next test method.

Interesting observation: the generated window ids are identical.
Possible problem with KWayland::ClientConnection?
8 years ago
Martin Gräßlin ce74d8a5e5 [autotests] Try to make the move_resize_window_test more robust
On build.kde.org it's failing due to Windows being still present in
the next test method. This change tries to destroy them in the test
methods.
8 years ago
Martin Gräßlin 2780639936 [autotest] Add a test to SceneQPainterTest to render a window
New test method which verifies that a newly mapped window is rendered
correctly, that cursor image set on it is rendered correctly, also when
pointer moves.
8 years ago
l10n daemon script e43699c4c5 SVN_SILENT made messages (after extraction) 8 years ago
Martin Gräßlin cf3a1d295c [autotest/integration] Add helper for waiting for a shown ShellClient
Summary:
Many tests create a Wayland window, render it and then wait till it's
created in KWin as a ShellClient. To reduce code duplication the test
helper provides helper methods to wait for the next ShellClient to be
shown and to directly render and wait for the window for that to be
shown.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2057
8 years ago
Martin Gräßlin 513878e20d [autotest/integration] Introduce a Test helper library to have less code duplication
Summary:
A new namespace KWin::Test is added which provides a few helper
functions. It makes it easy to setup a KWayland client connection with
the base set to be able to create a Surface and flags to create
additional interfaces. This replaces the KWayland connection dance in
init() methods. For cleanup() there is also a dedicated helper function.

In addition there are helper functions to:
* render a surface
* create a surface
* create a shell surface
* flush the wayland client connection
* access to the created interfaces - for compatibility with existing code

The idea is to extend this Test library also for other common use cases
like creating an X11 connection and X11 windows, etc.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2053
8 years ago
Martin Gräßlin 1f2b47a83b [autotests/integration] Simplify the cmake for creating a test
Summary:
A dedicated cmake function is added to create a test case. It takes
a NAME, the SRCS and additional LIBS.

Thus it's
integrationTest(NAME myTestCase SRCS test.cpp)

to create a standard integration test.

In addition kwin_wayland_test.cpp is compiled into a static library
to decrease the compile time a little bit.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2052
8 years ago
Martin Gräßlin 055e2b3bb6 [autotests] Add a new test case which can verify the rendering of QPainter Scene
Summary:
The idea behind this autotest is inspired by bug 356328 which produced
incorrect rendering results. Also it's inspired by openQA which performs
image reference comparisons.

This test case tries to go further. It creates reference images which
must match the rendering result exactly. So far the test case verifies
the start condition - kwin started and one frame is rendered with default
cursor in the middle of the screen. And it verifies the moving of the
cursor without any windows shown. Whenever the cursor moves a repaint
should be triggered and the old and new area should be properly
repainted.

To support this the test needs some minor changes in KWin:
* Scene provides a frameRendered signal - needed for waiting on frame
* Scene and SceneQPainter are exported
* SceneQPainter provides access to it's Backend, so that we get to the
 backbuffer
* ScriptedEffectLoader is exported for getting a list of all scripted
 effects - (we don't want fade to manipulate the rendering)

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2046
8 years ago
Martin Gräßlin d9d70cbaaf Find KF5Wayland together with other frameworks
CCBUG: 364928
8 years ago
l10n daemon script ec764e32b6 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"
8 years ago
David Edmundson ff3aced099 Update version number for 5.7.0
GIT_SILENT
8 years ago
Burkhard Lück 94e7adc53c killer/ moved to helpers/killer 8 years ago
l10n daemon script f1cb59ee39 SVN_SILENT made messages (after extraction) 8 years ago
Martin Gräßlin 1d24264e45 [helpers/xclipboradsync] Ensure that KWayland::Client connects through the passed fd
One needs to call ConnectionThread::setSocketFd in order to not have it
connect through the normal socket.

As WAYLAND_SOCKET is set the implementation would call the correct
functionality anyway. This change only ensures that no wrong debug
message gets logged.
8 years ago
Martin Gräßlin 83dca5b524 Properly wait for client activated in XClipboardSyncTest::testSync
Test was failing on build.kde.org, though passing locally. This change
tries to make the test more robust to timing issues which makes it
hopefully pass on build.kde.org again.
8 years ago
Martin Gräßlin e91f34f925 Drop warning regarding ksmserver in sm.cpp
Nobody complained that it doesn't work since the release of Plasma 5.
Thus let's assume that it works fine.
8 years ago
Martin Gräßlin f9baa22f0d Fix unsigned-signed comparison with touch id in input.cpp
The id we internally have is a signed int and might be negative, but
the touch id we get is unsigned. We can savely cast the unsigned to
signed as touch ids are recycled and more than 10 touch points is
unlikely to be useful.
8 years ago
Martin Gräßlin 67f7e8da34 Drop static previous_client from Client::takeFocus
Only set but never read. The debug code for verifying was commented
out as it would no longer compile. Let's just get rid of it completely.
8 years ago
Martin Gräßlin 89b28c32da Correct datatype to qint64 for value returned from QElapsedTimer::elapsed
Was incorrectly passed to a quint64.
8 years ago
Martin Gräßlin a64fd14f9a [effects/zoom] Remove unused variable 8 years ago
Martin Gräßlin 95449e0843 Fix unused parameter warnings 8 years ago
Martin Gräßlin 133a2f0c29 Move killer/ to helpers/killer
All helper binaries invoked from KWin go to helpers subdirectory.
8 years ago
Martin Gräßlin 50569a2580 Move tabbox/autotests to autotests/tabbox
Let's have all autotests in autotests subdirectory instead of spread
out over the source tree.
8 years ago
Martin Gräßlin d6dd4af8cf Rename autotests/wayland to autotests/integration
It's not about Wayland, but more about Integration. It can test both
Wayland and X11 windows.

Reviewed-By: Bhushan Shah
8 years ago
Martin Gräßlin aa215e12cc Expose the transientFor relationship to PlasmaWindowInterface
Test Plan: Compiles

Reviewers: #kwin, #plasma_on_wayland, hein

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D1780
8 years ago
Martin Gräßlin c9984094de Add support for ToolTip Role on PlasmaSurface
Summary:
It's mapped to be on all desktops in order to properly have tooltips
show for the panel (which is on all desktops) instead of just on the
desktop it's created.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2032
8 years ago
Martin Gräßlin 3493e97655 Support for syncing the clipboard from X11 to Wayland and vice versa
Summary:
The clipboard sync is done by a dedicated helper binary launched by
KWin. This helper binary is forced to xcb platform to piggy-back on
Qt's implementation of the X11 clipboard. In addition it implements
the Wayland clipboard - which is much simpler. Reading the Wayland
clipboard is based on the implementation in QtWayland.

KWin internally knows the DataDeviceInterface belonging to the helper
application. Whenever an xwayland client is focussed, this DataDevice
is allowed to set the selection and KWin manually updates the current
selection in the SeatInterface. By that the sync from X11 to Wayland
is implemented. When afterwards a Wayland client is selected, it's sent
the current selection which references the X clipboard and a data
transfer can be initiated in the normal Wayland way.

For the other direction KWin sends the current selection to the helper's
DataDevice whenever an xwayland window is focused. The helper application
reads the Wayland clipboard and sets it on the X11 clipboard. Thus the
Wayland clipboard is synced to X11.

The approach used here will also be useful for implementing a clipboard
manager (aka klipper).

Currently the implementation is not yet fully completed. We need to
make sure that the helper application gets restarted in case of a crash.

Test Plan: See added test case

Reviewers: #plasma_on_wayland, #kwin

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D1973
8 years ago
Martin Gräßlin 4bc0c75df2 Merge branch 'Plasma/5.7' 8 years ago
Martin Gräßlin f79c3f244d On Wayland never try to create a WindowPixmap from an X11 pixmap
Summary:
Our Wayland compositors cannot composite an X11 pixmap. Thus even
if we succeed in creating the pixmap, the changes would not get to
the scene. The code allowed for situation where a surface is not yet
set to fall back to the X11 code path. This can happen for XWayland
windows.

Test Plan: Crash in xclipboardsynctest without the change

Reviewers: #plasma_on_wayland, #kwin

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2010
8 years ago
Martin Gräßlin 758d41d6bf Paint the software cursor directly in SceneQPainter
Summary:
No need to delegate the painting of the software cursor into the backend.
The core has enough information to perform the rendering itself.

This change means less code duplication and all platforms which might use
a software cursor in QPainter compositor gain support for it without any
further adjustments.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2028
8 years ago
Martin Gräßlin 23fb02cce2 Render cursor in multi-screen setup in QPainter Compositor
Summary:
The call to render the cursor was missing in the multi-screen code path
of the QPainter Compositor.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2027
8 years ago
Martin Gräßlin 7ea84cd346 [platforms/drm] If mapping a DrmBuffer for a cursor fails, fallback to software cursor
Summary:
So far the drm platform did not verify whether creating and mapping a
DrmBuffer for a cursor works. This could result in a crash in the worst
case.

This change verfies whether mapping the two cursor buffers works, if
not software cursor is enabled. The code is adjusted to ensure that
none of the cursor buffers is accessed in case software cursor are
enabled.

Please note that right now the drm platform's rendering does not
support software cursors. Thus currently this change results in no
cursor at all. This will be addressed by following patches.

BUG: 364740
FIXED-IN: 5.7

Test Plan:
Verfied that it properly falls back to software cursor,
but could not verify that the crash is actually fixed.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2026
8 years ago
Martin Gräßlin feadcea6ce [platforms] Call setSoftWareCursor in init instead of ctor
Summary:
Platform::setSoftWareCursor creates connections to the Cursor in order
to trigger repaints whenever the cursor position changes. The Cursor is
created before Platform::init is called, but after the Platform is
created. Thus the call needs to happen in init, otherwise the cursor
is not rendered correctly.

BUG: 356328
FIXED-IN: 5.7.0

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2025
8 years ago
Martin Gräßlin fd19db0fbe Properly clip the damage region and windows in SceneQPainter
Summary:
On the framebuffer backend the software rendered cursor was creating
rendering artifacts due to incorrect clipping. This change ensures that
in a single screen setup the clipping is performed correctly. For multi
screen a similar change might be required, but we currently don't have
any a way to test that as framebuffer only supports one screen and other
(visual) platforms don't support the software cursor.

CCBUG: 356328

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D2024
8 years ago
Martin Gräßlin d19f9a96b4 Merge branch 'Plasma/5.7' 8 years ago
Martin Gräßlin 3c6dff75d5 Stop composite timer when Workspace gets destroyed
On Wayland tear down the Workspace gets destroyed before the Compositor
gets destroyed. If the timer fires in that area, the Compositor would
crash. It's not possible to start the timer if the Workspace is
destroyed, thus it should also be stoped on Workspace destroy.

Reviewed-By: Bhushan Shah
8 years ago