Coverity reports this as a null pointer dereference, so check for
'seat' existence before comparing with strcmp
Fixes CID1385369
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Summary: Only seat0 supports virtual terminals.
Test Plan: Make sure enlightenment does not error out on non-seat0 due to a virtual terminal error. Enlightenment will not start yet on seat1 with this alone
Reviewers: ManMower, devilhorns
Reviewed By: devilhorns
Subscribers: ManMower, devilhorns, cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D5710
Our close callback tells logind we're done with a device, but it should
also actually close the fd it's passed, or we end up leaking piles of
fds on VC switch.
see weston commit 8f5acc2f3a29c3831af4ddd6bed57f703c98dc77
and subsequent regression in commit 72dea06d7952e3ce8dd8057f7106186da4fa2678
and pending fix in https://patchwork.freedesktop.org/patch/168992/
When I added the code to probe drm devices to ensure they're
modeset capable (ref 414d406b3b)
I didn't realize elput didn't allow us to open and close more than
one drm device at startup without blowing up libinput.
This is a somewhat dirty hack to rough that in.
The problem is that open/close the device during startup will
result in an async "gone" callback from logind, which then kicks
off an input shutdown. We need to try harder to only do that
shutdown when it makes sense.
Coverity CID1377539 says that we leak the eldbus reply here when we
error out, so be sure to cleanup 'reply'
Fixes CID1377539
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
We're supposed to query the path for a session id instead of just
making up the string ourselves.
Fixes all input devices being dead after a vc switch for some users.
context and keymap need to be set at the same time in order to effectively
update keyboard state, and active group should be accessible through api
as well
preserve old function ABI to ensure old binaries don't crash
Coverity reports that we leak 'msg' here if we fail to append
arguments to the message.
Fixes CID1367499
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Coverity reports that 'reply' is leaked here if we fall into the error
condition.
CID1367507
@fix
Signed-off-by: Chris Michael <cp.michael@samsung.com>
sd_pid_get_session returns ENODATA or ENXIO if it was unable to fetch
the session data for the given pid, reason for that is mostly that the
pid is not running is a session. Adding this as the error value can help
the user debugging the problem without the need of gdb´ing into the
function and checking the return value.
This patch fixes an issue where input would stop working when you
vt-switch away and back again in a running Enlightenment Wayland
session. Basically, when we vt-switch away, we need to tell libinput
to suspend input event processing, and when we return to re-enable it.
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This patch fixes an issue where you could not VT-switch away from a
running Enlightenment session by simplifying the vt switch code and
passing the proper arguments to the dbus message.
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Reverting this as the initialization of char *s was already set to
NULL in a previous patch, so the 'if (s)' check here is pointless
really as 'man 3 free' says passing NULL to free() is ok.
This reverts commit ad2e21b023.
Summary:
Calling free() on an uninitialized pointer leads to crash, that can occurs
when sd_session_get_seat fails.
Fixes T3785.
Reviewers: devilhorns
Subscribers: cedric, jpeg
Maniphest Tasks: T3785
Differential Revision: https://phab.enlightenment.org/D4015
@fix
If systemd fails to give us a valid session id, then any further calls
to get a seat from that session are going to fail. As such, check for
a valid seat return from systemd before calling any systemd functions
which require session id.
Fixes T3785
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
this adds an overly-complex method of removing blocking dbus calls from libinput's
synchronous device initialization architecture. libinput was clearly never meant
to be used in this way, but we're doing it anyway because we're efl.
#SamsungFeatures
This patch adds a new API function to Elput that can be used to switch
to a given VT. This allows drm2 or enlightenment to switch to a given
virtual terminal in response to keybindings.
@feature
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This patch adds support for notifying when a session gets activated or
deactivated. This will be used in drm2 to notify compositor when to
pause/restart rendering during a vt switch
@feature
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
As we do not need minor or fd from the dbus message during input
device resume, we can remove these variables
@fix
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
As this library is just going to deal with libinput, we don't need to
have interface functions to activate or restore a virtual terminal.
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This adds new API functions which can be called to open or close an input
device and take control (or release control) of said device
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This commit adds the start of the Elput Manager & Interface code. This
will be used as an inteface to various backend methods of session &
device control (ie: systemd, direct interface, etc). This will provide
various abstractions for working with libinput when opening/closing
input devices.
Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>