Commit graph

17473 commits

Author SHA1 Message Date
Vlad Zahorodnii
f93875535c Update my last name 2019-09-29 17:03:25 +03:00
Vlad Zahorodnii
99d3185949 Rename getShadow method to updateShadow
Summary: getShadow is not a getter method as it doesn't return a shadow.

Test Plan: Compiles.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24298
2019-09-29 15:26:53 +03:00
Vlad Zahorodnii
c1eafcbce1 Drop Toplevel::hasShadow() method
Summary: Use Toplevel::shadow() instead to check whether a Toplevel has a Shadow.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24297
2019-09-29 15:26:39 +03:00
Vlad Zahorodnii
da1a47f91b Copy internal raster buffer object 2019-09-29 13:31:08 +03:00
l10n daemon script
b7ea14d363 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"
2019-09-29 09:19:57 +02:00
l10n daemon script
c790c50292 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"
2019-09-29 08:51:18 +02:00
l10n daemon script
9c11835222 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"
2019-09-29 05:20:56 +02:00
David Edmundson
40b0296d5c [libkwineffects] Introduce API to easily show a QtQuick scene in an effect
Summary:
EffectQuickView/Scene is a convenient class to render a QtQuick
scenegraph into an effect.

Current methods (such as present windows) involve creating an underlying
platform window which is expensive, causes a headache to filter out
again in the rest of the code, and only works as an overlay.

The new class exposes things more natively to an effect where we don't
mess with real windows, we can perform the painting anywhere in the view
and we don't have issues with hiding/closing.

QtQuick has both software and hardware accelerated modes, and kwin also
has 3 render backends. Every combination is supported.

* When used in OpenGL mode for both, we render into an FBO export the
texture ID then it's up to the effect to render that into a scene.

* When using software QtQuick rendering we blit into an image, upload
that into a KWinGLTexture which serves as an abstraction layer and
render that into the scene.

* When using GL for QtQuick and XRender/QPainter in kwin everything is
rendered into the internal FBO, blit and exported as an image.

* When using software rendering for both an image gets passed directly.

Mouse and keyboard events can be forwarded, only if the effect
intercepts them.

The class is meant to be generic enough that we can remove all the
QtQuick code from Aurorae.

The intention is also to replace EffectFrameImpl using this backend and
we can kill all of the EffectFrame code throughout the scenes.

The close button in present windows will also be ported to this,
simplifiying that code base.

Classes that handle the rendering and handling QML are intentionally
split so that in the future we can have a declarative effects API create
overlays from within the same context. Similar to how one can
instantiate windows from a typical QML scene.

Notes:
I don't like how I pass the kwin GL context from the backends into the
effect, but I need something that works with the library separation. It
also currently has wayland problem if I create a QOpenGLContext before
the QPA is set up with a scene - but I don't have anything better?

I know for the EffectFrame we need an API to push things through the
effects stack to handle blur/invert etc. Will deal with that when we
port the EffectFrame.

Test Plan: Used in an effect

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24215
2019-09-27 16:11:05 +01:00
David Edmundson
a161c508c8 [kconf_update] Explicitly request python3 in animation speed migration helper 2019-09-27 14:50:47 +01:00
David Edmundson
11502b7928 Merge branch 'Plasma/5.17' 2019-09-26 16:09:42 +01:00
David Edmundson
3ba33e4b58 Use lambdas for queued invocation of composition suspending
Summary:
Qt's metaobject is rather sensitive with scope resolution.

Foo::Bar and Bar don't always match to a Qt metaobject, even if they
refer to the same thing to a compiler. Here we register
X11Compositor::SuspendReason but Q_ARG uses SuspendReason and they don't
match. This leads to a runtime failure where the method isn't invoked.

Rather than fixing metaobject usage, port the whole thing to lambdas
which does better compile time checking and is generally nicer to read.

BUG: 412353

