Commit Graph

22 Commits (7e8facc3fde853a93683554e5fc9bfd4985e4760)

Author SHA1 Message Date
Vlad Zagorodniy 862bf0f153 [effects/scale] Port to JavaScript
Summary:
Now, when the scripting effects API has all required ingredients to port
the Scale effect to JavaScript we finally can do it.

The main rationale for porting this effect to JavaScript is that
scripted effects API lets us focus more on what we want instead of
"how".

Visually, the ported version doesn't deviate from the C++ version.

Test Plan:
* Enable the Scale effect;
* Open/close a window.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16478
2018-10-29 10:17:21 +02:00
Vlad Zagorodniy eb78b1ca3a [effects] Re-implement the Minimize Animation effect in JavaScript
Summary:
There were several reasons to rewrite the Minimize Animation effect in
JavaScript: to simplify code and to get rid of full repaints. One could
say that nothing prevents us from calculating the dirty region in
postPaintScreen or postPaintWindow and it is correct, but with the
scripting effects API the dirty region will be calculated for us, so we
can focus more on "what we want" instead of "how".

Visually, the "old" effect and the rewritten one look quite the same.
Except one tiny bit: if a window doesn't have an icon in the task manager,
it won't be animated. The reason for that is the purpose of this effect is
to show where the window will be after it's minimized, if the window
doesn't have icon in the task manager, one can't click at the center of
the screen to unminimize the window.

There is one significant change, the name of the effect was changed to
"Squash". If we put this effect and the Magic lamp effect under "Window
Minimize Animation" category (or if we add some "heading" label), then
the old name and the name of the category would "conflict". The new name
was suggested by Nate Graham and it very closely describes what the
effect does. "Scale" doesn't fit this effect because while a window is
being animated, its aspect ratio is not preserved.

Reviewers: #kwin, #plasma, davidedmundson

Reviewed By: #kwin, #plasma, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16372
2018-10-23 16:57:07 +03:00
David Edmundson 7e7eadb44f [autotests] Make lifespan of EffectsHandler outlive Effect
Summary:
In loading tests. Effects are deleted in a deleteLater potentially
outside the scope of our test. Our MockEffectsHandler (which contains
the global static "effects") has the lifespan of the test.

Fixes failing unit test.

Test Plan: Ran test

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15167
2018-08-30 14:57:13 +01:00
Vlad Zagorodniy 4299b81f65 [effects] Drop the Scale in effect
Summary:
It's superseded by the new scale effect(D13461).

Existing users of this effect will be migrated to the new scale effect.

Depends on D13461

Reviewers: #kwin, #plasma, #vdg, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13462
2018-08-12 10:58:07 +03:00
Vlad Zagorodniy 9d197e8cb6 [effects] Add Scale effect
Summary:
The new effect scales windows as they appear and disappear.

As the the most of window animation effects, it is a monolithic effect,
i.e., if you enable scale effect, it will animate *both* the appearing and
disappearing.

The main difference between the Scale effect and the Scale in effect is
that the Scale in effect only animates windows as they appear. There is
no corresponding "the Scale out" effect, which is odd. Other points that
differentiate the Scale effect from the Scale in effect:

* it is more subtle;
* it doesn't animate the log out screen;
* it doesn't conflict with the Fade effect, etc.

... and overall, the Scale effect supersedes the Scale in effect.

{F5904947}

//Window open animation.//

{F5904948}

//Window close animation.//

{F5905283, layout=center, size=full}

//KCM.//

Test Plan:
* Enabled this effect
* Opened/closed System Settings

Reviewers: #kwin, #plasma, #vdg, davidedmundson

Reviewed By: #kwin, #plasma, #vdg, davidedmundson

