136 Commits (fd702c3644f7d94327fae05f276ab3fbaac4f7c1)

Author SHA1 Message Date
Vlad Zagorodniy a035401b55 Use XCB wherever possible
Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D23756
5 years ago
Vlad Zagorodniy 630006e6f7 Delete unused includes
We don't use assert().
5 years ago
Vlad Zagorodniy 7a3722b4f5 Switch to Q_ASSERT
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
5 years ago
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
5 years ago
Vlad Zagorodniy c7639fd7ed Port away from deprecated headers
Summary: Headers like stdio.h are deprecated in C++.

Test Plan:
Compiles.

clangd no longer spews these warnings

{F6997789, size=full}

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22351
5 years ago
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
6 years ago
Martin Flöser 2799f69533 Move groupTransient and group from Client to AbstractClient as virtual
Summary:
The default implementations just return false/nullptr. The advantage of
having this in AbstractClient is that we can reduce the needed casts
from AbstractClient to Client in core as can be seen in this change.

There are more cases which can be improved thanks to this refactoring
which will follow in dedicated commits.

Test Plan: ctest passes

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17890
6 years ago
Jaime Torres 2c7b1cf762 From 22% of cpu in hasTransientInternal to 0.2x%
Summary:
According to callgrind, checking kwin in release with debug symbols,
22% of cpu time in the method hasTransientInternal is spent doing
a cast to Client *, while at the begining of the method, the cast to
const Client * only uses 1.0x%.

Test Plan:
The workload was just show 50 messagebox copying small files and being
unable to change the permissions.

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9982
7 years ago
Martin Flöser f0f4e494fe Merge branch 'Plasma/5.11' 7 years ago
Martin Flöser 1ae7990a95 Allow a cross-process check for same applications
Summary:
Commit 5d9027b110 introduced a regression in TabBox by using the generic
framework inside KWin to test for same application. What I did not
consider was that the code in TabBox was "broken by design". It didn't
use the generic check as that is too strict and considers windows from
different processes as not belonging to the same application. But this
is not wanted in the case of TabBox.

On the other hand the change itself is an improvement to also support
Wayland in a better way and not have special handling situations. Thus
just reverting would not help.

Instead this change addresses the problem by extending the internal API
and to allow more adjustements. So far there was already an
"active_hack" boolean flag. This is extended to proper flags with an
additional flag to allow cross application checks.

The checks in Client which would filter out different applications check
for this flag and are skipped if set. In addition ShellClient also adds
support for this flag and compares for the desktop file name.

Thus we get in TabBox the same behavior as before with the advantage of
having a better shared code base working on both X11 and Wayland.

BUG: 386043
FIXED-IN: 5.11.4

