Commit graph

660 commits

Author SHA1 Message Date
David Edmundson
5d279a0ddd [autotests] Unit most scripted effects API
Summary:
Ready for QJSEngine port and upcoming other fixes.
Split as it makes it easier to do any before/after testing.

Test Plan:
All tests pass with the current QScriptEngine
Verified expected API against a wiki page and current code.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14482
2018-07-31 12:29:04 +01:00
David Edmundson
7b65aa9199 [libkwineffects] Remove broken copy constructor of AniData
This doesn't copy everything, it misses the ID which breaks
everything.

Given it's just a direct copy of members the auto-generated one does a
better job
2018-07-31 12:29:00 +01:00
Vlad Zagorodniy
653e98d5ac [libkwineffects] Deprecate Outline feature
Summary:
KWin had Outline effect during KDE SC times, which had been removed in
KDE SC 4.11. With that effect, also showOutline and hideOutline signals
had been removed, making it impossible to write effects that show
outline. Yet, Outline enum value had been left.

Even though the Outline feature is useless nowadays, in order to keep API
compatibility, let's just deprecate it.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14188
2018-07-17 18:09:31 +03:00
Vlad Zagorodniy
709b7c2c58 [libkwineffects] Push render targets more efficiently in GLRenderTarget::pushRenderTargets
Summary:
If s_renderTargets is not empty, GLRenderTarget::pushRenderTargets starts
to do pretty heavy things: it deletes head of the targets param in a while loop.

There is no need to do that. Because QStack inherits QVector, we can use
append method to push new render targets in a more efficient way.

Test Plan: Background behind Konsole is still blurred.

Reviewers: #kwin, mart

Reviewed By: #kwin, mart

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13823
2018-07-03 12:33:04 +03:00
Vlad Zagorodniy
ee88951b17 [libkwineffects] Add TimeLine helper
Summary:
Most effects use QTimeLine in the following manner

```lang=cpp
if (...) {
    m_timeline->setCurrentTime(m_timeline->currentTime() + time);
} else {
    m_timeline->setCurrentTime(m_timeline->currentTime() - time);
}
```

Because effects do not rely on a timer that QTimeLine has, they can't
toggle direction of the QTimeLine, which makes somewhat harder to write
effects. In some cases that's obvious what condition to use to figure
out whether to add or subtract `time`, but there are cases when it's
not. In addition to that, setCurrentTime allows to have negative
currentTime, which in some cases causes bugs.

And overall, the way effects use QTimeLine is really hack-ish. It makes
more sense just to use an integer accumulator(like the Fall Apart
effect is doing) than to use QTimeLine.

Another problem with QTimeLine is that it's a QObject and some effects
do

```lang=cpp
class WindowInfo
{
public:
    ~WindowInfo();

    QTimeLine *timeLine;
};

WindowInfo::~WindowInfo()
{
    delete timeLine;
}

// ...

QHash<EffectWindow*, WindowInfo> m_windows;
```

which is unsafe.

This change adds the TimeLine class. The TimeLine class is a timeline
helper that designed specifically for needs of effects.

Demo

```lang=cpp
TimeLine timeLine(1000, TimeLine::Forward);
timeLine.setEasingCurve(QEasingCurve::Linear);

timeLine.value(); // 0.0
timeLine.running(); // false
timeLine.done(); // false

timeLine.update(420);
timeLine.value(); // 0.42
timeLine.running(); // true
timeLine.done(); // false

timeLine.toggleDirection();
timeLine.value(); // 0.42
timeLine.running(); // true
timeLine.done(); // false

timeLine.update(100);
timeLine.value(); // 0.32
timeLine.running(); // true
timeLine.done(); // false

timeLine.update(1000);
timeLine.value(); // 0.0
timeLine.running(); // false
timeLine.done(); // true
```

Test Plan: Ran tests.

Reviewers: #kwin, davidedmundson, graesslin

Reviewed By: #kwin, davidedmundson, graesslin

Subscribers: romangg, graesslin, anthonyfieroni, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13740
2018-06-30 09:58:11 +03:00
Vlad Zagorodniy
f977e60850 [libkwineffects] Save value of the managed property during construction of EffectWindow
Summary:
When windowClosed signal is emitted, effects can't distinguish managed
windows from unmanaged windows(e.g. combo box popups, popup menus, etc).
This leads to dirty hacks like IsXXXWindow. Also, there's a big chance
that such hack can introduce more bugs and overall this makes harder to
write/maintain effects.

