Commit graph

16518 commits

Author SHA1 Message Date
Vlad Zagorodniy
688d946ffb [libkwineffects] Gracefully release previous window pixmap
Summary:
If the cross fade animation is cancelled, we are not gracefully
unreference the previous window pixmap.

This change addresses that issue by using RAII approach to
reference/unreference the previous window pixmap.

Test Plan: Manually. The Maximize and the Morphing Popups effect still work.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16391
2018-11-12 12:51:08 +02:00
Vlad Zagorodniy
93abb9a273 Don't cache value of popupWindow property in EffectWindow
Summary:
With the plasma shell protocol, a ShellClient gets its role/window type
after it's created, so the cached value of the popupWindow property in
EffectWindow can be wrong.

In addition to that, the value of the popupWindow property still can be
wrong because plasma shell surfaces don't have xdg-popup role, so we need
to check NetWM-based window type in ShellClient::isPopupWindow.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16835
2018-11-12 12:47:55 +02:00
David Edmundson
5da8b4c78a Explicitly link and disable kcrash on kwin_wayland
Summary:
Kwin tried to not use kcrash by not linking against it.

KIO now links against KCrash as we link against KIO we indirectly link
against KCrash and thus now link and launch kcrash on wayland. This
breaks coredump.

Arguably it should be fixed in KIO, but it's non-trivial.

The advantage of this approach is it allows us to enable drkonqi for
nested mode in the future, or make a non-gui drkonqi that just saves
logs.

Test Plan: Compiles

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: zzag, romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16834
2018-11-12 09:59:57 +00:00
l10n daemon script
3a75ef844e 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"
2018-11-12 05:53:45 +01:00
Bhushan Shah
e455e34969 effects: attempt to screenshot on OpenGL ES 2.0 instead of failing
Summary:
Current code path was attempting to use both framebuffer blit and
glReadPixels on OpenGL ES, instead change the code to use framebuffer
blit and glGetTexImage on OpenGL and glReadPixels on the OpenGLES as it
doesn't have glGetTexImage available.

Test Plan: tested on Nexus 5X.

Reviewers: #kwin, davidedmundson, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Maniphest Tasks: T10011

Differential Revision: https://phabricator.kde.org/D16802
2018-11-11 19:03:50 +05:30
Roman Gilg
21aee588af Initialize Wayland output in AbstractOutput
Summary:
Wayland output is on protocol level and not dependent on the hardware
platform. Next steps are to do the same for output device and then let
the virtual output call into these initializing functions as well.

Test Plan: Manually and auto test.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16783
2018-11-09 19:47:23 +01:00
Martin Flöser
c003db22c6 Build KF5IdleTimeKWinWaylandPrivatePlugin in correct directory
Summary: Ensures that we can load the plugin when running only from build dir.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16762
2018-11-09 17:39:29 +01:00
Martin Flöser
e45d3fe5a4 Add a TESTING.md document describing how to run the unit test suite
Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16777
2018-11-09 17:39:01 +01:00
Martin Flöser
9f6b0f98b5 Fix the way how we quit kactivitymanagerd from the unit test
Summary:
Kactivitymanagerd is a libexec executable now so we cannot just execute
it and cannot know it's path. We need to stop it as otherwise ctest does
not terminate the testActivities. This change uses dbus to quit the
kactivitymanagerd.

Test Plan: ctest did not timeout on testActivities

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16780
2018-11-09 17:27:07 +01:00
Martin Flöser
54eb3bf137 Copy the aurorae decoration qml plugin to bin dir in build directory
Summary:
Look there, another plugin I didn't remember. The other qml files are
not needed for the aurorae autotest as it's for the svg based themes
instead of qml themes like Plastik.

Test Plan: Further destroyed my system, test failed, with this change passed.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16761
2018-11-09 09:27:34 +01:00
Martin Flöser
74cdd242a4 Support starting the killer_helper from build dir
Summary:
As with all libexec executables we first need to test whether the binary
is available in the application's directory and start this, otherwise
the system wide installed one.

See: https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16763
2018-11-09 09:24:50 +01:00
Martin Flöser
97beb72d32 Support starting the rules_dialog from build dir
Summary:
As with all libexec executables we first need to test whether the binary
is available in the application's directory and start this, otherwise
the system wide installed one.

