Commit Graph

14 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 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 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
Nerdopolis Turfwalker f6e93aedb2 logind: Add a function that detects the logind seat.
Summary:
This will allow other parts of kwin to get the current logind seat that this instance is running under

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, anthonyfieroni, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D9551
2018-01-05 22:46:39 +01:00
Roman Gilg a49ba5054f [logind] Correct property name to fix logind session
Summary:
In 6ebc3d65f0 a small naming mistake led to Wayland session with
logind not working anymore. Patch to make it work again.

Also rename the variables because what they describe is a state
and not an action.

Reviewers: #kwin

Subscribers: #kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6659
2017-07-14 13:36:48 +02:00
Martin Flöser 6ebc3d65f0 Add ConsoleKit2 support for launching Wayland sessions
Summary: ConsoleKit2 as of version 1.1.1 implements the Session Controller dbus calls required by Kwin to run under Wayland. This patch first looks for the login1 service before attempting the ConsoleKit service.

Test Plan:
On a system running ConsoleKit2, logging into a text console and running:

export $(dbus-launch); export QT_QPA_PLATFORM=wayland; startplasmacompositor

Most of this patch is just shuffling code around to support both logind and CK2.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: graesslin, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6291
2017-07-09 17:24:58 +02:00
Martin Gräßlin a21ad8d4fa Switch virtual teminal through logind seat
When we get the key code for virtual terminal switching we pass it
to Logind instead of going through the "legacy" ioctl interface.
2016-04-22 14:18:56 +02:00
Martin Gräßlin e435b73fed Get the Logind seat for our logind session
In order to switch virtual terminals through logind we need to know
the Seat object for our session.
2016-04-22 14:18:56 +02:00
Martin Gräßlin 2220ae44c4 Create a plugin for each of the wayland backends
Each of the backends becomes a plugin. This allows kwin_wayland to load
the requested plugin and kwin itself doesn't need to link all the
libraries needed. E.g. libdrm is no longer linked if running kwin_x11.
Also this allows to create backends for the non-standard EGL platforms
(examples could be raspberrypi or Android devices).
2015-05-06 10:31:39 +02:00
Martin Gräßlin 3a9adcac91 Connect to Logind's PauseDevice signal
If it emits a "pause" signal, we must acknowledge that we paused the
device.
2015-04-24 12:03:20 +02:00
Martin Gräßlin 3d5899cbfd [logind] Add support for VTNr property 2015-04-01 11:05:45 +02:00
Martin Gräßlin 6a032e78b7 Suspend/Resume libinput when logind session Active changes
LogindIntegration starts monitoring the Active property on the session
and emits a signal when the state changes. The LibInput::Connection
connects to this signal during the setup and uses it to suspend/resume
the libinput context.
2014-10-20 14:51:24 +02:00
Martin Gräßlin a918591fef Use Logind to open/close devices needed by libinput
With libinput we have the problem that we need to have privileges to
open the device files. In order to not need wrappers or suid bits, we
use logind. This means that kwin_wayland has to be the session controler.

A LogindIntegration is added to connect to logind and wrap the dbus
calls. This is based on the logind integration done for ksld in
ksmserver. The LogindIntegration is started by Workspace and the
InputRedirection tries to become the session controller and starts the
libinput integration only after this succeeded.
2014-10-20 14:51:24 +02:00