This change proposes to save value of managed property during
construction of EffectWindow. So, its value is preserved with Deleted.

Test Plan: Manually.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13690
2018-06-24 17:43:11 +03:00
Vlad Zagorodniy
95a2c3bf76 [libkwineffects] Emit a signal when active fullscreen effect changed
Summary:
Behaviour of some effects depends on presence of active fullscreen effect.
For example, Dim Inactive effect brightens windows if there is an active
fullscreen effect. If active fullscreen effect has been changed, these effects
might need to do some setup work, e.g. schedule repainting, toggle direction
of a timeline, etc.

For what it's worth, because the Dim Inactive effect doesn't schedule
repainting after leaving Desktop Grid, windows aren't dimmed back. One
need to move mouse to trigger dimming.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13701
2018-06-24 16:13:09 +03:00
Vlad Zagorodniy
6a175ece48 [libkwineffects] Add keepBelow property to EffectWindow
Summary:
EffectWindow has keepAbove property, but not keepBelow.

This change adds keepBelow property as a counterpart to keepAbove.

Test Plan: Manually.

Reviewers: #kwin, mart

Reviewed By: #kwin, mart

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13650
2018-06-22 12:39:01 +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
Alex Nemeth
8342cdd3b6 [libkwineffects/kwinglutils] Calculate correct srcY0 and srcY1 in GLRenderTarget::blitFromFramebuffer
Summary:
There are several spaces that have to be considered in `GLRenderTarget::blitFromFramebuffer`:
* KWin logical space: the origin is located at the global top-left corner
* display space: the origin is located at the top-left corner of monitor/display
* OpenGL screen space: the origin is located at the bottom-left corner of monitor/display

Given `s`, which is in the KWin logical space, we have to transform it to the display space, then to the OpenGL screen space:

* KWin logical space -> display space: `y' = s.y() - s_virtualScreenGeometry.y()`
* display space -> OpenGL screen space: `y'' = s_virtualScreenGeometry.height() - y'`

Overall, `srcY0` and `srcY1` should be written as follows:

```
srcY0 = s_virtualScreenGeometry.height() - (s.y() - s_virtualScreenGeometry.y() + s.height())
srcY1 = s_virtualScreenGeometry.height() - (s.y() - s_virtualScreenGeometry.y())
```

Test Plan:
Tweak background contrast effect to use GLRenderTarget::blitFromFramebuffer

```
diff --git a/effects/backgroundcontrast/contrast.cpp b/effects/backgroundcontrast/contrast.cpp
index f920fcd88..5247d83b8 100644
--- a/effects/backgroundcontrast/contrast.cpp
+++ b/effects/backgroundcontrast/contrast.cpp
@@ -447,11 +447,10 @@ void ContrastEffect::doContrast(EffectWindow *w, const QRegion& shape, const QRe
     GLTexture scratch(GL_RGBA8, r.width() * scale, r.height() * scale);
     scratch.setFilter(GL_LINEAR);
     scratch.setWrapMode(GL_CLAMP_TO_EDGE);
-    scratch.bind();

-    const QRect sg = GLRenderTarget::virtualScreenGeometry();
-    glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, (r.x() - sg.x()) * scale, (sg.height() - sg.y() - r.y() - r.height()) * scale,
-                        scratch.width(), scratch.height());
+    GLRenderTarget scratchTarget(scratch);
+    scratchTarget.blitFromFramebuffer(r);
+    scratch.bind();

     // Draw the texture on the offscreen framebuffer object, while blurring it horizontally

```

GLRenderTarget::blitFromFramebuffer without this change:
{F5817883, layout=center, size=full}

Reviewers: #kwin, fredrik, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kpiwowarski, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12452
2018-05-29 15:27:02 +02:00
Vlad Zagorodniy
4a3104bf27 don't override m_canUseMipmaps
Summary:
Seems like this override/assignment was introduced in edb0751cba.

Following that commit, 450be6a378 introduced `levels` param
so we could tell whether mipmaps are going to be used. And it seems like this assignment
hadn't been deleted in that commit.

Reviewers: #kwin, fredrik

