Commit graph

303 commits

Author SHA1 Message Date
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
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
Allen Winter
31f067ede2 pedantic fixes 2016-07-16 13:14:44 -04:00
l10n daemon script
0990566c63 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2016-05-31 11:06:54 +00:00
Marco Martin
a104a4af7f try more aggressively to retarget
instead of deleting all animations when one is over,
try to retarget them all, and redo them only
if retargeting fails

REVIEW:127101
2016-02-26 10:28:47 +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
Thomas Lübking
c9c86f29fb fix retargetting script export
pushed wrong branch, this fixes the wrong parameter count

REVIEW: 126981
2016-02-16 15:07:27 +01:00
Thomas Lübking
070b85bbcf export retarget to scripts 2016-02-16 13:59:22 +01:00
Marco Martin
5e6f0b8b4f make animate() return something JS understands
the result of animate is an array of animids: in order for
dumb QScript to understand what it is, we have to build it
as an actual JavaScript Array
reviewed-by: Martin Gräßlin <mgraesslin@kde.org>
2016-02-10 16:58:37 +01:00
Kevin Funk
8ea4f4dae7 Port to CMake AUTOMOC
Summary: Run convert-to-cmake-automoc.pl over all .cpp files

Differential Revision: https://phabricator.kde.org/D882
2016-02-01 21:05:36 +01:00
Martin Gräßlin
757523a324 Use kwinApp()->config() instead of KSharedConfig::openConfig()
That way all over kwin we can inject a custom config in the autotests.
2016-01-29 11:24:18 +01:00
Nick Shaforostoff
3a8d7d866a optimize string operations
-use qstringliteral only when necessary (i.e. not in concat or comparison)
-use qbytearray instead of qstring when dealing with latin1 input and output (glplatform)
-use qstringref to extract numbers from strings (glplatform)
-define qt_use_qstringbuilder to optimize all string concatenations
-anidata: use ctor init lists, add windowType member initialization

REVIEW: 125933
2015-11-05 14:14:06 +00:00
l10n daemon script
c342be5961 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"
2015-10-03 11:20:49 +00:00
Martin Gräßlin
3139dcd3b9 Drop cmakedefine HAVE_WAYLAND
Now a required build dependency.
2015-08-12 11:39:20 +02:00
Martin Gräßlin
bffbbce172 [scripting] Add dedicated logging category 2015-07-31 13:25:51 +02:00
Martin Gräßlin
a1a89d3d1e Disable Activities support on Wayland
This is a temporary workaround for bug 349992 which causes freezes
during startup as kwin and kamd dead lock each other on DBus.

To workaround we don't call Activities::create and check in every
usage of Activities::self() whether the pointer is valid.

As a result kwin_wayland now starts pretty fast.

CCBUG: 349992
2015-07-07 11:48:42 +02:00
Martin Gräßlin
b01b03aa84 [scripting] Find scripts through KPackage
Another sycoca usage gone.
2015-07-07 08:48:24 +02:00
Martin Gräßlin
ca14073b54 Port scripted effect loading from KService to KPackage
Advantage: no more ksycoca cache for loading scripted effects.
2015-07-06 16:50:33 +02:00
Martin Gräßlin
11e0e75fb3 Add a signal Toplevel::windowHidden
Signal is connected in ScriptingModel together with windowShown.
2015-06-10 17:45:59 +02:00
Martin Gräßlin
034276af36 Move clientMaximizedStateChanged signal from Client to AbstractClient 2015-06-07 03:17:34 +02:00
Martin Gräßlin
b196ad7052 [scripting] Add support for ShellClients in ScriptingClientModel 2015-06-06 22:11:10 +02:00
Martin Gräßlin
c4c637db92 [scripting] ScriptingClientModel operates on AbstractClient 2015-06-06 18:53:55 +02:00
l10n daemon script
99237c9b3f 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"
2015-06-01 10:08:03 +00:00
Martin Gräßlin
51bb4cf2a1 [scripting] Register KWin::AbstractClient in declarative scripts 2015-05-12 11:32:05 +02:00
Martin Gräßlin
f55c086007 Change Workspace::clientRemoved to carry an AbstractClient
At the same time emit it when a ShellClient get's removed. This ensures
it gets removed from e.g. the FocusChain.
2015-05-08 12:43:47 +02:00
Martin Gräßlin
38b418887a Move minimize implementation to AbstractClient 2015-05-08 12:43:47 +02:00
Martin Gräßlin
1bfba1765c Signal desktopPresenceChanged carries AbstractClient as argument 2015-05-08 12:43:47 +02:00
Martin Gräßlin
16568804be Demands Attention handling in Workspace operates on AbstractClient
Affects:
* list attention_chain
* clientAttentionChanged
* clientDemandsAttentionChanged
2015-05-08 12:43:47 +02:00
Martin Gräßlin
9457b362c1 Drop not needed dynamic cast in WorkspaceWrapper::setActiveClient 2015-05-08 12:43:46 +02:00
Martin Gräßlin
8cfe0a9316 Workspace::clientActivated signal changed to AbstractClient
connections changed to new connect syntax to ensure they are correct.
2015-05-08 12:43:45 +02:00
Martin Gräßlin
3ad117ac28 Workspace::activeClient returns an AbstractClient
Still a few casts in some areas as setting activeClient still takes
a Client.
2015-05-08 12:43:45 +02:00
Martin Gräßlin
4b41c33268 Workspace::movingClient changed to AbstractClient
In events.cpp it's casted to Client as it's X11 specific.
In InputRedirections it's kind of broken, but window movement is
anyway broken.
2015-05-08 12:43:45 +02:00
Martin Gräßlin
4eb9a98f1a [scripting] actionsForUserActionMenu operates on AbstractClient 2015-05-08 12:43:45 +02:00
Thomas Lübking
83a42c55be ScriptedEffect: gauss curve anim and ended signal
latter allows to chain actions in scripted effects
and former prevents the need to do that for a continuous
in/out animation
2015-04-07 23:59:18 +02:00
Thomas Lübking
060f3e9403 Remove AnimationData wrapper around metadata.
Instead allow to set metadata directly in animation
objects

