Commit Graph

22 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
Bhushan Shah ef510b4e76 remove superfluous code
Summary:
For some reason this lines are duplicated twice, (possibly due to merge
conflict resolution?), clean it up.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18348
2019-01-27 12:05:22 +05:30
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
Fabian Vogt 96af5965ee Fix leaking of FDs requested from logind
Summary:
The takeDevice method calls dup, but that syscall removes the O_CLOEXEC flag
as a side-effect. This resulted in all child processes of kwin_wayland having
an open file descriptor for those devices.

Test Plan:
Looked at the open FDs of the startplasma script. Before, all
/dev/input/eventX files and /dev/dri/card0 were open. Now, none of those
are part of /proc/PID/fd/

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: kwin, plasma-devel, #kwin

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D8887
2017-11-19 14:32:28 +01:00
Martin Gräßlin bc003c0228 Add cmake check whether sys/sysmacros.h exists
Unfortunately 9ada8baca6 failed to compile
on FreeBSD due to the header not existing. So we need to check the
existance and properly guard with ifdef.
2017-07-30 21:30:33 +02:00
Martin Gräßlin 9ada8baca6 Turn around include order for major/minor
Although we made KWin compile with newer include requirement for major
and minor in gnu libc, we still get the warning that it's deprecated.
So let's try to turn the include order around. That should fix the
warning and hopefully still compile on non gnu libc (e.g. FreeBsd). If
it fails, we need to add a cmakedefine for the header.
2017-07-30 21:20:36 +02:00
Andreas Sturmlechner 35c278e525 Fix build with future glibc (major/minor macros), BSD compatible
Summary:
Also adding sys/types.h which is not implicitly included from all over.

Thanks-to: [ade] in #kde-devel

See also:
https://sourceware.org/ml/libc-alpha/2015-11/msg00452.html
https://git.reviewboard.kde.org/r/127662/

BUG: 376505

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

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

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D6175
2017-07-25 22:16:11 +02:00
Martin Flöser 58322c2778 Fix s_ck2ActiveProperty value 2017-07-15 11:01:03 +02: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 a1f21f3cea Drop not needed include to sys/sysmacros.h from logind.cpp
Fixes build on FreeBSD.
2016-06-20 11:21:45 +02:00
Martin Gräßlin 537cc148df Get the logind session to take over through env variable instead of own PID
Summary:
So far KWin resolved the logind session to take over by  using its own
PID with the method GetSessionByPID. This doesn't work if KWin itself
is not part of the session or if KWin is supposed to take over a
different session.

The session to take over is now derived from XDG_SESSION_ID. If it is
not set the variant through getSessionByPID is used.

This allows to e.g. run kwin on vt1, but have the graphical output
on vt2. Thus it's possible to see the debug output. Also it should allow
to run kwin_wayland through an ssh session, so that gdb can be used.

If we take over another session on a different vt, we need to make sure
that it's the current virtual terminal. Otherwise assumptions in the
startup code would break. So let's ensure the session we integrate with
is active.

Reviewers: #plasma

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1445
2016-04-22 14:20:06 +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
Andreas Sturmlechner 03f4f972d6 Fix build with future glibc (major/minor macros)
See also: https://sourceware.org/ml/libc-alpha/2015-11/msg00452.html

REVIEW: 127662
2016-04-20 19:03:34 +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 26c44a6524 Add recursion check to LogindIntegration::takeControl
We never want to call takeControl twice at the same time.
2015-04-01 11:05:45 +02:00
Daniel Pastushchak 0d997b1093 Introduce categorized logging for kwin core
Done by Daniel Pastushchak for KDE during GCI-2014.
2014-12-05 14:27:15 +01: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