Reviewed By: fredrik

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11301
2018-03-14 04:37:44 +02:00
Bhushan Shah
90762ade86 Merge branch 'Plasma/5.12' 2018-03-06 09:26:19 +05:30
Bhushan Shah
3fa287280b Fix the build on armhf/aarch64
Summary:
qopengl.h redeclares the functions defined in the epoxy/gl.h and it
results in the build error. this is similar to other .cpp files where
epoxy/gl.h is used.

See: https://build.neon.kde.org/job/xenial_unstable_plasma_kwin_bin_armhf/157

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D10762
2018-03-06 09:25:33 +05:30
Martin Flöser
e71460b6fc Merge branch 'Plasma/5.12' 2018-03-05 19:32:48 +01:00
Martin Flöser
e1afef3d45 Sanity check WindowQuad before trying to create a grid out of it
Summary:
When one uses:
 * breeze as of 5.12
 * wobbly windows
 * shaded window
 * a distribution building with assert enabled

and starts to move a shaded window, KWin asserts. The root cause for
this is that WindowQuad::makeSubQuad has an assert for y1 being smaller
than y2. With the combination listed above this is not guaranteed. For
the left shadow quad the y1 and y2 are identical and thus trying to
split it, results in the assert condition.

The problem of the shadow quad having an invalid size might be addressed
as well with D10811. Due to that the generation of the quads is not
touched. Instead a sanity check is introduced to not try to split
already invalid sized quads.

BUG: 390953
FIXED-IN: 5.12.3

Test Plan: Added unit test hit the assert, now doesn't hit it any more

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11015
2018-03-05 19:31:51 +01:00
Alex Nemeth
627b11ce49 Added missing image format
Summary:
`QImage::Format_ARGB6666_Premultiplied` was missing from the image format table.
This might have caused some bugs later on.
See: http://doc.qt.io/qt-5/qimage.html#Format-enum

Reviewers: fredrik, #kwin

Reviewed By: fredrik

Subscribers: cfeck, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D10497
2018-02-14 23:23:19 +01:00
Alex Nemeth
cc0325af41 Added noise blur effect
Summary:
Added the option to turn on noise behind the blurred area.
The lowest strength value disables it completely, so it is optional and is disabled by default.

Test Plan:
Edit: this new screenshot shows the updated noise generation.
Edit2: separated the screenshots so you can flick through them to clearly see the differences

{F5694024}

{F5694031}

{F5694025}

{F5694028}

Reviewers: #kwin, #vdg, fredrik

Reviewed By: #vdg, fredrik

Subscribers: davidedmundson, matheusm, romangg, ivan, zzag, ngraham, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D10281
2018-02-14 00:13:08 +01:00
Alex Nemeth
0179f741bb Updated the blur method to use the more efficient dual kawase blur algorithm.
Summary:
Updated the old and outdated blur method to use the much more efficient dual kawase blur method.
Now with this we can do virtually infinite blur with very very little performance cost.
The dual kawase blur method is basically downscaling and upscaling an image, but combined with the kawase blur shader.
Comparison: https://i.imgur.com/mh6Cw61.png
Left is old, right is new.
Comparison was done with the strongest blur setting in a VM running on an Intel i7-4790 and a GTX980
We can see here that the performance is even better with this new method.

Reviewers: #plasma, #kwin, graesslin, fredrik

Reviewed By: fredrik

Subscribers: hein, dos, luebking, broulik, romangg, zzag, anthonyfieroni, mart, davidedmundson, fredrik, ngraham, plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9848
2018-01-26 02:31:45 +09:00
Fabian Vogt
e302f87598 Properly detect Gallium drivers with newer Mesa
Summary:
The renderer string does not contain "Gallium 0.4 on" anymore,
instead it directly contains the gallium driver's name.
So assume that every unknown renderer is a gallium driver.

Test Plan: Added a testcase, it succeeds only with this patch.

Reviewers: #plasma, graesslin

Subscribers: kwin, plasma-devel, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9495
2018-01-12 09:05:03 +01:00
Kai Uwe Broulik
545dda7208 [PaintClipper::Iterator] Operate on QRegion instead of QVector of rects
Differential Revision: https://phabricator.kde.org/D9135
2017-12-03 16:14:53 +01:00
Kai Uwe Broulik
873d38225e [GLVertexBuffer] Port from QRegion::rects() to QRegion iterators
This code path is executed a lot during animations (e.g. maximize, minimize).
Saves creating a temporary QVector.