See: https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16765
2018-11-09 09:24:33 +01:00
Vlad Zagorodniy
bf19c41bc7 [effects/translucency] Use strict mode for the whole script 2018-11-08 14:37:22 +02:00
Vlad Zagorodniy
26e67f61e2 [effects/windowaperture] Use strict mode for the whole script 2018-11-08 14:32:47 +02:00
Vlad Zagorodniy
abf6c6927c [autotests] Fix maximize test
Summary:
testMaximizedPassedToDeco was failing because it didn't handle async
maximization.

testBorderlessMaximizedWindow was failing because setNoBorder can modify
geometry, so we end up with a wrong restore geometry.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16755
2018-11-08 14:10:57 +02:00
Martin Flöser
80d0915cf8 [aurorae] Print qml errors during instantiation of qml based deco
Summary:
So far we didn't know why plastik wasn't loaded. Now we get the error
messages.

Test Plan: Saw error messages while investigating failing KWin test

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16753
2018-11-08 10:38:35 +01:00
Martin Flöser
ee68994419 Build plastik plugin at correct location in build tree
Summary: The tests running Aurorae need to be able to pick up the plastik plugin.

Test Plan: Removed system install of plastik plugin, now test passes

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16752
2018-11-08 09:52:54 +01:00
Martin Flöser
543b6955d4 Add more debug output around starting the x clipboard syncer process
Summary:
Trying to get some more information on why the related test fails on
build.kde.org.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16748
2018-11-08 08:44:43 +01:00
Martin Flöser
c19627b492 Copy plastik window decoration to build directory
Summary:
This ensures that DontCrashAuroraeDestroyDecoTest can load the plastik
window decoration when run from build directory as it happens on
build.kde.org.

Test Plan: Test passes now when manipulating XDG_DATA_DIRS to hide system install

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16745
2018-11-08 08:31:17 +01:00
l10n daemon script
9554017450 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"
2018-11-08 06:03:02 +01:00
David Edmundson
47d87cd94f [autotests] Handle async maximisation in quick tiling test
Summary:
KWin now correctly updates the client maximised state when we have a new
buffer in the new state. The quick tile unit test was unfortunately not
updated.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16739
2018-11-08 01:50:51 +00:00
Martin Flöser
0e839c4dda Unset XKB_DEFAULT_* in tests to make tests better reproducable
Summary:
On one of my systems XKB_DEFAULT_LAYOUT is set to "de". This makes a few
tests fail, e.g. pointer input and modifier only shortcuts.

The reason is that those tests assume the xkb default layout behavior,
that is how xkb functions without any layout being set. So having the
env variable around influences the layout generation.

To prevent this the environment variables are unset and thus a
reproducable environment is created.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16737
2018-11-07 20:10:58 +01:00
Martin Flöser
e637d43211 Remove potential endless loop from XClipboardSyncTest
Summary:
We need to wait till the helper process created the datadevice. For this
we used a while loop. On build.kde.org the test gets stuck in this loop
and times out after 10 minutes.

This change introduces a dedicated signal and we just wait for it. So if
something fails we wait only 5 sec instead of endless. This should help
investigate why the test doesn't work on build.kde.org.

Test Plan: Test works locally

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16741
2018-11-07 20:10:32 +01:00
Vlad Zagorodniy
f466307277 [libkwineffects] Use correct type for the desktops property
Summary:
Type of the x11DesktopIds property was changed from QList<int> to
QVector<int> in KWin core, but not in libkwineffects. That resulted in
having effects like slide not working because Qt can't implicitly
convert QVector<int> to QList<int>.

Test Plan: Slide effect works again.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16743
2018-11-07 21:06:37 +02:00
Vlad Zagorodniy
7b08886e71 Merge branch 'Plasma/5.14' 2018-11-07 19:37:03 +02:00
Vlad Zagorodniy
ad28da84e7 [effects/slidingpopups] Don't crash when sliding virtual desktops
Summary:
If you switch virtual desktops while krunner is sliding in, then
depending on whether your distro strips assert statements away,
KWin can crash.

The reason why it crashes is the sliding popups effect tries to unref
deleted windows that it hasn't referenced before (if there is an active
full screen effect, then popups won't be slided out, which in its turn
means that we won't reference deleted windows). So, in the end, the
refcount of those windows can be -1. That triggers an assert statement
in the destructor of the Deleted class, which checks whether the
refcount is equal to 0.

Popups are not slided while there is an active full screen effect because
we don't know what the full screen effect does.

