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
Summary:
Because KWin is a very old project, we use three kinds of null pointer
literals: 0, NULL, and nullptr. Since C++11, it's recommended to use
nullptr keyword.
This change converts all usages of 0 and NULL literal to nullptr. Even
though it breaks git history, we need to do it in order to have consistent
code as well to ease code reviews (it's very tempting for some people to
add unrelated changes to their patches, e.g. converting NULL to nullptr).
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson, romangg
Reviewed By: #kwin, davidedmundson, romangg
Subscribers: romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23618
We have lots of inconsistency at the moment in CMakeLists.txt files. Most
of it is due to kwin being a very old project. This change hopefully fixes
all of it.
Summary:
This has been commented out since 2014, I doubt it will come back.
This is a big amount of code, maintenance will be easier without it.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: romangg, graesslin, kwin
Tags: #kwin, #documentation
Differential Revision: https://phabricator.kde.org/D23069
Summary:
Given that wobbly windows effect takes optimized render path, it needs
to clear the clip region of about to be transformed opaque window.
BUG: 411092
FIXED-IN: 5.17.0
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23774
Summary:
Wobbly Windows effect is capable of animating a window when it's shown
or hidden. However, this feature has been hidden since it was added.
One needs to know how the effect works in order to enable these animations.
Therefore there's no good reason to keep these two animations because
practically no one uses them and they only add maintenance burden.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23763
Summary:
Switch to Q_ASSERT in order to make code a bit more consistent. We have
places where both assert and Q_ASSERT are used next to each other. Also,
distributions like Ubuntu don't strip away assert(), let's hope that
things are a bit different with Q_ASSERT.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: romangg, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23605
Summary:
There is no point in using quint32 and casting back and forth in numerous places.
Fix a bunch of compiler warnings that we implicitly cast between signed and unsigned.
This makes things consistent with what we get from libinput.
Reviewers: #kwin, romangg
Reviewed By: #kwin, romangg
Subscribers: zzag, romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D23086
Summary:
So far we were following a bit unique and rare doxygen comment style:
/**
* Contents of the comment.
**/
Doxygen comments with this style look balanced and neat, but many people
that contribute to KWin don't follow this style. Instead, they prefer
more traditional doxygen comment style, i.e.
/**
* Contents of the comment.
*/
Reviewing such changes has been a bit frustrating for me (so selfish!)
and for other contributors.
This change switches doxygen comment style in KWin to a more traditional
style. The main reason for doing this is to make code review process easier
for new contributors as well us.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22812
Summary:
Currently code base of kwin can be viewed as two pieces. One is very
ancient, and the other one is more modern, which uses new C++ features.
The main problem with the ancient code is that it was written before
C++11 era. So, no override or final keywords, lambdas, etc.
Quite recently, KDE compiler settings were changed to show a warning if
a virtual method has missing override keyword. As you might have already
guessed, this fired back at us because of that ancient code. We had
about 500 new compiler warnings.
A "solution" was proposed to that problem - disable -Wno-suggest-override
and the other similar warning for clang. It's hard to call a solution
because those warnings are disabled not only for the old code, but also
for new. This is not what we want!
The main argument for not actually fixing the problem was that git
history will be screwed as well because of human factor. While good git
history is a very important thing, we should not go crazy about it and
block every change that somehow alters git history. git blame allows to
specify starting revision for a reason.
The other argument (human factor) can be easily solved by using tools
such as clang-tidy. clang-tidy is a clang-based linter for C++. It can
be used for various things, e.g. fixing coding style(e.g. add missing
braces to if statements, readability-braces-around-statements check),
or in our case add missing override keywords.
Test Plan: Compiles.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, apol, romangg, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22371
Summary: Fixes the execution of tests when not installed
Test Plan: Removed the installed effect and testTranslucency
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22490
Summary:
Removes a bunch of boilerplate CMake code and allows kpackage to do
some smart things, e.g. drops our runtime dependency on the
DesktopFileParser and we get to just use json directly.
Test Plan: Ran kwin, now it doesn't use the desktop to json translation path, everything still works.
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: davidedmundson, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22474
Summary:
QImage::byteCount() was deprecated in Qt 5.10. It is advised to use
QImage::sizeInBytes() method instead.
Reviewers: #kwin, apol
Reviewed By: apol
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22355
Summary:
QRegion::rects was deprecated in Qt 5.11. It is advised to use begin()
and end() methods instead.
Reviewers: #kwin, romangg
Reviewed By: #kwin, romangg
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D22353
Disable sRGB rendering when the color encoding of the default
framebuffer is linear.
BUG: 408594
FIXED-IN: 5.16.3
Differential Revision: https://phabricator.kde.org/D22153
Signed-off-by: Fredrik Höglund <fredrik@kde.org>
Summary:
The screenlock fails on X11 if it can't grab the keyboard.
We can't nicely solve the generic case. We can solve the common case of
a kwin effect being active.
It's not critical, arguably not even desirable to have these effects
persist after the screen is locked through an external trigger. We can
just close the effect early.
Key grabs have to be relased early before the close animation completes
so that the locker doesn't have a race based on animation times.
It's not ideal, but no worse than the current state for not much work.
BUG: 234153
Test Plan:
locked screen on a timer
opened various effects
Reviewers: #kwin, zzag
Reviewed By: #kwin, zzag
Subscribers: ngraham, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D20890
Summary:
Plasma's Task manager exposes an optional feature whereby the user
can middle-click on a window to close it, but the Present Windows effect
does not do the same.
The presence of a close button you can left-click does not replace the desirable
feature to be able to middle-click on a window to close it, because then the
whole window becomes a click target, so it can be much much faster than
having to aim for the little close button. Also it's off by default, so a user
who goes out of their way to turn it on is signaling that they want to accept the
risk of accidentally closing a window by accident.
Finally, the feature is not allowed for left-click, so people can never accidentally
wreck Present Windows for themselves by assigning it to left-click by accident
and then mistakenly closing their windows.
This reverts commit 55585514f9.
FEATURE: 321190
FIXED-IN: 5.17.0
Test Plan:
Set "Close window" in the Present windows effect, trigger effect, and middle-click on window
{F6815303}
Reviewers: #kwin, davidedmundson, broulik, zzag, #plasma, hein, mart
Reviewed By: #kwin, #plasma, mart
Subscribers: mart, abetts, apol, zzag, luebking, kossebau, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21083
On modern machines session startup takes a few seconds where the 2s might artificially slow down the process by like 50%.
This makes the animation quicker to make the system feel ready quicker.
Differential Revision: https://phabricator.kde.org/D21904
Summary:
Since KSnapshot is no longer used, I modified the text in `effect_builtins.cpp` to reflect that, changing it to a generic "screenshot tools".
BUG: 408407
FIXED-IN: 5.17.0
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: filipf, davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21700
Summary:
xcb_put_image doesn't handle big images well. Contrary to XPutImage, the
caller must manually split the data in such a way that each xcb_put_image
request doesn't exceed the maximum request length. Not doing so will result
in libxcb shutting down the connection.
CCBUG: 338489
CCBUG: 388182
Test Plan: Take a screenshot of an active fullscreen client on a 4K monitor.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21370
Summary:
The Lanczos filter is applied to thumbnails, so we need to specify screen
projection matrix in order to properly project window coordinates into
screen-space.
BUG: 407485
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21224
Summary:
If a virtual desktop is removed, then desktopChanged will be followed by
numberDesktopsChanged signal. In which case, we have to cancel the
active animation because front_desktop might be no longer valid when
it's time to perform compositing.
BUG: 406452
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D21064
Summary:
Some old themes have the flag set and also a style which expects the
borders to be stretched. Given that the documentation on techbase
describes widgets/glowbar still as "a frame without a prefix", one also
would assume that all the optional hints (which make sense) still apply.
Even more, the Air & Oxygen themes have the hint also set, though for
their rendering it makes no difference.
The small code needed seems worth the unbreaking of old themes as well
as giving theme creators another variable of freedom for their styles.
Test Plan:
Glow bar still works on all corners and edges with all themes as before,
though rendering now as expected for themes which have the
"hint-stretch-borders" set.
Reviewers: #kwin, zzag, davidedmundson
Reviewed By: #kwin, zzag, davidedmundson
Subscribers: davidedmundson, zzag, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D20621
Summary:
Window open/close animation effects should not animate the outline
because the end result is a bit awkward.
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D19886