Differential Revision: https://phabricator.kde.org/D9082
2017-12-02 10:04:22 +01:00
Aleix Pol
af85ca6fe5 Merge branch 'Plasma/5.11' 2017-11-17 17:31:46 +01:00
Aleix Pol
db6c7e17e6 Fix build with a KWindowSystem framework that doesn't pull QWidget
Summary: Fixes the build with D8705

Test Plan: Just adds includes, I wonder if it should go into Plasma/5.8 and /5.11 too

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

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

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8706
2017-11-17 17:30:58 +01:00
David Edmundson
5d07543d2f Merge branch 'Plasma/5.11' 2017-10-26 18:46:43 +01:00
Kamil Piwowarski
9cafbb1179 Fix viewport for screenshot on multiple screens
Summary: D8479 fixes viewport for real hardware, but there is still problem with screenshots. This patch fixes that.

Test Plan:
- Have three monitors (like in bug 385655)
- Press PrtSc and then Enter
- Screenshot is ok

Before:
{F5450056}
After:
{F5450058}

Reviewers: #kwin, #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

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

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8485
2017-10-26 18:45:45 +01:00
David Edmundson
ded617bd1a Merge branch 'Plasma/5.11' 2017-10-26 17:40:34 +01:00
David Edmundson
69b2c2fcea Set scale on glScissor calls
Summary:
glScissor works on window co-ordinates. i.e not scaled by the viewport
We need to multiply by the scale there.

This fixes a minor visual glitch in animations when using hardware
clipping.

Test Plan:
Hardcoded my minimise animation to be really slow.
Now every frame looks perfect

Reviewers: #kwin

Subscribers: kpiwowarski, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8490
2017-10-26 17:32:47 +01:00
David Edmundson
019d4bf425 Fix glScissor calls with y-offset screens
Summary: As per the glViewport patches yesterday.

Test Plan:
Vertically stacked monitors
minimised something, it animated properly

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8503
2017-10-26 17:31:58 +01:00
Martin Flöser
f31e183605 [libkwineffects] Try fixing compile error with clang
The FreeBSD build is currently failing with:

kwingltexture_p.h:83:23: error: no function named 'cleanupGL' with type
'void ()' was found in the specified scope
friend void KWin::cleanupGL();

This change hopefully addresses the problem.
2017-10-01 09:54:12 +02:00
Martin Flöser
8ae37c420b Move SceneOpenGL into a dedicated plugin
Summary:
Unfortunately a rather large change which required more refactoring than
initially expected. The main problem was that some parts needed to go
into platformsupport so that the platform plugins can link them. Due to
the rather monolithic nature of scene_opengl.h a few changes were
required:
* SceneOpenGL::Texture -> SceneOpenGLTexture
* SceneOpenGL::TexturePrivate -> SceneOpenGLTexturePrivate
* texture based code into dedicated files
* SwapProfiler code into dedicated files
* SwapProfiler only used in x11 variants
* Safety checks for OpenGL scene moved into the new plugin
* signal declared in SceneOpenGL moved to Scene, so that we don't need
to include SceneOpenGL in composite

Test Plan: Nested OpenGL compositor works

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7740
2017-09-30 13:12:10 +02:00
Martin Flöser
90e77a939a [effects] Support xcbConnectionChanged for support properties
Summary:
Several effects announce a support property atom on the root window. This
change forwards the KWin::Application's signal that the xcbConnection
changed to the EffectsHandler so that the effects can respond to it.

All effects which announce a support property connect to this new signal
and re-announce the property. In case the xcb connection died (future
XWayland crashing case) it is set to XCB_ATOM_NONE by that. In case the
xcb connection got created (future delayed XWayland startup) the atom is
set to the proper value.

In addition all usages of the support properties are guarded, so that no
nonesense actions are performed if the support property is XCB_ATOM_NONE.

