Commit graph

93 commits

Author SHA1 Message Date
David Edmundson
1a13015d2d Possible fix for KDecoration crash in systemsettings
Summary:
I could never reproduce the crash, but we know from gdb that it's from
the decorationSettings object

We are setting the same QObject instance as a context property in
multiple contexts at once. This is already slightly odd especially from the POV of
Qt's internal property cache.

Given we want one object to be exposed to all contexts, we can expose it
to the parent context only once and achieve the same result in a simpler
way.

BUG: 411166

Test Plan:
Verified opening and closing system settings still worked for me.
I could never reproduce the original crash.

Reviewers: #kwin, ngraham

Reviewed By: ngraham

Subscribers: ngraham, apol, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D25913
2019-12-14 16:08:16 +01:00
l10n daemon script
71c3f063bb 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-10-23 09:01:14 +02:00
Vlad Zahorodnii
982fefd389 [aurorae] Fix visibility of Context Help button
Summary:
providesContextHelp is a property of DecoratedClient, not Decoration.

BUG: 413145
FIXED-IN: 5.17.1

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24851
2019-10-22 11:21:52 +03:00
David Edmundson
446e23af5a [aurorae] Fix crash on KCM teardown with Qt5.14
Summary:
Context behaviour subtly changed in Qt5.14 which has exposed some
questionable things in this KCM.

Auorae::Decoration is a context property of the loaded QML.

QObject::~QObject signals it's own deletion before deleting children.
This means the bindings of loaded QML update in particular

aurorae.qml
   DecorationOptions {
        id: options
        deco: decoration
    }

DecorationOptions has a pointer to the previously set decoration which
is now dangling, and we crash.

Rather than adding more guards and smart pointers in DecorationOptions,
this patch deletes the QQmlContext before deleting the context
properties that we expose.

It also moves unreferring the shared qmlcontext we inherit from till
after we've deleted the child context, because it didn't make sense.

Test Plan:
Opened KCM
Closed the KCM
didn't crash

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24594
2019-10-15 12:40:55 +01:00
Vlad Zahorodnii
dcf91d4321 Cleanup style in CMakeLists.txt files
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.
2019-09-17 16:03:05 +03:00
l10n daemon script
fd702c3644 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-17 05:29:51 +02:00
Laurent Montel
42326f6ded GIT_SILENT: QLatin1Literal->QLatin1String 2019-09-08 21:18:29 +02:00
Vlad Zagorodniy
ffd4a3b390 [plugins/aurorae] Fix indentation in Decoration::updateBuffer
CCMAIL: kde@davidedmundson.co.uk
2019-08-28 19:39:31 +03:00
David Edmundson
af56a0ca0e [Aurorae] Remove effective triple buffering
Summary:
KWin blits contents into a QImage raster buffer. Because of this we
don't need our underlying GL surface to be double buffered as it
effectively makes the whole thing tripple buffered.

Test Plan: Ran Aurorae, looked the same, should save some memory

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23331
2019-08-28 17:34:56 +01:00
David Edmundson
c67d81aeb9 [Aurorae] Don't delay initial blit.
Summary:
Aurorae has a timer between request update and updating the contents.
This makes some sense.

However on initial creation we want to snap the contents immediately as
otherwise we may be out by a frame between a new window being mapped and
the window decoration being rendered.

Test Plan:
Ran with Auroae
Windows opened immediately seemed to have a deco straight away

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, romangg, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23332
2019-08-28 17:34:56 +01:00
Vlad Zagorodniy
684b4b635e Use more traditional doxygen style
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
2019-07-29 22:06:19 +03:00
Vlad Zagorodniy
53936854c7 [aurorae] Make QML-based decoration themes react to border size changes
Summary:
Currently only SVG-based decoration themes react to border size changes.
QML-based decoration themes on the other hand, for example Plastik, don't
react to such changes, only new windows will have decorations with the
new border size.

BUG: 408035

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22665
2019-07-29 21:23:01 +03:00
Vlad Zagorodniy
8af2fa73dc Run clang-tidy with modernize-use-override check
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
2019-07-22 20:03:22 +03:00
l10n daemon script
9c0a71c37f 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-07-13 05:18:09 +02:00
Vlad Zagorodniy
cccb3456f3 Use QColor::darker/lighter instead of QColor::dark/light
Summary: QColor::dark() and QColor::light() are obsolete since long time ago.

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22360
2019-07-10 02:03:10 +03:00
Yuri Chornoivan
835f3dfde9 Really use the translations. Patch by Victor Ryzhykh <victorr2007@yandex.ru> 2019-05-29 15:16:04 +03:00
Antonio Rojas
94d2fea23a Move knsrc files to the new location
Instead of the old legacy /etc/xdg location