Test Plan:
Ran xprop to block compositing. Compositing was blocked.
Grepped source code for Q_ARG use

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24244
2019-09-26 16:09:16 +01:00
Kai Uwe Broulik
321e17ab68 [EffectWindow] Expose PID to effects
Differential Revision: https://phabricator.kde.org/D24222
2019-09-26 14:54:33 +02:00
Vlad Zahorodnii
0cacd9dc0a [wayland] Fix some coding style issues in XdgShellClient
Summary:
The Frameworks coding style prohibits using short variable names, unless
it's a counter in a loop.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24198
2019-09-26 12:22:14 +03:00
Vlad Zahorodnii
3047a68905 [wayland] Make XdgShellClient::init() more comprehensible
Summary:
Currently the init method is just a big pile of connects to lambdas,
which makes the code very difficult to read and moreover to change.
This change moves most of those lambda to handleFoo methods so one has
more clear view of what the init method is actually doing.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24197
2019-09-26 12:22:14 +03:00
Vlad Zahorodnii
7bc83a8653 [wayland] Drop initSurface method in XdgShellClient
Summary:
XdgShellClient can represent either a xdg-toplevel or xdg-popup. Therefore,
template initSurface method is no longer needed.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24196
2019-09-26 12:22:14 +03:00
Vlad Zahorodnii
b0dc9aea5e Use frame margins wherever possible
Summary:
AbstractClient has a method that exposes frame margins. Use that instead
to make code simpler and ready for upcoming xdg-shell changes.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24188
2019-09-26 12:22:14 +03:00
Vlad Zahorodnii
bf47afcf6a Merge branch 'Plasma/5.17' 2019-09-26 12:10:38 +03:00
Vlad Zahorodnii
086428754e [nightcolor] Print a debug message upon receiving new location from kded module
Summary:
This can be useful for debugging whether Night Color manager actually
receives new location data from colorcorrectlocationupdater kded module.

CCBUG: 412211

Test Plan:
Run kwin with QT_LOGGING_RULES="kwin_colorcorrection.debug=true"

Run from the terminal the following two commands
    qdbus org.kde.kded5 /kded unloadModule colorcorrectlocationupdater
    qdbus org.kde.kded5 /kded loadModule colorcorrectlocationupdater

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24236
2019-09-26 12:10:26 +03:00
Vlad Zahorodnii
03d782310b [nightcolor] Add missing const qualifiers
Summary: Mark some immutable variables with const to improve code readability.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson, romangg

Reviewed By: #kwin, davidedmundson, romangg

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24235
2019-09-26 12:10:16 +03:00
Vlad Zahorodnii
01982a7892 Merge branch 'Plasma/5.17' 2019-09-26 11:31:20 +03:00
Vlad Zahorodnii
c265c7f2c6 [nightcolor] Use local time in Automatic and Location mode
Summary:
Currently Night Color doesn't handle time zones very well. For example,
if the user's time zone is UTC-8, then computed timings of sunrise and
sunset (in UTC) will be a bit gibberish as sunset occurs before sunrise
rather than vice versa.

This change switches relevant parts of Night Color to local time in
order to fix expectations about the order of morning and evening in
updateSunTimings() method as well to simplify the code a bit (dealing
with UTC and local time can be painful sometimes).

CCBUG: 412211

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24153
2019-09-26 11:31:01 +03:00
l10n daemon script
8ba7bc4281 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"
2019-09-26 09:24:52 +02:00
l10n daemon script
3e7d9cd1ab 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"
2019-09-26 08:55:53 +02:00
l10n daemon script
0f97a13fc4 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"
2019-09-26 05:23:56 +02:00
Vlad Zahorodnii
ffcbe24e2b Rename Client to X11Client
Summary:
Currently each managed X11 client is represented with an instance of
Client class, however the name of that class is very generic and the
only reason why it's called that way is because historically kwin
was created as an x11 window manager, so "Client" was a sensible choice.

With introduction of wayland support, things had changed and therefore
Client needs to be renamed to X11Client in order to better reflect what
that class stands for.

Renaming of Client to X11Client was agreed upon during the last KWin
sprint.

Test Plan: Compiles, the test suite is still green.

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24184
2019-09-25 21:11:37 +03:00
David Edmundson
a486b471e1 [kcmkwin/compositing] Hide animation speed slider on Plasma
Summary:
Hide the animation speed slider on Plasma as this becomes duplicated
with the global "animation speed" slider.

Also port to the new format for the config option which stores the
actual multiplier, not a magic number.

