Commit Graph

11 Commits (master)

Author SHA1 Message Date
Vlad Zahorodnii 4ce853e8e4 Prettify license headers 2020-08-07 19:57:56 +00:00
Vlad Zahorodnii 1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00: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
Roman Gilg d51b8dc093 [decorations] Let KDecoration plugins recommend a border size per default
Summary:
This is an alternative solution to T8707 and in comparision to D13276 a less
drastic change to KWin's default behavior.

Instead of changing the border size default for all KDecoration plugins by
switching the default from border size Normal to None introduce new
functionality, which allows a KDecoration plugin to recommend a border size in
its metadata. By default KWin listens for these recommendations and sets the
border size accordingly.

If there is no metadata recommending a border size, KWin falls back to the
current setting of Normal sized borders.

A user is able to override the recommendations from the KCM, which has been
extended accordingly.

Test Plan: Manually with adjusted metadata of Breeze.

Reviewers: #kwin, #plasma, #vdg, ngraham

Reviewed By: #vdg, ngraham

Subscribers: hpereiradacosta, filipf, anemeth, davidedmundson, abetts, graesslin, ngraham, zzag, kwin

Tags: #kwin

Maniphest Tasks: T8707

Differential Revision: https://phabricator.kde.org/D13284
2019-06-06 22:24:45 +02:00
Vlad Zagorodniy 80da18a143 [decorations] Emit DecorationSettings::fontChanged signal
Summary:
No one emits DecorationSettings::fontChanged signal, so if you change
the window title font, then titlebars might look differently after reboot.

Currently, there are two places where we can emit that signal:
- in KDecoration library itself;
- and in KWin.

Because we would need to listen for a Plasma specific D-Bus signal, the
latter option is preferable.

Surprisingly, KWin's implementation of DecorationSettingsPrivate already
reacts to refreshFonts D-Bus signal (even though indirectly), so all
what we have to do is get the current window title font in
SettingsImpl::readSettings, and if it's different from the previous one,
emit DecorationSettings::fontChanged signal.

BUG: 400980
FIXED-IN: 5.15.0

Test Plan:
* Increased the size of the window title font, titlebars got bigger;
* Decreased the font size, titlebars got smaller.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16908
2018-11-15 22:08:41 +02:00
Martin Gräßlin 39f9581d4f Bring back configuration options for Decorations
* Border Sizes
* Close menu double click

Both are added to the Settings and exposed in the decoration kcm.
As it started to no longer scale the kcm uses a ui file.

Still missing:
* buttons
* custom decoration configuration
* GHNS
* search
2014-12-04 16:28:06 +01:00
Martin Gräßlin 106e595709 DecorationSettings provides QVector for decorationButtons 2014-12-01 11:53:44 +01:00
Martin Gräßlin 796ac23672 Provide isCloseOnDoubleClickOnMenu in DecorationSettingsImpl
Needs proper implementation taking from config value.
2014-07-25 14:02:27 +02:00
Martin Gräßlin b12d11a06c Add border size to the implementation of DecorationSettings
Not yet read from any config value.
2014-07-25 14:02:27 +02:00
Martin Gräßlin 24a4a87bac Load settings for KDecoration2 based plugins
* library to load
* decoration buttons (based on old KDecoration1 implementation)
2014-07-25 14:02:27 +02:00
Martin Gräßlin 0030eb7f84 Initial import of support for new KDecoration2 based decorations
NOTE: this is not working completely yet, lots of code is still ifdefed
other parts are still broken.

The main difference for the new decoration API is that it is neither
QWidget nor QWindow based. It's just a QObject which processes input
events and has a paint method to render the decoration. This means all
the workarounds for the QWidget interception are removed. Also the paint
redirector is removed. Instead each compositor has now its own renderer
which can be optimized for the specific case. E.g. the OpenGL compositor
renders to a scratch image which gets copied into the combined texture,
the XRender compositor copies into the XPixmaps.

Input events are also changed. The events are composed into QMouseEvents
and passed through the decoration, which might accept them. If they are
not accpted we assume that it's a press on the decoration area allowing
us to resize/move the window. Input events are not completely working
yet, e.g. wheel events are not yet processed and double click on deco
is not yet working.

Overall KDecoration2 is way more stateful and KWin core needs more
adjustments for it. E.g. borders are allowed to be disabled at any time.
2014-07-25 14:02:26 +02:00