Differential Revision: https://phabricator.kde.org/D21254
2019-05-17 18:56:27 +02:00
Volker Krause
008143c9db Update URLs to use https
Summary: Largely done automatically using the tools from D19996.

Reviewers: yurchor, zzag

Reviewed By: yurchor, zzag

Subscribers: zzag, yurchor, kwin, kde-doc-english

Tags: #kwin, #documentation

Differential Revision: https://phabricator.kde.org/D20017
2019-03-25 19:26:23 +01:00
Laurent Montel
7b4ef76de6 Remove deprecated method 2019-03-01 08:15:31 +01:00
Vlad Zagorodniy
7b20e1f66f Overhaul doxygen comments
Summary:
We have a mix of different doxygen comment styles, e.g.

    /*!
      Foo bar.
     */

    /**
     * Foo bar.
     */

    /** Foo bar.
     */

    /**
     * Foo bar.
     */

    /**
     * Foo bar.
     **/

To make the code more consistent, this change updates the style of all
doxygen comments to the last one.

Test Plan: Compiles.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18683
2019-02-12 19:29:33 +02:00
l10n daemon script
ba0b34c755 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-11-22 06:02:11 +01:00
Martin Flöser
54eb3bf137 Copy the aurorae decoration qml plugin to bin dir in build directory
Summary:
Look there, another plugin I didn't remember. The other qml files are
not needed for the aurorae autotest as it's for the svg based themes
instead of qml themes like Plastik.

Test Plan: Further destroyed my system, test failed, with this change passed.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16761
2018-11-09 09:27:34 +01:00
Martin Flöser
80d0915cf8 [aurorae] Print qml errors during instantiation of qml based deco
Summary:
So far we didn't know why plastik wasn't loaded. Now we get the error
messages.

Test Plan: Saw error messages while investigating failing KWin test

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16753
2018-11-08 10:38:35 +01:00
Martin Flöser
ee68994419 Build plastik plugin at correct location in build tree
Summary: The tests running Aurorae need to be able to pick up the plastik plugin.

Test Plan: Removed system install of plastik plugin, now test passes

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16752
2018-11-08 09:52:54 +01:00
Martin Flöser
c19627b492 Copy plastik window decoration to build directory
Summary:
This ensures that DontCrashAuroraeDestroyDecoTest can load the plastik
window decoration when run from build directory as it happens on
build.kde.org.

Test Plan: Test passes now when manipulating XDG_DATA_DIRS to hide system install

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16745
2018-11-08 08:31:17 +01:00
Laurent Montel
2043161889 Remove unused check 2018-10-25 08:05:13 +02:00
David Edmundson
463ccfc8bb Revert "Workaround crash in Aurorae destruction"
This reverts commit 275b7ee0f4.

BUG: 395732
2018-06-24 13:28:23 +01:00
David Edmundson
275b7ee0f4 Workaround crash in Aurorae destruction
Summary:
Workaround QtBug-68997

Deleting of a RenderControl/render controlled window triggers deletion
of other queued deleted items, putting KWin in a corrupt state. See Qt
bug report.

Deleting this queued means we know we don't have anything else going on
in the stack which should make this somewhat safe.

BUG: 395346

Test Plan:
Couldn't reproduce original crash. Based purely on the incomplete backtrace and code reading

Set an Aurorae theme. Closed some windows. Things still worked as before

Reviewers: #kwin, #plasma, mart

Reviewed By: #kwin, #plasma, mart

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13614
2018-06-20 09:39:29 +01:00
l10n daemon script
d8addb6b3a 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-06-18 07:25:30 +02:00
David Edmundson
04dbafd75e Fix Plastik bottom and right border
Summary:
x and y are always relative to the parent, adding parent.width to
calculate the position doesn't make sense.

Original author meant just "x: parent.width-1"
But we may as well just use anchors. Programatically it comes out the
same.

Test Plan:
No more weird vertical lines in the KCM when view is slightly less than 2 previews wide.
Modded colour to hardcoded "red" for easier visualisation, checked it looked ok when set as a real deco.

Reviewers: #plasma

