Commit graph

16045 commits

Author SHA1 Message Date
Vlad Zagorodniy
02c08ca33d [effects/frozenapp] Delete debug prints
Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13157
2018-05-31 12:08:39 +03:00
Vlad Zagorodniy
95ee052442 [effects/blur] Lookup window once when disconnecting from blurChanged
Summary:
When disconnecting from `blurChanged` signal, `(w, connection)` pair is
being looked up three times. We can do better by using `QMap` in a more
STL-like way.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13118
2018-05-31 12:08:08 +03:00
Vlad Zagorodniy
54b69bec44 Honor BUILD_TESTING
Test Plan:
* Passed `BUILD_TESTING=OFF` option to cmake, no tests have been built;
* Didn't pass `BUILD_TESTING` option, all tests have been built.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13163
2018-05-31 12:06:55 +03:00
Alex Nemeth
99532fb95c Fix multimonitor blur
Summary:
On wayland blur on secondary monitor would not render correctly.

BUG: 393723
Depends on D12452

Test Plan:
 - use more than one output
 - log in in a wayland session
 - open a transparent window (for example: Konsole with transparent and blur enabled profile)
 - drag the window to another screen
 - blurs the content under the window corretly

Reviewers: #kwin, graesslin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: apol, zzag, davidedmundson, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12678
2018-05-29 15:32:55 +02: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
Scott Harvey
393af855c4 Revert "Revert "Add "SkipSwitcher" to API""
This reverts commit 5ef119044d.
2018-05-23 23:33:39 -05:00
Martin Flöser
267b5a1122 Disallow running KWin/Wayland as root
Summary:
KWin is not designed to run as root. It is not hardened enough and
there is a great risk that applications could attack KWin through
X11 properties, Wayland protocol requests, etc. to trigger stack or
heap overflows and execute random code. As clients connected to KWin
could be remote there is a great risk in running KWin as root. Also
clients on the same system but started as a different user could
try to gain more privs by exploiting KWin.

Furthermore KWin is designed to not run as root. It interacts with
logind to get the devices opened which would require root. Whether
KWin would work as root at all is questionable.

We cannot guarantee that running KWin as root is secure, thus this
change disallows running KWin and thus a Wayland session as root.

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13008
2018-05-20 21:51:32 +02:00
Martin Flöser
b19c3c1c8e Drop no longer needed cast to Client in TabGroup related code
Differential Revision: https://phabricator.kde.org/D12730
2018-05-20 20:18:09 +02:00
Martin Flöser
b6befb4ef8 Use AbstractClient in UserActionsMenu for tab functionality 2018-05-20 19:50:35 +02:00
Martin Flöser
46d8b87646 Move TabGroup functionality from Client to AbstractClient
Only setClientShown remains in Client. This might need a dedicated
implementation for ShellClient.
2018-05-20 19:50:35 +02:00
Martin Flöser
7defd93047 Port TabGroup from Client to AbstractClient
First step towards a return of window tabbing.
2018-05-20 19:50:29 +02:00
Martin Flöser
a02797ca06 Use existing KSharedConfig in RuleBook::save
Summary:
Recently a KSharedConfig was introduced in RuleBook. It makes sense to
also use it in save and not just in load.

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12747
2018-05-20 15:45:39 +02:00
Martin Flöser
32a715b0c9 Merge branch 'Plasma/5.13' 2018-05-20 15:43:46 +02:00
Martin Flöser
bed31e0557 Reparse rules config prior to update
Summary:
We used to recreate the KConfig when rules needed to update. Now that it
is a KSharedConfig, which is kept, it needs to be reparsed as it changes
outside of KWin.

BUG: 393788
FIXED-IN: 5.13.0

Test Plan: Restarted session, changing rules work again

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12706
2018-05-20 15:43:11 +02:00
Martin Flöser
9a9c34f352 Merge branch 'Plasma/5.12' into Plasma/5.13 2018-05-20 15:41:48 +02:00
Martin Flöser
9a02ed4d36 Do not save kwinrulesrc on every window opening/closing
Summary:
Our rule handling has had a grave error for years. Whenever a window
with a rule was openend or closed the kwinrulesrc was written back to
disk.

The reason for this behavior is that temporary rules need to be discarded
once they were used. For that there is a method discardUsed which invokes
requestDiskStorage whenever a rule for the window was found. But it did
not check whether there was a rule requiring this.

This change modifies the discardUsed to track whether it changed a rule
and only writes back in case there was a change.

BUG: 393911
FIXED-IN: 5.12.6

Test Plan: Only compile tested

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12749
2018-05-20 15:40:02 +02:00
Martin Flöser
69afe4d266 Update seat's timestamp after waking up screen through double tap
Summary:
The drm platform has a special handling for touch events while the
screen is in dpms. All touch events are filtered out, but a double
tap wakes up the screen.

