Commit Graph

175 Commits (5646c781c88ab0f0427f23102bea889a835bd378)

Author SHA1 Message Date
Vlad Zahorodnii 62a7db7028 Use nullptr everywhere
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
2019-09-19 17:48:21 +03: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
Frederik Gladhorn b64e67ce7c Remove disabled TabGroup feature
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
2019-09-14 10:58:48 +02: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
Vlad Zagorodniy 253ff428a7 [effects] Port to new connect syntax
Summary:
The new connect syntax has several advantages over the old syntax:

(a) Connecting with the new syntax is faster;
(b) It is compile time checked.

There are still a few places where the old connect syntax is used, e.g.
connecting to QML buttons in the Desktop Grid effect.

Test Plan:
Have been testing this patch for ~2 weeks, haven't noticed any
regressions.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, broulik, graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18368
2019-01-26 01:22:06 +02:00
David Edmundson fe47a8d9b9 [effects/slideback] Port away from deprecated EffectWindow::desktop
Summary:
Not only does the function windowsShareDesktop become a lot more complex
with the new desktop cardinality comparing if they share any desktop
isn't actually what we want.

If I have 2 windows on desktop 1 and the lower stacked window is also on
desktop 2, when I switch desktops the focus will change, but we don't
want to animate anything here as on this dekstop it has nothing to slide
in front of.

Instead this patch simply checks both windows are on the current
desktop.

Test Plan:
Loaded a few windows. Some on one, some on more.
Before if a window was on desktop 1&2 it wouldn't animate on 2.

Windows now seem to animate when they should and not when they shouldn't.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17943
2019-01-03 16:47:28 +00:00
Vlad Zagorodniy e9ab34854d [effects] Ignore previous state of WindowForceBlurRole
Summary:
Currently, effects like Maximize, Slide Back have problems with setting
WindowForceBlurRole. They store previous state of WindowForceBlurRole.
This is wrong. Instead they should either ignore previous state of
WindowForceBlur or refcount forced role.

There's no need for refcounting right now. For example, if several effects
force blur or background contrast, they are most likely in a conflict.
Please notice that the Desktop Grid effect uses the Present Windows
effect only to calculate transformations.

Some other problems with the code that sets WindowForceBlurRole:
* Maximize effect stores previous state of WindowForceBlurRole only
  for one window. It ignores the fact that there could be several
  active maximize animations;
* Desktop Grid/Present Windows/Slide back don't clean after themselves.
  So, after using those effects for good amount of times, memory usage
  will bump.

Test Plan:
* Enabled blur for Konsole
* Maximized Konsole
* Activated Present Windows
* Activated Desktop Grid
* Raised another window(to trigger Slide Back)

Reviewers: #kwin, fredrik

Reviewed By: fredrik

Subscribers: fredrik, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D13479
2018-06-19 15:23:41 +03: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
Martin Flöser 24ff93854d [effects/slideback] Ignore windows which are not in visible area
Summary:
The PresentWindows effect does not hide the window to close the selected
window. Instead it moves it outside the visible area. As this is a
"special" KWin window it is on top of the stacking order and needs to be
ignored in the slideback effect.

Instead of doing a special casing for this window the effect is changed
to ignore windows outside the visible area in general. Windows outside
the visible area just don't make sense to block the slideback effect.

BUG: 381402
FIXED-IN: 5.10.4

Test Plan: Slideback works after using Present Windows effect

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6468
2017-07-06 19:12:06 +02:00
Martin Gräßlin 919b497f90 [effects/slideback] Consider windows which do have painting disabled as not usable
Summary:
On Wayland it can happen that a window is still in the stacking order
although it is not visible. This is mostly the case for Plasma windows.
So far the slideback effect did not ignore those windows and as they are
higher in the stacking order than most other windows it blocked the
effect from working once a Plasma panel element got closed.

This change considers a window which has painting disabled in the
stacking order as not usable and thus filters out all those windows.

BUG: 364483

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D5462
2017-04-20 17:03:12 +02:00
Thomas Lübking 3525d1ce02 explicitly update the stack track on unminimization
the stackingOrderChanged() signal came before the window turned an effect window
usually this is no problem as the change shall not be caught anyway, but
the window may have changed its stack position

BUG: 353745
FIXED-IN: 5.5
REVIEW: 126134
2015-11-24 22:38:49 +01:00
Martin Gräßlin 4a1bc2ec96 [effects] Drop the .desktop files for the BuiltIn Effects
All KCMs and KWin core use the BuiltInEffects namespace to find and
interact with the effects. There is no information left in the desktop
file which are of usage. Thus they can be removed.
2014-04-28 13:52:43 +02:00
l10n daemon script e1f418f4d0 SVN_SILENT made messages (.desktop file) 2014-04-28 09:00:35 +00:00
l10n daemon script f44575ddbf SVN_SILENT made messages (.desktop file) 2014-04-28 05:16:52 +00:00
l10n daemon script 69c3289c18 SVN_SILENT made messages (.desktop file) 2014-04-27 21:02:43 +00:00
l10n daemon script 43fd082b0a SVN_SILENT made messages (.desktop file) 2014-04-06 05:11:55 +00:00
l10n daemon script e6db000065 SVN_SILENT made messages (.desktop file) 2014-04-04 05:29:27 +00:00
l10n daemon script eef56c98b2 SVN_SILENT made messages (.desktop file) 2014-04-03 05:10:09 +00:00
Martin Gräßlin 3bbc9436db [kwin] Add a virtual Effect::requestedEffectChainPosition
This method replaces the X-KDE-ORDERING property in the Effect's desktop
files. This change is a preparation step for integrating the new Effect
Loader which doesn't read the ordering information. Thus it needs to be
provided by the Effect itself so that the EffectsHandler can properly
insert it into the chain.