Test Plan:
Didn't appear normally
Manually modified env; slider appeared
Tested load/save of defaults and the two extremes

Reviewers: zzag

Reviewed By: zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24075
2019-09-25 14:50:25 +01:00
David Edmundson
78a66fcfc9 Migrate kwin animation speed to kdeglobals
Test Plan:
Tested output piping test lines into the script with different settings
Removed from my kdeglobals
Invoked script. New value appeared

(note that if you manually test multiple times locally you have to
cleanup the $version info from
both kdeglobals and kwinrc or the migration will be skipped)

Reviewers: zzag

Reviewed By: zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24084
2019-09-25 14:37:01 +01:00
David Edmundson
910ba1eb1e Load animation speed from new global animation speed controller
Summary:
It doesn't belong with advanced compositing settings as it's quite user
friendly, and we also want to adjust other animation speeds. May as well
do it together.

In the current form all compositing is still completely reinitiliased
like with the previous slider. Change notifications come in the form of
KConfigWatcher rather than our own bespoke update interface.

Test Plan:
Moved new slider, minimised a window.
It still behaved as expected.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, broulik, anthonyfieroni, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22887
2019-09-25 14:37:01 +01:00
David Edmundson
d78fda30ef KWin::GLTexture support external textures
Summary:
Currently KWin::GLTexture is a nice wrapper for creating a GL texture
and performing various operations including rendering.

In a pending patch I want to render the FBO from a QQuickScene directly,
where we have an underlying texture already, but it makes sense to
re-use this class for the rendering. A similar need is in haagch's kwin
VR patchset.

This patch adds a constructor to GLTexture that takes an externally
managed texture and provides the relevant useful KWin features.

Test Plan: Used in patch series

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24206
2019-09-25 14:28:19 +01:00
David Edmundson
0c876cd93f Avoid event processing infinite loop
Summary:
Kwin on X11 overrides QCoreApplication::notify to get low level system
event.

If something handled by the low level filtering ever calls postEvent we
would end up in a loop. This was found when forwarding a key event into
a QQuickWindow in a similar manner that mouse events are forwarded.

Fortunately there's a flag to separate generated and core events

Test Plan:
No more infinite loop
Kwin X11 still works fine

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24207
2019-09-25 14:27:16 +01:00
Bhushan Shah
ef5406990e [platforms/drm] Consider DSI connector type to be internal display
Summary:
Lot of mobile devices, as well as tablet devices use the DSI connector,
for internal screens. This is more common in ARM devices, so consider
them as internal display as well.

Test Plan: checked on the device with DSI screen, it was considered internal

Reviewers: #kwin, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24209
2019-09-25 13:44:08 +05:30
Vlad Zahorodnii
c3772f4c81 Delete pointless nullptr checks
Lifetime of XdgShellClient is bounded to Workspace, so we no longer need
to check whether tabbox is still present around.
2019-09-24 18:10:59 +03:00
Vlad Zahorodnii
64feafc10f Mark Toplevel as not ready for painting by default
Summary:
Get rid of some duplication as InternalClient, XdgShellClient, Unmanaged,
and Client initialize ready_for_painting to false.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24189
2019-09-24 17:05:43 +03:00
Vlad Zahorodnii
f67db3a918 Cleanup XdgShellClient header
Don't put method definitions in the header file of XdgShellClient class
as it makes the code visually inconsistent. InternalClient is a good
example of how the header file of a subclass of AbstractClient class
should look like.

This change also cleans up the order of things in the header file, thus
making it a bit more obvious where new things should go.
2019-09-24 10:45:45 +03:00
Vlad Zahorodnii
e0711e3c43 Switch XdgShellClient header to pragma once
This way we don't have to manually update #ifdef if the filename gets changed.
2019-09-24 10:30:41 +03:00
Vlad Zahorodnii
1571fb5b71 Delete unused include 2019-09-24 10:25:10 +03:00
Vlad Zahorodnii
79bc955202 [autotests] Enable PopupOpenCloseAnimationTest::testAnimateUserActionsPopup 2019-09-24 10:22:51 +03:00
l10n daemon script
c07f685ced 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"
2019-09-24 09:01:00 +02:00
l10n daemon script
8ad5bf21b0 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"
2019-09-24 05:22:31 +02:00
David Edmundson
04845b6007 [wayland] Avoid compare to unintialised value in keyboard repeat
Summary:
If we get a key event for which