REVIEW: 122679
2015-04-07 23:59:18 +02:00
Mika Allan Rauhala
2217c1038f Add Quick Tile Window to the Top and Bottom shortcuts
This adds "Quick Tile Window to the Top" and "Quick Title Window to the Bottom" shortcuts. These are
useful for those using displays that are in portrait orientation.

CCBUG: 310005
REVIEW: 123153
2015-03-31 11:10:13 +02:00
Christophe Giboudeaux
bea55dc614 -Wmissing-include-dirs 2015-03-22 22:36:26 +01:00
l10n daemon script
bf7bf73464 SVN_SILENT made messages (.desktop file) 2015-01-15 09:02:26 +00:00
l10n daemon script
d173ff7412 SVN_SILENT made messages (.desktop file) 2015-01-13 12:47:17 +00:00
Martin Gräßlin
66df3eefdf Cleanup: reduce usage of QDesktopWidget 2014-11-27 09:32:43 +01:00
Martin Gräßlin
b7a8bb4f52 Drop build option KWIN_BUILD_SCREENEDGES
The build option got introduced for Plasma Active back in a time
when we did not properly aim for convergence. In a Plasma 5 world
we want to have only one shell and one window manager which adjust
itself. This means we don't want a differently compiled kwin for
plasma active, but the same one. Thus the build option doesn't
make much sense any more. A KWin for touch interface needs to support
screenedges for the case that mouse is plugged in.

CCBUG: 340960
REVIEW: 121200
2014-11-24 10:48:49 +01:00
Martin Gräßlin
482f89b91f Fix build without KF5Activities
BUG: 340961
FIXED-IN: 5.2.0
REVIEW: 121202
2014-11-24 10:47:08 +01:00
l10n daemon script
45b1af3165 SVN_SILENT made messages (.desktop file) 2014-10-29 08:42:18 +00:00
l10n daemon script
91ff859d5f SVN_SILENT made messages (.desktop file) 2014-09-27 09:33:56 +00:00
l10n daemon script
fd8006c546 SVN_SILENT made messages (.desktop file) 2014-09-24 08:30:00 +00:00
Martin Gräßlin
c00c67bf29 [scripting] Drop qmlRegisterType for QQuickWindow
Not needed as one can just do:
import QtQuick.Window;

This fixes a build problem with Qt 5.4.

BUG: 338277
2014-09-03 09:47:21 +02:00
l10n daemon script
28c7f3c47d SVN_SILENT made messages (.desktop file) 2014-06-29 08:41:34 +00:00
Martin Gräßlin
8aa8617ed4 Drop our custom KLocalizedTranslator
It's upstreamed to ki18n framework.
2014-06-18 15:02:58 +02:00
Martin Gräßlin
0c4aaaf4ad [scripting] Support loading translations for UI loaded configs
Scripts and scripted effects can provide a ui file which gets loaded at
runtime. Obviously such a ui file is not translated. This introduces
quite a hack to load the translated strings.

In the metadata.desktop file the scripted component can provide a key
X-KWin-Config-TranslationDomain. The genericscriptedconfig tries to
locate the metadata.desktop file and reads this entry. If it is present
we extract all string properties of the loaded UI and pass them through
ki18nd.

REVIEW: 118585
2014-06-10 15:49:19 +02:00
l10n daemon script
e73f6b2278 SVN_SILENT made messages (.desktop file) 2014-06-10 10:37:36 +00:00