Subscribers: plasma-devel, kwin, #kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9776
2018-01-10 12:11:09 +00:00
Martin Flöser
1c61e61119 [autotests] Support new way to run the tests without need to install
Summary:
KWin was quite good in ensuring that you don't need to install by
passing paths to the tests. The new way is much nicer, so code is
adjusted for the new way. Also if we require a newer ECM in future we
need to support the new way.

No guarantee that the tests don't pick something up from the system env,
that needs more testing.

References: https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled

Test Plan: The tests which loaded helpers pass

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7543
2017-11-21 20:34:52 +01:00
l10n daemon script
1a6662e796 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"
2017-11-06 04:38:04 +01:00
David Edmundson
54b36325f7 Support software QtQuickRendering in Aurorae
Summary:
For software QtQuick rendering we want to create a pixmap buffer and
render our contents in there.

m_rendercontrol->grab does this, but also covers the GL side in pretty
much the same way that we were currently doing.

In doing so I found a bug in Qt, that's submitted upstream, and also worked round.

Test Plan:
Tested with forced software mode, could see an Aurorae decorations
Tested without (so normal code), could see an Aurorae decorations
Tested wayland on nvidia with software rendering, didn't freeze

Whether we then end up using GL, painter or xrender rendering is irrelevant
(but I tested two of them anyway)

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

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

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8039
2017-11-01 15:50:48 +00:00
Martin Flöser
a5b17b2228 Require Qt 5.9
Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8331
2017-10-31 12:45:21 +01:00
l10n daemon script
5a7d6d3df9 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"
2017-08-28 04:30:46 +02:00
l10n daemon script
004a9aa6ea 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"
2017-08-07 04:53:10 +02:00
David Edmundson
777f7009ed Merge branch 'Plasma/5.10' 2017-07-28 12:52:31 +01:00
David Edmundson
308ab76428 Update KNS providers to https
CCBUG: 382820
2017-07-28 12:51:41 +01:00
Martin Flöser
eee2ace6a1 Make Q_FALLTHROUGH code compile with Qt < 5.8
sorry for breaking FreeBSD CI build. I didn't expect Q_FALLTHROUGH being
newer.
2017-07-27 21:51:47 +02:00
Martin Flöser
4b89011099 Fix (incorrect) implicit-fallthrough warnings in gcc7
All cases are annotated that it's an explicit fallthrough, so add
Q_FALLTHROUGH to silence the warning.
2017-07-27 20:46:44 +02:00
l10n daemon script
ccc69e8105 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"
2017-07-26 08:52:42 +02:00
Martin Flöser
bf0e0f071c [aurorae] Add support for shaded windows
Summary:
Aurorae did not render correctly. This change addresses the problem for
both maximized and restored windows.

BUG: 373319
FIXED-IN: 5.10.4

Test Plan: shaded windows with Plastik and SVG based theme

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6719
2017-07-17 16:51:57 +02:00
Martin Flöser
5cb91762be [aurorae] Mark the render QQuickWindow as frameless
Summary:
On Wayland aurorae was creating a lot of stress for the system and
basically turning the system unusable in a short time. This was due to
a recursion starting to create OpenGL contexts. The window created a
decoration (aurorae) which created a QQuickWindow. For that KWin creates
an internal window which in turn triggers the creation of a window
decoration and so on and on.

By simply setting the render QQuickWindow as frameless we can prevent
this recursion.

Test Plan: Tested on Wayland and X11. On Wayland the recursion is gone.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6726
2017-07-17 16:51:04 +02:00
l10n daemon script
8765f5b4c3 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"
2017-06-23 05:46:51 +02:00
l10n daemon script
1112188a8b 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"
2017-06-10 05:41:19 +02:00
David Edmundson
5091feb8f6 Fix Aurorae decorations with non integer DPI
Summary:
As noted by Thomas L we're casting the scaleFactor to an int far too
early, which in the worst case means we end up with Aurorare themes not
rendering.

This moves the rounding to where it's used per border.

BUG: 380524

Test Plan:
Forced Xft.DPI to 95 with xrdb. Confirmed that it was broken
Applied this patch. Got decoration again

Reviewers: #plasma, mart

Reviewed By: #plasma, mart

Subscribers: mart, rikmills, plasma-devel, kwin, #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6099
2017-06-05 10:50:01 +01:00
l10n daemon script
7a14a0ef4d 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"
2017-05-12 05:44:57 +02:00
l10n daemon script
9ad87d3909 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"
2017-05-10 07:42:38 +02:00
l10n daemon script
dc447860be 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"
2017-04-25 10:05:35 +02:00
l10n daemon script
2d0f08b006 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"
2017-03-28 09:41:02 +02:00