if (m_xkb->shouldKeyRepeat(key) &&
waylandServer()->seat()->keyRepeatDelay() != 0) fails

m_key will be unitialised and on release we have a compare against
unitialised memory.

Won't do any harm, it'll just stop a timer that isn't running, but
valgrind complains.

0 is the value QKeyEvent uses when nativeScanCode is unknown so a safe
initial values.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23748
2019-09-23 22:13:54 +02:00
David Edmundson
a209ee7865 Don't notify ksplash in our wayland session
Summary:
KSplash doesn't expect a kwin notification on wayland as kwin is started
before ksplash.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: broulik, zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23770
2019-09-23 22:13:43 +02:00
Vlad Zahorodnii
a4ec797883 [autotests] Gracefully destroy xdg client 2019-09-23 23:02:21 +03:00
Vlad Zagorodniy
168ea98845 Rename ShellClient to XdgShellClient
Summary:
Rename ShellClient to XdgShellClient in order to reflect that it
represents only xdg-shell clients.

Test Plan: Compiles, tests still pass.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23589
2019-09-23 17:28:56 +03:00
Vlad Zagorodniy
665ec0a5de [wayland] Drop xdg-shell v5 support
Summary:
Drop xdg-shell v5 support since this protocol is obsolete and all popular
wayland compositors already did that.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23573
2019-09-23 17:28:56 +03:00
Vlad Zagorodniy
973f873dc7 [tests] Drop wl-shell test client
Summary: Drop waylandclienttest in favor of xdg-shell test client from KWayland.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23565
2019-09-23 17:28:56 +03:00
Vlad Zagorodniy
5469558c1a [effects/slidingpopups] Don't start animation if there is no slide edge
Summary:
Given that slide in/out animation duration is not initialized when slide
location is NoEdge, assert statement will be triggered in slideIn().

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23564
2019-09-23 17:28:56 +03:00
Vlad Zagorodniy
9dd7a1881b [platforms/wayland] Drop wl-shell support
Summary: wl-shell is deprecated and its support was dropped in kwin.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23563
2019-09-23 17:28:56 +03:00
Vlad Zagorodniy
7a5447bd17 [wayland] Drop wl-shell support
Summary: wl-shell is deprecated, and pretty much no one uses it.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23562
2019-09-23 17:28:56 +03:00
Vlad Zagorodniy
d92d6e77ae [autotests] Don't test wl-shell clients
Summary:
This change removes all traces of wl-shell in the test suite. That's a
prerequisite for dropping wl-shell support in KWin.

Given that wl-shell and xdg-shell are not interchangeable, some tests
were removed and initialization sequence in some tests was adjusted.

The most notable change is ensuring that each plasmashell window sets
its role and initial position before committing the surface. Setting
those properties before the first surface commit is important because
our window placement code needs to know window type in order to
avoid maximizing panels, popups, etc.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23561
2019-09-23 17:28:56 +03:00
Vlad Zagorodniy
bebe81209c Port QPA away from Wayland
Summary:
So far wayland was used by internal clients to submit raster buffers
and position themselves on the screen. While we didn't have issues with
submitting raster buffers, there were some problems with positioning
task switchers. Mostly, because we had effectively two paths that may
alter geometry.

A better approach to deal with internal clients is to let our QPA use
kwin core api directly. This way we can eliminate unnecessary roundtrips
as well make geometry handling much easier and comprehensible.

The last missing piece is shadows. Both Plasma::Dialog and Breeze widget
style use platform-specific APIs to set and unset shadows. We need to
add shadows API to KWindowSystem. Even though some internal clients lack
drop-shadows at the moment, I don't consider it to be a blocker. We can
add shadows back later on.

CCBUG: 386304

Reviewers: #kwin, davidedmundson, romangg

Reviewed By: #kwin, romangg

Subscribers: romangg, kwin

Tags: #kwin

Maniphest Tasks: T9600

Differential Revision: https://phabricator.kde.org/D22810
2019-09-23 17:28:56 +03:00