This patch adjusts the sliding popups effect so it stops all active
animations when user switches virtual desktops or when a full screen
effect kicks in. We need to do that so the effect won't try to
unreference windows in postPaintWindow.

Visually, it doesn't look quite nice, but for now that's good enough.
A proper fix would be more complex: we would need to make sure that
full screen effects ignore sliding popups (and also maybe docks) and
perform some input redirection.

BUG: 400170
FIXED-IN: 5.14.4

Test Plan: I'm not able anymore to reproduce bug 400170.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: davidedmundson, graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16731
2018-11-07 19:22:31 +02:00
David Edmundson
d2648c6c77 [wayland] Fix arguments to clientMaximizedStateChanged(bool, bool)
Summary:
It should be indicating the current state of horizontal and vertical
maximisation not whether it changed or not.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16740
2018-11-07 16:32:56 +00:00
David Edmundson
62d334eb61 [wayland] Move AbstractClient::desktops from QList to QVector
Summary:
Doesn't have any meaningful impact. It's the same performance when T is a pointer,
but it'll bring it consistent with VirtualDesktopManager::desktops

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16736
2018-11-07 16:22:59 +00:00
David Edmundson
c42d160742 [TabBox] Fix Arrow Key / Keyboard Events in QML Alt+Tab Skins
Summary:
KWin used to do a quirky trick to send key events to the topmost QQuickItem
rather than things going to the activeFocus item.

Sending it to the window previously would have failed as the window
didn't think it was active.

Since 66986d4afd we can just let the
window process the events in a normal QtQuick manner.

BUG: 370185
Fixed-in: 5.15.0

It will require tabboxes to set focus correctly.
The ones I tested did.

Most analysis for this patch was done by Chris Holland.

Test Plan:
Held+alt tab with the "Text" tabbox switcher
pressed up and down

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin, Zren

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16693
2018-11-07 16:22:59 +00:00
Martin Flöser
7221864cd2 Start xclipboard sync process from build dir if available
Summary:
The xclipboard sync test times out on build.kde.org as KWin is not
installed prior to running the tests. This is due to KWin not finding
the executable for the clipboard sync helper.

This change looks whether the binary exists in the same directory as
KWin's executable. If it exists it is started instead of the hardcoded
path in libexec.

Test Plan: Run the test and verified the correct binary is loaded

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16732
2018-11-07 15:19:25 +01:00
Martin Flöser
f27f8a267f Fix slidingpopupstest when run without installtion
It tries to load scripted effects, so needs same adjustement.
2018-11-07 10:51:07 +01:00
Martin Flöser
43fc7f1bad Fix FadeTest and TranslucencyTest when started without install
Summary: Search in build dir for the effects.

Reviewers: #kwin

Differential Revision: https://phabricator.kde.org/D16683
2018-11-07 09:34:38 +01:00
Martin Flöser
c36f9d2980 Fix test of scriptedeffectsloader when run from build directory without install
Summary:
On build.kde.org all tests loading scripted effects are failing. This
seems to be because the effects are not installed.

To make this work, this change introduces the following changes:
 * scripted effects are copied to ${build}/bin, like all binaries
 * the test sets XDG_DATA_DIRS env variable to point to ${build}/bin

This change also needs to be added to further tests once this is
accepted. Furthermore it could be considered whether KPackageLoader
should consider the QCoreApplication::applicationDirPath in addition to
the GenericDataLocation. This would make KPackageLoader work much better
in a build tree only setup.

Test Plan: Test passes locally, obviously not tried on build.kde.org

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16682
2018-11-07 09:34:18 +01:00
Martin Flöser
a04b9da61e Re-evaluate the window rules when the window class of a Client changes
Summary:
So far KWin did not re-evaluate the window rules when the Client's
window class changes. Window class is the main (static) feature the rule
selection is based on. For dynamic changing mapping features like caption
KWin does re-evaluate the rules.

The reason for KWin to not evaluate when the class changes is that KWin
expects the class not to change. From ICCCM section 4.1.2.5:

 > This property must be present when the window leaves the Withdrawn
 > state and may be changed only while the window is in the Withdrawn
 > state. Window managers may examine the property only when they start
 > up and when the window leaves the Withdrawn state, but there should be
 > no need for a client to change its state dynamically.

Unfortunately there are prominent applications such as Spotify which
violate this rule and do change the window class dynamically. While this
is a clear ICCCM violation there is nothing which really forbids it (may
not != must not) and nothing which forbids KWin to react on changes.