Due to the filtering out of the events the idle timers were not reset.
So if you only double tapped, the screen turned on, but not off again.

This change updates the timestamp after double tap, so that the idle
timers are restarted. All other events are still filtered out, to not
have "fake" events (e.g. smart phone in pocket) wake up the device.

BUG: 392754
FIXED-IN: 5.12.6

Test Plan: only compile tested

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12668
2018-05-20 15:38:31 +02:00
Martin Flöser
f28d44e5b2 Use XdgShell Unstable V6 in nested wayland platform
Summary:
Changing the creation of the nested window from unstable v5 to v6 in
order to be supported on more compositors and to use KWin's better
supported platform.

Targeting 5.12 as this will help to remove support for unstable v5
from KWayland.

Test Plan: Run a nested KWin/Wayland on KWin/Wayland, everything looked fine

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11806
2018-05-20 15:37:19 +02:00
Yuri Chornoivan
eb47c08204 Fix message extraction 2018-05-20 08:14:50 +03:00
Martin Flöser
cf53957bd8 Merge branch 'Plasma/5.13' 2018-05-19 09:01:44 +02:00
Martin Flöser
08455f297d Ensure the QToolTip on the deocration does not steal key events
Summary:
BUG: 393253
FIXED-IN: 5.13.0

Test Plan: manual testing and new unit test

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12633
2018-05-19 09:01:11 +02:00
Martin Flöser
04dab3de1b Merge branch 'Plasma/5.12' into Plasma/5.13 2018-05-19 09:00:43 +02:00
Martin Flöser
e3250460cc Do not unset cursor image when cursor enters a surface
Summary:
From Wayland documentation:
"When a seat's focus enters a surface, the pointer image is undefined and
a client should respond to this event by setting an appropriate pointer
image with the set_cursor request."

KWin's interpretation so far for the undefined pointer image was to
remove the pointer image when entering a surface waiting for the client
to set a cursor image. This can result in a short flicker as there might
be a frame without a cursor image.

This patch changes the behavior by keeping the previous image till the
application set a new one. This brings some advantages:
 * if the application is not responding a cursor is still shown
 * if the same cursor is used as in the previous window we don't have a
flicker

CCBUG: 393639

Test Plan: I cannot see the flicker, so only tested with the adjusted tests

Reviewers: #kwin, #plasma

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12631
2018-05-19 08:58:42 +02:00
l10n daemon script
4be9264b8a 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-05-19 08:34:54 +02:00
l10n daemon script
ee0c1c4de2 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-05-19 08:07:27 +02:00
l10n daemon script
553f95be94 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-05-19 06:12:38 +02:00
Jonathan Riddell
e868f9c50e Update version number for 5.13.80
GIT_SILENT
2018-05-18 15:56:08 +01:00
Jonathan Riddell
0550fc383c Update version number for 5.13.90
GIT_SILENT
2018-05-18 15:46:13 +01:00
David Edmundson
1403fcf316 Add XDG Output support
Test Plan:
Very minimal expansion of unit tests which uses WaylandScreens
Wrote mini app to debug actual output of xdg-output for testing the DRM code

Main relevant user of this is xwayland > 1.20 which I don't have, so that
part remains untested

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: romangg, graesslin, bshah, kwin

Tags: #kwin

Maniphest Tasks: T8501

Differential Revision: https://phabricator.kde.org/D12243
2018-05-18 14:16:13 +01:00
Jonathan Riddell
d4a825a9cc Update version number for 5.14.80
GIT_SILENT
2018-05-18 14:03:19 +01:00
Jonathan Riddell
57178b2b98 Update version number for 5.12.90
GIT_SILENT
2018-05-18 10:41:36 +01:00
l10n daemon script
0cae991804 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-05-18 07:38:55 +02:00
l10n daemon script
adf9cb767d 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-05-18 05:45:28 +02:00
Vlad Zagorodniy
309a77eedf [effects/backgroundcontrast] Calculate correct y-coord of the copy rect
Summary: For more details, see D12452.

Reviewers: #kwin, davidedmundson, fredrik, mart

Reviewed By: #kwin, davidedmundson, mart

Subscribers: romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12466
2018-05-17 02:51:50 -07:00
Chris Holland
184b490c78 Update knsrc to use kpackagetool5 commands
kwinswitcher.knsrc, kwinscripts.knsrc, kwineffect.knsrc

It seems the kwineffect.desktop was (and still is) invalid, as it
does not show up in `kpackagetool5 --list-types`.