Subscribers: ngraham, davidedmundson, fvogt, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13461
2018-08-12 10:57:41 +03:00
David Edmundson a3cff85e7a Remove Qt module declarations in includes
Summary:
Test Plan: Compiles

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13359
2018-06-05 18:07:23 +01:00
Martin Gräßlin 1e13deaa1d Port some displayWidth/displayHeight usages to Screens::size()
Summary:
KWin::displayWidth and KWin::displayHeight are bound to X11 which
doesn't make much sense on X11. In addition KWin internally knows
the overall display dimensions through the Screens singleton class.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D1798
2017-09-01 17:11:10 +02:00
Martin Gräßlin 2be1625822 Add support for new touch screen callbacks to KWin scripts and scripted effects
Summary:
Exposes two new global JS functions to register and unregister touch
screen edges.

Test Plan: Added test case

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5277
2017-04-07 16:18:09 +02:00
Kai Uwe Broulik 1eb950a985 Desaturate non-responsive windows
When an application is not responding, its window is desaturated to communicate this.
Also "(Not Responding)" is added to the title bar.

Differential Revision: https://phabricator.kde.org/D5245
2017-04-05 11:16:23 +02:00
Marco Martin a7b7ce9ec0 new logout effect
Summary:
new logout effect: it's just a slow fade in of the logout
greeter (window is usable immediately tough

Test Plan: logout greeter now fades in without setting the window opacity manually

Reviewers: graesslin, #plasma

Reviewed By: graesslin, #plasma

Subscribers: broulik, plasma-devel, kwin, #kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5045
2017-03-15 17:47:22 +01:00
Martin Gräßlin 2cc55e4077 [effects] Add a colorpicker effect
Summary:
The effect exports itself to DBus as object "/ColorPicker" and provides
an own interface "org.kde.kwin.ColorPicker".

It has one exported method to DBus "pick" which returns a QColor. When
invoked an interactive position picking selection is started. If it ends
the effect reads the color value at the picked position from the OpenGL
color buffer.

This implements T4568.

Reviewers: #kwin, #plasma_on_wayland, broulik

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3480
2016-11-25 09:30:34 +01:00
Martin Gräßlin 6184278bec Fix for failing testScriptedEffectsLoader
By changing the loading of scripted effect config to interact with
kwinApp we broke the tests which do not use a kwinApp.

This change turns the access to the KSharedConfigPtr go through the
property system, so that the tests can also install a dummy
KSharedConfigPtr. With that scripted effects loader test passes and no
longer crashes and the integration/effects tests also still pass.
2016-11-16 16:53:17 +01:00
Martin Gräßlin d68a3fecd7 [autotests] Use QTR_COMPARE instead of QTest::qWait in TestScriptedEffectLoader
Hopefully makes the test more reliable on build.kde.org.
2016-08-16 14:08:07 +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 2273fc0559 Cancel the EffectLoader query on clear
The Scripted and PluginEffectLoader perform locating all effects which
are to be loaded in a thread. When the EffectLoader gets cleared so far
the query did not get canceled. This resulted in effects maybe getting
loaded.

This problems shows on build.kde.org if the test is too fast and tears
down the Effect system while effects are still being queried.

Reviewed-By: David Edmundson
2016-04-26 15:01:15 +02:00
Martin Gräßlin fd692ecf07 [autotest] Adjust TestScriptedEffectLoader::testLoadAllEffects for morphingpopups
A new default effect means a new line in the mock config.
2016-02-17 15:27:06 +01:00
Martin Gräßlin 5f8e8985df [autotests] Dashboard is no longer available
Sorry for breaking the autotest.
2015-10-19 14:17:04 +02:00
Martin Gräßlin bffbbce172 [scripting] Add dedicated logging category 2015-07-31 13:25:51 +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 cfe84aa9de [autotests] Fix TestScriptedEffectLoader::testLoadAllEffects 2015-04-09 14:58:05 +02:00
Daniel Pastushchak 0d997b1093 Introduce categorized logging for kwin core
Done by Daniel Pastushchak for KDE during GCI-2014.
2014-12-05 14:27:15 +01:00
Martin Gräßlin ba12fe3cc0 [kwin] Add a ScriptedEffectLoader
This implementation of the AbstractEffectLoader is able to to load the
scripted KWin Effects. It uses KServiceTypeTrader to find all the
candidates to load.
2014-03-28 14:04:54 +01:00