Test Plan:
Started two kwrite processes on X11, clicked new in one of them,
used Alt+` and verified that there are three windows shown.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D8661
7 years ago
Martin Flöser e6ca321317 Drop ENABLE_TRANSIENCY_CHECK related code as it doesn't compile
Summary:
The code ifdefed by ENABLE_TRANSIENCY_CHECK does no longer compile and
has not compiled since the switch to Qt 5 and KF5 as it still uses
kDebug and (worse) kDBacktrace. There are several other changes which
broke the code and I failed trying to get it to compile again. It's a
classic example of bitrot happening to code which is never getting
compiled.

As this has not been in a state which could compile for at least several
years, I think it's best to completely remove it.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7958
7 years ago
Martin Gräßlin a6118016ec Reintroduce nullptr check in Client::removeFromMainClients
Removed by accident in 69be73d3, of course needed and causes an
unusable session due to kwin crashing when managing clients.

Sorry!
9 years ago
Martin Gräßlin 4a3d0fdac6 Workspace::updateOnAllDesktopsOfTransients operates on AbstractClient 9 years ago
Martin Gräßlin 69be73d382 Remove no longer needed casts to Client regarding transients
Restores to functionality before refactoring.
9 years ago
Martin Gräßlin 2f7597e522 Move transients from Client to AbstractClient
Unfortunately introduces a few casts to Client again.
9 years ago
Martin Gräßlin 1d242d9daf Move mainClients() and allMainClients from Client to AbstractClient
AbstractClient::mainClients is virtual and overriden in Client,
allMainClients has only a common implementation in AbstractClient.

In activation.cpp we still need one case where a temporary ClientList
needs to be constructed. Once transients are fully migrated that should
be removable again.
9 years ago
Martin Gräßlin a5d3317645 Use auto for iterator over transients()
Preparation for changing transients to QList<AbstractClient>.
9 years ago
Martin Gräßlin df98e3883f Move hasTransient from Client to AbstractClient 9 years ago
Martin Gräßlin c4c3dfc73f Move transientFor from Client to AbstractClient
Right now this caused a few dynamic_casts. On the other hand existing
dynamic_casts from AbstractClient to Client can be removed again.
9 years ago
Thomas Lübking 295132deef reset the transientInfo id when cleaning group
otherwise a pseudo-transient window with no
group causes a nullptr deref in eg. mainClients

BUG: 352483
FIXED-IN: 5.4.2
REVIEW: 125122
9 years ago
Aleix Pol 6f345f4915 Clean debug output
Removes endl in the end of qDebug.
Removes the \n in the end of opengl output.

REVIEW: 124320
9 years ago
Martin Gräßlin 94ce47ef7b Workspace::mostRecentlyActivatedClient returns an AbstractClient
Implementation temporarily moved to cpp. Needs to be moved back once
should_get_focus and active_client are AbstractClient.
10 years ago
Martin Gräßlin 6e45901844 TabBoxClientImpl changed to using an AbstractClient
The change is mostly straight forward. Effects are straight forward
adjusted. Client::findModal is moved up, this causes still a few
dynamic_casts to Client. Mostly because Workspace::activateClient still
operates on Client.
10 years ago
Martin Gräßlin d66a804bbb Drop not needed includes of QX11Info 10 years ago
Martin Gräßlin 77e6e99209 Use NETWinInfo overload for icons in Group::icon
Reduces number of possible roundtrips by fetching the NETWinInfo for
the leader_wid once and passing it to KWindowSystem::icon. This way
the NETWinInfo can be shared for all sizes instead of having
KWindowSystem::icon create a new instance with roundtrips for each
size.

REVIEW: 122605
10 years ago
Martin Gräßlin 5abccbec7d Split Client::readTransient into two parts 10 years ago
Daniel Pastushchak 0d997b1093 Introduce categorized logging for kwin core
Done by Daniel Pastushchak for KDE during GCI-2014.
10 years ago
Martin Gräßlin 9fae34f86f Remove Client::getWMHints in favor of functionality in NETWinInfo
We are only using the UrgencyHint, InputHint and GroupLeader from
WMHints. Those are provided by NETWinInfo, so we can use the
functionality provided by NETWinInfo instead of calling XGetWMHints.

REVIEW: 120162
10 years ago
Martin Gräßlin 4a79cec8a6 Drop hacks and default rule for XV
Apparently it's not about mplayer but about XV [1], not really a relevant
application nowadays which would be important enough for having hacks.

REVIEW: 117479

[1] https://en.wikipedia.org/wiki/Xv
11 years ago
Martin Gräßlin 6828f33548 Remove hack for "mozilla"
It's dead, since 2006 it's "SeaMonkey" and it has a proper window class:
WM_CLASS(STRING) = "Navigator", "Seamonkey"

(Yes, I installed it. No, my distro doesn't have a package.)

REVIEW: 117472
11 years ago
Martin Gräßlin bc0a9cb53a [kwin] Use std::find_if and lambda functions for Workspace::findClient
Instead of passing the macro based Predicate to findClient it now
expects a function which can be passed to std::find_if.

Existing code like:
xcb_window_t window; // our test window
Client *c = findClient(WindowMatchPredicated(window));

becomes:
Client *c = findClient([window](const Client *c) {
    return c->window() == window;
});

The advantage is that it is way more flexible and has the logic what
to check for directly with the code and not hidden in the macro
definition.

In addition there is a simplified overload for the very common case of
matching a window id against one of Client's windows. This overloaded
method takes a Predicate and the window id.

Above example becomes:
Client *c = findClient(Predicate::WindowMatch, w);

Existing code is migrated to use the simplified method taking
MatchPredicate and window id. The very few cases where a more complex
condition is tested the lambda function is used. As these are very
local tests only used in one function it's not worthwhile to add further
overloads to the findClient method in Workspace.

With this change all the Predicate macro definitions are removed from
utils.h as they are now completely unused.

REVIEW: 116916
11 years ago
Martin Gräßlin b0c0e81661 Adjust kde-workspace to changes in NETWMClient
ctor changed to take NET::Properties and NET::Properties2.
11 years ago
Martin Gräßlin 2372e02752 [kwin] Use a QIcon in Client for the icons instead of Pixmaps
Client used to have dedicated methods for different icon sizes instead
of combining all pixmaps into one QIcon. This resulted in various parts
of KWin having different access to the icons:
* effects only got one pixmap of size 32x32
* decorations only got the 16x16 and 32x32 pixmaps combined into a QIcon
* tabbox could request all icon sizes, but only as pixmap

Now all sizes are available in one QIcon allowing to easily access the
best fitting icon in a given UI.
11 years ago
Martin Gräßlin ba66fd9ef6 [kwin] NETWinInfo2 becomes NETWinInfo
And takes a xcb_connection_t instead of Display. Also our own class
is adjusted to no longer need the connection being passed in.
11 years ago
Martin Gräßlin 57905c0cc2 And we got rid of KDebug
Usages of kBacktrace got dropped.
11 years ago
Martin Gräßlin 9291b18cee Merge branch 'master' into frameworks-scratch
Conflicts:
	CMakeLists.txt
	kwin/effects.cpp
	kwin/effects/logout/logout.cpp
	kwin/effects/presentwindows/main.qml
	kwin/effects/presentwindows/presentwindows.cpp
	kwin/effects/presentwindows/presentwindows.h
	kwin/effects/zoom/zoom_config.cpp
	kwin/libkwineffects/kwinglutils_funcs.cpp
	kwin/libkwineffects/kwinxrenderutils.cpp
	kwin/nvidiahack.cpp
	kwin/xcbutils.h
	plasma/desktop/containments/desktop/plasma-containment-desktop.desktop
	plasma/generic/wallpapers/image/image.cpp
	plasma/generic/wallpapers/image/plasma-wallpaper-image.desktop
11 years ago
Martin Gräßlin 330d40f425 Fix no cast to/from ASCII intrduced issues
* "" needs to be wrapped in QStringLiteral
* QString::fromUtf8 needed for const char* and QByteArray
* QByteArray::constData() needed to get to the const char*
11 years ago
Fredrik Höglund a87e8f5e8e kwin: Drop the xcb_icccm dependency
This dependency is causing build problems on a number of systems,
and it doesn't make much sense to bring in a whole library for three
one-line convenience functions.
11 years ago
Martin Gräßlin 5dae0cb010 Change Client::window_group to xcb_window_t
At the same time adjust name to m_camelCase to follow naming scheme.
11 years ago
Martin Gräßlin 5afe5f810e Port Client::transient_for handling to XCB
The type of the transient_for related variables are changed to
xcb_window_t. They cannot be Xcb::Window as we don't take ownership over
the transient for window.

Variables are renamed to m_camelCase to follow naming scheme.

A wrapper for retrieving the TransientFor hint is added to the Xcb
Wrappers.
11 years ago
Martin Gräßlin 023de5b75e Remove Workspace pointer from Group
REVIEW: 110360
12 years ago
Martin Gräßlin 28d7b3c563 s/Window/xcb_window_t/g in workspace.h 12 years ago
Martin Gräßlin 89c2fd5598 Remove YesIKnowWhatImDoing from internal API
No need to have Allowed everywhere.

REVIEW: 110197
12 years ago
Martin Gräßlin 34d0df3e0a Remove Workspace::updateOnAllActivitiesOfTransients
Method is more or less just a clone of the Virtual Desktop variant and
not needed as toggleClientOnActivity already takes care of transients.
12 years ago
Martin Gräßlin 0976bdfb17 Adding transient (for) properties
TransientFor is a QObject property as we cannot declare Client as
a metatype.
13 years ago
Martin Gräßlin 9930044581 Drop an unimplemented method in Group
We didn't need it for years, so let's remove it and if we
really need it, it's easy to add again.

SVN_SILENT
13 years ago
Arthur Arlt 25654f25b8 Removing TopMenu
Since the funtionality of TopMenu did no longer work in KDE4 this feature was
removed from Workspace. Every reference to it was removed as well as commentaries
and documentation.

REVIEW: 101485
13 years ago
Martin Gräßlin 0a7e48f7aa KWin uses kdelibs coding style. 14 years ago
Thomas Lübking 73ec13310f update utility window visibility on property change and increase hiding delay - should prevent "mystic" disappearance of gimp utilities
svn path=/trunk/KDE/kdebase/workspace/; revision=1210458
14 years ago
Thomas Lübking 746cdddf76 adjust/fix behaviour of Modal Dialogs reg. Minimizing, Virtual Desktop change & Shading
BUG: 193611
BUG: 180195

svn path=/trunk/KDE/kdebase/workspace/; revision=1194907
14 years ago