Also for the built-in Effects on the long run it doesn't make much sense
to install the desktop files. And binary plugin effects will migrate to
json metadata which also doesn't have the KService::Ptr. Thus overall it
simplifies to read this information directly from the Effect.
2014-03-28 14:04:54 +01:00
l10n daemon script 6f8c3dd771 SVN_SILENT made messages (.desktop file) 2014-02-18 05:12:30 +00:00
Martin Gräßlin 76efe517a7 Turn built-in effects into a library kwin links against
As all effects have always been compiled into the same .so file it's
questionable whether resolving the effects through a library is useful
at all. By linking against the built-in effects we gain the following
advantages:
* don't have to load/unload the KLibrary
* don't have to resolve the create, supported and enabled functions
* no version check required
* no dependency resolving (effects don't use it)
* remove the KWIN_EFFECT macros from the effects

All the effects are now registered in an effects_builtins file which
maps the name to a factory method and supported or enabled by default
methods.

During loading the effects we first check whether there is a built-in
effect by the given name and make a shortcut to create it through that.
If that's not possible the normal plugin loading is used.

Completely unscientific testing [1] showed an improvement of almost 10
msec during loading all the effects I use.

[1] QElapsedTimer around the loading code, start kwin five times, take
average.

REVIEW: 115073
2014-01-24 14:13:59 +01:00
l10n daemon script 22a5e1109f SVN_SILENT made messages (.desktop file) 2014-01-19 04:06:03 +00:00
l10n daemon script 551988ebd4 SVN_SILENT made messages (.desktop file) 2013-11-23 03:52:00 +00:00
l10n daemon script 23fbf4395f SVN_SILENT made messages (.desktop file) 2013-10-09 04:14:36 +00:00
l10n daemon script 30aac961f0 SVN_SILENT made messages (.desktop file) 2013-08-05 04:16:04 +00:00
l10n daemon script 50dfc83d2e SVN_SILENT made messages (.desktop file) 2013-07-31 04:07:19 +00:00
l10n daemon script 68bf8072b2 SVN_SILENT made messages (.desktop file) 2013-07-30 04:11:51 +00:00
l10n daemon script 87a7569100 SVN_SILENT made messages (.desktop file) 2013-07-27 04:01:18 +00:00
l10n daemon script 467b772a90 SVN_SILENT made messages (.desktop file) 2013-07-21 04:08:51 +00:00
l10n daemon script 52461e5885 SVN_SILENT made messages (.desktop file) 2013-07-20 06:40:25 +00:00
l10n daemon script 88e8e01ea7 SVN_SILENT made messages (.desktop file) 2013-07-13 06:44:24 +00:00
l10n daemon script 205c557f89 SVN_SILENT made messages (.desktop file) 2013-07-05 03:48:50 +00:00
l10n daemon script 502d003ef5 SVN_SILENT made messages (.desktop file) 2013-06-23 04:02:47 +00:00
l10n daemon script a2e9957860 SVN_SILENT made messages (.desktop file) 2013-06-10 03:46:39 +00:00
l10n daemon script 34c8d6feb6 SVN_SILENT made messages (.desktop file) 2013-06-05 04:54:40 +00:00
l10n daemon script 020f6fd612 SVN_SILENT made messages (.desktop file) 2013-05-30 04:29:57 +00:00
l10n daemon script 3a0999688f SVN_SILENT made messages (.desktop file) 2013-05-24 03:35:07 +00:00
l10n daemon script a3b09b7ac4 SVN_SILENT made messages (.desktop file) 2013-05-22 03:36:01 +00:00
Script Kiddy e5316fa9d9 SVN_SILENT made messages (.desktop file) 2013-05-17 09:43:27 +02:00
Script Kiddy 68ddc5f236 SVN_SILENT made messages (.desktop file) 2013-05-11 10:34:17 +02:00
Script Kiddy 44c8899fee SVN_SILENT made messages (.desktop file) 2013-05-10 11:04:42 +02:00
Script Kiddy 5a32f8e813 SVN_SILENT made messages (.desktop file) 2013-05-06 09:31:10 +02:00
Script Kiddy dfd72523b1 SVN_SILENT made messages (.desktop file) 2013-05-02 09:17:01 +02:00
Script Kiddy ffc0e62f9d SVN_SILENT made messages (.desktop file) 2013-05-01 09:12:42 +02:00
Script Kiddy 0922410d5b SVN_SILENT made messages (.desktop file) 2013-04-30 17:35:40 +02:00
Script Kiddy d2b718ac0d SVN_SILENT made messages (.desktop file) 2013-04-20 09:51:27 +02:00
Script Kiddy 71743ba5cb SVN_SILENT made messages (.desktop file) 2013-04-18 09:41:16 +02:00
Script Kiddy 041ee1ac71 SVN_SILENT made messages (.desktop file) 2013-04-17 09:15:50 +02:00
Feng Chao 7854d12743 Fix Bug 316877 - Description text for the Slide Back effect is incorrect
Change "Slide back windows losing focus" to
"Slide back windows when another window is raised"

BUG: 316877
2013-04-16 20:44:49 +08:00
Thomas Lübking 499e34736b check list validity before taking last item
also block for tabboxes *around* stackorder changes

BUG: 315528
2013-03-05 19:24:30 +01:00