To test, I overwrite the /etc/xdg/*.knsrc,
then opened the GHNS dialogs and installed stuff.

Differential Revision: https://phabricator.kde.org/D12249
2018-05-13 19:07:49 -04:00
Aleix Pol
c0226fe744 Clear both cursor caches
Summary: There are two cursor caches: m_cursors and m_cursorsByName. The second doesn't ever seem to be cleared.

Reviewers: #kwin, davidedmundson, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12542
2018-05-02 14:55:38 +02:00
Alex Nemeth
4156a0af4d [effects/slideback] Enable blur behind windows
Summary: Use the blur effect even while the window is sliding back.

Test Plan: {F5828577}

Reviewers: #kwin, #vdg, graesslin, ngraham

Reviewed By: #kwin, #vdg, graesslin, ngraham

Subscribers: ngraham, graesslin, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12625
2018-05-01 23:08:10 +02:00
Alex Nemeth
9644f29b8b [effects/maximize] Enable blur behind windows
Summary: Use the blur effect even while the window is being maximized/unmaximized.

Test Plan:
Before:

{F5828510}

After:

{F5828511}

Reviewers: #kwin, #vdg, graesslin, ngraham

Reviewed By: #kwin, #vdg, graesslin, ngraham

Subscribers: ngraham, graesslin, zzag, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12623
2018-05-01 23:04:56 +02:00
Alex Nemeth
c3e84e1073 [effects/desktopgrid] Enable blur behind windows
Summary: Use the blur effect even when the desktop grid is used.

Test Plan: {F5828458}

Reviewers: davidedmundson, fredrik, #vdg, #kwin, graesslin, ngraham

Reviewed By: #vdg, #kwin, graesslin, ngraham

Subscribers: graesslin, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12620
2018-05-01 23:01:55 +02:00
Alex Nemeth
424b9ac388 [effects/presentwindows] Enable blur behind windows
Summary:
Use the blur effect even when the present windows is used.
Previously it was only enabled for the close buttons and the dock.

Test Plan: {F5828442}

Reviewers: davidedmundson, fredrik, #vdg, #kwin, graesslin, ngraham

Reviewed By: #vdg, #kwin, graesslin, ngraham

Subscribers: ngraham, zzag, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12619
2018-05-01 22:59:08 +02:00
Jonathan Riddell
776cc799b4 Update version number for 5.12.5
GIT_SILENT
2018-05-01 13:28:08 +01:00
Friedrich W. H. Kossebau
a5a661211c Merge branch 'Plasma/5.12' 2018-04-30 23:50:35 +02:00
Friedrich W. H. Kossebau
86af84f13e Convert JS files to UTF-8 (from ISO-8859-15) 2018-04-30 23:37:10 +02:00
Alex Nemeth
16a0e24115 Fix blur noise effect using incorrect scaling value
Summary:
`QGuiApplication::primaryScreen()->logicalDotsPerInch()` sometimes reports incorrect scale value, for example 95.951 (or even lower) instead of 96.0 at 1x scale and this caused to simply darken blurred areas instead of noising them.
This patch sets a minimum 1x scale for the noise texture, because realistically we will never be below that.

Reviewers: davidedmundson

Reviewed By: davidedmundson

Subscribers: davidedmundson, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D12519
2018-04-30 18:02:29 +02:00
l10n daemon script
41819da476 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-04-29 05:26:48 +02:00
Luca Beltrame
5ef119044d
Revert "Add "SkipSwitcher" to API"
This reverts commit 8a2a00a4ca.

It was likely wrongly pushed before the KWayland changes, so it won't
compile.

Feel free to reinstate it once the dependent changes (KWayland) are in.

CCMAIL: bundito@gmail.com
CCMAIL: kwin@kde.org
2018-04-28 09:26:51 +02:00
Scott Harvey
8a2a00a4ca Add "SkipSwitcher" to API
Summary:
Adding "SkipSwitcher" to the API, following discussion in
BUG 375921

Depends on / related to D11925 and D11924

Reviewers: hein, #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: davidedmundson, #plasma, ngraham, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D11926
2018-04-27 09:43:13 -05:00
Aleix Pol
ebfc713936 Improve cursor size setup
Centralise resolution-dependent computation into the leaf cursor class.
Listen to scale changes and update the cursor when it happens

Reviewed by David Edmundson
2018-04-26 16:42:32 +02:00
David Edmundson
437a36a2bb [KScreen Effect] Fix fade to black
Summary:
When you have two windows ontop of each other and you turn them
transparent, evidently you'll be able to see through them.
Not only does it look unpolished if the desktop window flashes through
your windows, it can pose a privacy risk as you'd be able to briefly
look through the lock screen.

This patch fades apps to black intead of to transparent. As this looks
weird for panels, so windows are also faded to opaque (if relevant) at
the same rate.

BUG: 388384

Reviewers: #plasma, graesslin

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

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9608
2018-04-26 11:15:38 +02:00
l10n daemon script
ed4a936315 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-04-25 07:16:14 +02:00