Test Plan: Only compile tested as we don't have XFree KWin yet

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7761
2017-09-12 18:53:31 +02:00
Martin Flöser
20e22ec26a Deprecate global KWin::displayWidth and KWin::displayHeight
Actually they could go directly as nothing in KWin uses them anymore.
But there are more functions in kwinglobal which need to go as they
don't support restarting XWayland. So instead of breaking internal ABI
several times, just deprecate till everything is prepared.
2017-09-01 21:37:42 +02:00
Martin Flöser
8527ac30dc Fix unused-parameter warnings as reported by GCC 2017-07-28 21:31:09 +02:00
Martin Gräßlin
aefb5f4dd9 Prevent endless loop in checkGLError due to GL_CONTEXT_LOST
Summary:
The GL_CONTEXT_LOST flag is not reset when calling glGetError. This of
course bites with: "Thus, glGetError should always be called in a loop,
until it returns GL_NO_ERROR, if all error flags are to be reset."
(see https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glGetError.xhtml)

As KWin calls checkGLError from init call it can result in a freeze of
KWin. This is a regression reported multiple times since the release of
5.10.3 which enabled GLX_NV_robustness_video_memory_purge extension.

Please note that I am not able to test this change. I do not have an
NVIDIA card and are not hiting the problem. I have no way to simulate
the code. I do not know whether the change will fix the problem, it is
based on what others do. Inspiration for this change is mostly from
mutter: https://git.gnome.org/browse/mutter/commit/?id=d4d2bf0f6c1737256b921c4f1dedd3a95138cab9

BUG: 381870
FIXED-IN: 5.10.3.1

Test Plan: See above, I can only compile check the change

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6464
2017-07-01 19:28:31 +02:00
Martin Flöser
43816119e9 Skip Shader self test for Mesa >= 17
Summary:
We are getting reports about the shader self test failing in a false
positive way on Mesa 17. We already have such false positve results
for NVIDIA quadro and went with disabling the self test.

Most likely our self test has a problem or the rendering of the first
frame has a problem. But disabling compositing because our rendering of
the first frame is broken, is too much.

Let's better be pro user here and disable the shader self test till we
fixed the root problem.

BUG: 376801
FIXED-IN: 5.10.4

Test Plan: It compiles.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6426
2017-07-01 08:19:31 +02:00
David Edmundson
80f21064f1 Merge branch 'scaling' 2017-04-29 14:11:13 +01:00
David Edmundson
9cb666f469 Restore the backend set viewport when popping the final render target
Summary:
The backend is responsible for setting the viewport, the GLRenderTarget
should save and restore the viewport actually set by the backend.

Test Plan:
Ran Blur effect which uses this method, under scaling the viewport "restored"
differed from the one set by the backend.

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4952
2017-04-28 10:23:14 +01:00
David Edmundson
71600d0a02 Take into account scaling in blitFromFrameBuffer
Summary:
This method already translates to s_virtualScreenGeometry as the source
co-ordinates are in compostior space we should take scaling into account here too.

This method already supports resizing if source and target sizes do not match.
Calling funcitons can either double the size of the target if they want native resolution
or leave as-is if they want the result in standard DPI.

This implements scaling in the screenshot, magnifier and simple blur effect.

Test Plan:
Tested screenshot effect using spectacle.
I hit an (unrelated, was reproducible on master) crash whilst using this, so it is not fully tested

Ran magnifier effect manually

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4951
2017-04-28 10:23:13 +01:00
David Edmundson
9ce5832e11 Store GLRenderTarget::scale
Summary:
GLRenderTarget already stores the translation from global compositor
space to the render target co-ordinates, we also need a scale factor for
the exact same reasons.

Test Plan: Used in various effects after this patch and it works there.

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D4948
2017-04-28 10:23:13 +01:00
Martin Gräßlin
857d8a9c37 Add a KSharedConfigPtr for kcminputrc to KWin::Application
Summary:
There are a few places where KWin needs to read values from kcminputrc.
As I need to add yet another one it makes more sense to properly
structure it like in other cases and have only one kcminputrc hold in
the application. This also allows to better mock the config values in
the integration tests.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5540
2017-04-24 21:01:03 +02:00
Martin Gräßlin
2132b1e0c8 [effects] Use arg="true" in the kcfg files
Summary:
By changing all kcfg to have arg="true" we can pass in the same
KSharedConfigPtr into all effects. This allows to have fake config in
the tests and in the planned effect demo mode.

Also it means that we don't have to hardcode the name kwinrc into the
files. In the configs - where we cannot access the effectshandler - we
use the define KWIN_CONFIG which gets generated based on the compile
time arguments.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3571
2017-04-15 10:03:34 +02:00
Martin Gräßlin
e6aabf5b9f Add callback functionality for touch screen swipe gestures
Summary:
This is implemented through QActions following the general approach
inside KWin and not the older approach used by ScreenEdges for pointer
callback activation.