As also libtaskmanager started to react on it, it makes sense to also
hook up the required bits for window rules. After all KWin detects
changes to the window class for some time already and has the
functionality to evaluate the rules. So all there is, is one connect
which improves the situation for our users, while at the same time it
should be rather risk free. If a setup window rule breaks after this
change it's due to the client not being ICCCM compliant.

Test Plan:
I don't use any of the affected applications, so it's only
tested with the new added unit test.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16670
2018-11-07 09:33:39 +01:00
David Edmundson
18ff596996 Update version number for 5.14.3
GIT_SILENT
2018-11-06 10:23:49 +00:00
l10n daemon script
6ce1152243 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"
2018-11-06 06:01:41 +01:00
Vlad Zagorodniy
b6fe7dc115 [effects/eyeonscreen] Move "use strict" to the beginning of the script 2018-11-05 22:05:56 +02:00
Frederik Gladhorn
66986d4afd Make QPA think the tabbox is the active window
Summary:
Without pretendingn to activate the Window, Qt will not send
the right signals for accessibility, thus screen readers not working.

Reviewers: kwin, davidedmundson

Reviewed By: davidedmundson

Subscribers: graesslin, davidedmundson

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16664
2018-11-05 18:21:57 +01:00
Vlad Zagorodniy
47c8405388 [effects/snaphelper] Do massive overhaul
Summary:
This patch fixes some of issues that the Snap Helper effect currently
has:

* If a window is being moved, there are visual artifacts (cause: missing
  addRepaint's);
* It uses addRepaintFull;
* For some reason, if a window goes deleted, it will be kept around as
  long as the Snap Helper effect needs it (visually, it doesn't look
  good).

Among other changes:
* Use variables to store color and width of grid lines;
* Use new connect syntax;
* Port to TimeLine;
* Fix coding style in some places.

Test Plan:
Tried the effect with different rendering backends, no longer see visual
artifacts when moving or resizing windows.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, abetts, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15695
2018-11-05 16:59:19 +02:00
Vlad Zagorodniy
c081f2224f [effects/squash] Put "use strict" at the beginning of the script 2018-11-05 11:50:53 +02:00
Vlad Zagorodniy
6ca1c310fe [effects/maximize] Put "use strict" at the beginning of the script 2018-11-05 11:48:56 +02:00
Vlad Zagorodniy
0155ee1a03 [effects/morphingpopups] Put "use strict" at the beginning of the script 2018-11-05 11:46:19 +02:00
Vlad Zagorodniy
55dec40704 [effects/login] Put "use strict" at the beginning of the script 2018-11-05 11:43:16 +02:00
Vlad Zagorodniy
2fac31b401 [effects/logout] Put "use strict" at the beginning of the script 2018-11-05 11:40:39 +02:00
Vlad Zagorodniy
a652aaf345 [effects/scale] Put 'use strict' at the beginning of the script
Summary: This removes unnecessary duplication.

Test Plan: QtScript doesn't support 'use strict', so the effect still works.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16661
2018-11-05 11:28:20 +02:00
Vlad Zagorodniy
6d93d9f353 [effects/frozenapp] Put "use strict" at the beginning of the script
Summary: This removes unnecessary duplication of "use strict".

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16662
2018-11-05 11:27:51 +02:00
Frederik Gladhorn
456cbb9bf7 Remove unused private Qt include
Summary:
Ideally KWin would not depend on private headers... but at least we can
remove unused ones.

Test Plan: still builds, I don't see anything requiring the header.

Reviewers: zzag

Reviewed By: zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16655
2018-11-04 17:02:19 +01:00
Frederik Gladhorn
503661579f Remove unused FindQt5PlatformSupport.cmake
Summary: This file was required for Qt 5.8. We require 5.11 as minimum version.

Test Plan: Grepped for the file being used in other cmake code, rebuilt KWin without it.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin, zzag

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16654
2018-11-04 17:01:49 +01:00
Vlad Zagorodniy
bd47b51058 [effects/scale] Don't animate popups on Wayland
I made a horrible typo("popup" vs "popupWindow"), which went
unnoticeable during code review and while I was testing the ported
effect on Wayland.

Because this change is pretty trivial (fixing a typo), I didn't put it
on review.
2018-11-04 14:54:56 +02:00
l10n daemon script
4c38c0dcc3 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"
2018-11-04 06:08:46 +01:00