Test Plan: Extended auto test

Reviewers: #kwin, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D5263
2017-04-07 16:16:34 +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
David Edmundson
ebebc6ca82 Provide scale offset to WindowVertex calculation
Summary:
WindowVertex contains the x position and also the relative texture x position

Our textures are scaled bigger than kwin's resolution, so this makes sure we set the right
texture position.

Otherwise our final array ends up using 0 to 0.5 of the texture, not 0 to 1.

Test Plan:
Opened some 2x windows, on a 1x output.
It looked how it should do, instead of it being double the size and cropped

Tested some things that use quads, like wobbly windows

Reviewers: #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3502
2017-03-29 20:53:22 +01:00
Martin Gräßlin
22c91df2ec Add support for global touchpad swipe gestures
Summary:
This change adds global touchpad swipe gestures to the
GlobalShortcutsManager and hooks up the swipe gestures as defined at the
Plasma Affenfels sprint:
 * swipe up: Desktop Grid
 * swipe down: Present Windows
 * swipe left: previous virtual desktop
 * swipe right: next virtual desktop

The main work is handled by two new classes: SwipeGesture and
GestureRecognizer. This is implemented in a way that it can be extended
to also recognize touch screen gestures and pinch gestures.

The SwipeGesture defines what is required for the gesture to trigger.
Currently this includes the minimum and maximum number of fingers
participating in the gesture and the direction. The gesture gets
registered in the GestureRecognizer.

The events for the gesture are fed into the GestureRecognizer. It
evaluates which gestures could trigger and tracks them for every update
of the gesture. In the process of the gesture tracking the
GestureRecognizer emits signals on the Gesture:
 * started: when the Gesture gets considered for a sequence
 * cancelled: the Gesture no longer matches the sequence
 * triggered: the sequence ended and the Gesture still matches

The remaining changes are related to hook up the existing shortcut
framework with the new touchpad gestures. The GlobalShortcutManager
gained support for it, InputRedirection and EffectsHandler offer methods
to register a QAction. VirtualDesktopManager, PresentWindows and
DesktopGrid are adjusted to support the gesture.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D5097
2017-03-27 17:43:44 +02:00
Martin Gräßlin
d38bce776f Add support for skip close animation to OnScreenMessage
Summary:
This change adds support for marking the OnScreenMessage as it should
skip close animation. The screenshot effect is adjusted to use the
on screen message instead of the custom effect frame.

Test Plan: Message window is not captured when taking screenshot

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D4091
2017-01-25 13:54:34 +01:00
Martin Gräßlin
ab45659677 Add support for on-screen-message to kwineffects
Summary:
This adds support for the new on-screen-message support to the
kwineffects API and makes use of it in the colorpicker effect.

Not yet added to screenshot effect as for that we need support for
skip close animation on the on-screen-message window.

Reviewers: #plasma, #kwin

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3803
2016-12-24 09:56:48 +01:00
David Edmundson
adbd9fc54a Initialise all variables for WindowVertex.
Summary:
The default constructor shouldn't have been used anyway, but better safe
than sorry.

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3453
2016-11-25 09:46:07 +00:00
Martin Gräßlin
f9f7b84cb4 Add interactive position selection to screenshot screen under cursor
Summary:
A second interactive selection mode gets added to select a position on
the screen. This is handled by the same input event filter as for the
window selection. Just that instead of returning a window, it returns a
QPoint.

This allows to pick a point on the screen which we need to screenshot
the screen under the mouse cursor and in future for color picking.

The screenshot effect provides two new dbus methods to (interactively)
select a screen or fullscreen. This allows spectacle to screenshot the
(full) screen with still having the user in control.

Reviewers: #kwin, #plasma_on_wayland, bgupta

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D3475
2016-11-25 07:38:37 +01:00
Martin Gräßlin
0dc500fe94 Move linking to DL_LIBRARY to x11standalone platform
Summary:
It's only needed by the GLX backend, so only find if we have GLX at all
and only link where needed. As it was handled incorrectly before, it's
now using proper ifdef.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3448
2016-11-22 14:22:06 +01:00