summaryrefslogtreecommitdiff
path: root/src/launcher-util.c
Commit message (Collapse)AuthorAgeFilesLines
* compositor-{drm, fbdev, rpi}: Make VT switching configurableBob Ham2016-01-121-0/+26
| | | | | | | | | | | | Add a new boolean weston.ini option, "vt-switching" to enable or disable Ctrl-Alt-Fn key combinations. Signed-off-by: Bob Ham <bob.ham@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> (Derek Foreman changed the prototype for switch_vt_binding to have a weston_keyboard * instead of weston_seat *. The pointer wasn't used, so this is just a warning fix.)
* launcher: Split out launcher implementations into three distinct onesJasper St. Pierre2015-09-231-407/+33
| | | | | | | | | | | | | We now have a launcher interface and distinct implementations for logind, weston-launch, and direct DRM, each in their own files. This helps up clean up the spaghetti code into something that's hopefully a bit more understood. There should be no functional changes here. Reviewed-by: Derek Foreman <derekf@osg.samsung.com> update: Dropped redundant free() in weston_launcher_destroy()
* launcher: Rename logind-util to launcher-logindJasper St. Pierre2015-09-231-1/+1
| | | | | | We're refactoring this to have multiple launcher "implementations". Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
* src: Update boilerplate from MIT X11 license to MIT Expat licenseBryce Harrington2015-06-151-16/+19
|
* launcher-util: Force all weston_launcher_open()s to use O_CLOEXECDerek Foreman2015-05-151-1/+7
| | | | | | | | | | | | | Really, there's pretty much no time we'd ever want O_CLOEXEC unset, as it will likely result in leaking fds to processes that aren't interested in them or shouldn't have them. This also removes the (now unused) code from weston_logind_open() that could drop O_CLOEXEC. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* logind: actually close fd in weston_launcher_close()Derek Foreman2015-05-151-1/+1
| | | | | | | | | | You had one job... Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Acked-by: David Herrmann <dh.herrmann@gmail.com> [implicit from v1 comment] Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* logind: forward Active=true changes for non-DRM backendsDavid Herrmann2015-01-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Logind sends us a notification whenever the Active attribute of our session changes. However, due to the way compositor-drm.c relies on the master DRM device to be synced with the session, we used to delay Active=true handling until the DRM device was up, too. See: commit aedc7732ebd9bc7b4f51ee247ea857ffec6260a7 Author: David Herrmann <dh.herrmann@gmail.com> Date: Sat Nov 30 11:25:45 2013 +0100 logind: delay wakeup until DRM-device is resumed However, the other compositor backends do not use DRM, so logind-util will never get notified about any DRM device. Therefore, we have to forward the Active=true change immediately. This commit fixes logind-util to take sync_drm as argument. If it is true, we do DRM-device synchronisation, otherwise we don't. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=86889 Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Tested-by: nerdopolis <bluescreen_avenger@verizon.net>
* launcher: use SIGRTMIN to not conflict with xwaylandDavid Herrmann2015-01-161-3/+15
| | | | | | | | | | | | | xwayland uses SIGUSR1 as startup notification. Make sure to use SIGRTMIN for VT handling to avoid conflicts. A bonus is SIGRT* signals can be queued multiple times, so we will be able to correctly track them and will no longer lose signals (which wouldn't really matter, but is confusing in logs). Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Tested-by: nerdopolis <bluescreen_avenger@verizon.net>
* launcher-util: Initialize kb_mode also when weston-launch sets up ttyKristian Høgsberg2014-04-301-0/+5
| | | | | | | | | We need a valid kb_mode to restore to in case weston-launch dies and weston has to clean up the tty. We don't get a chance to read out the kb mode before weston-launch changes it, but it's safe to assume that it's always K_UNICODE. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77455
* configure.ac: Make libdrm optional in weston-launchKristian Høgsberg2013-11-241-34/+42
| | | | | | If libdrm is available, weston-launch and launcer-util.c will support getting the drm device and setting and dropping drm master, otherwise we'll only support getting input devices.
* launcher: Make sure we drop drm master before we allow VT switchesKristian Høgsberg2013-10-301-0/+5
| | | | | | | | | | | On shutdown, we can risk having a pending vt switch that we normally handle in the vt signal handler. However as we put the vt back in VT_AUTO mode, the pending VT switch will go through and if we haven't dropped drm master at that point, we could switch to another display server without dropping drm master. That will typically crash the other server, so let's try to make sure we don't do that. https://bugs.freedesktop.org/show_bug.cgi?id=70877
* logind: Remove missing 'else'Kristian Høgsberg2013-10-221-2/+2
| | | | | Only fall through to cleaning up weston-launch or standalone state if we didn't use logind.
* launcher: add logind backendDavid Herrmann2013-10-211-9/+37
| | | | | | Instead of connecting to weston-launch from launcher-util, we now try to connect to logind first. If logind provides session-devices, we use them. If not, we fall back to the old weston-launch facility.
* launcher: add weston_launcher_close() dummyDavid Herrmann2013-10-211-0/+6
| | | | | | If you request a device via weston_launcher_open(), you should now release it via weston_launcher_close() instead of close(). This is currently not needed but will be required for logind devices.
* launcher: Drop unecessary checks for drm_fd == -1Kristian Høgsberg2013-10-141-10/+5
| | | | | We never get into this case, and if we do, we just want to pass the invalid fd through to the underlying ioctl and get the error that way."
* launcher: Fix reverted sense of drm_check_master() wrapperKristian Høgsberg2013-10-141-5/+5
| | | | | | Also rename to drm_is_master() to make it clearer what we're checking. https://bugs.freedesktop.org/show_bug.cgi?id=70459
* launcher: Wrap drmGetMagic and drmAuthMagic so we can build without libdrmTomeu Vizoso2013-10-101-3/+11
|
* launcher: Remove left-over debug loggingKristian Høgsberg2013-10-101-5/+2
|
* launcher: Don't leak tty file descriptor on errorKristian Høgsberg2013-10-101-7/+11
|
* launcher: Don't leak tty file descriptor on launcher destroyKristian Høgsberg2013-10-101-1/+6
|
* launcher: Add back support for specifying VT to run onKristian Høgsberg2013-10-021-7/+35
| | | | | | | | | This is only available when running weston directly as root typically for ssh logins. It's a somewhat destructive option, as it will take over any existing VT completely, unless there's already an display server running there. https://bugs.freedesktop.org/show_bug.cgi?id=69731
* launcher: Bail out if we can't be drm masterKristian Høgsberg2013-10-021-2/+4
| | | | | If we can't be drm master, we won't be able to do anything useful with the drm device.
* launcher: Set make sure we're drm master when opening the drm deviceKristian Høgsberg2013-10-011-22/+27
| | | | | In case we try to run on a tty where some other process is already drm master, back off and exit with an error message.
* launcher: Fail weston_launcher_create() if tty setup failsKristian Høgsberg2013-10-011-1/+6
|
* launcher-util: pull in drm only for compositor-drmAdrian Negreanu2013-09-301-4/+24
| | | | | | | | Add drm_set_master and drm_drop_master as wrappers for drm(Set|Drop)Master, when building compositor-drm or as empty functions otherwise. Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
* launcher: Move rest of tty object into struct weston_launcherKristian Høgsberg2013-09-181-17/+155
| | | | | | The struct weston_launcher object will now either handle tty and vt switching details in-process (when running weston directly as root) or talk to the weston-launch process.
* launcher: Handle drm set/drop master and vt switch signals in launcherKristian Høgsberg2013-09-181-45/+36
|
* launcher: Collect launcher state in new struct weston_launcherKristian Høgsberg2013-09-181-9/+41
| | | | | We're going to add a bit more launcher state, so start out by creating a new struct weston_launcher we can track it in.
* configure.ac: Enable AC_USE_SYSTEM_EXTENSIONSDaniel Stone2013-06-051-0/+2
| | | | | | | | | | | | | | | | | | AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar macros to expose the largest extent of functionality supported by the underlying system. This is required since these macros are often limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually on some systems hide declarations which are not part of the X/Open spec. Since this goes into config.h rather than the command line, ensure all source is consistently including config.h before anything else, including system libraries. This doesn't need to be guarded by a HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org modular transition. Signed-off-by: Daniel Stone <daniel@fooishbar.org> [pq: rebased and converted more files]
* weston-launcher: Add missing newline in error messageMartin Andersson2013-02-141-1/+1
|
* weston-launcher: use CLOEXEC on fallback pathPekka Paalanen2012-07-311-1/+1
| | | | | | | | | | | If there is no weston-launcher available, launcher-util.c will fall back to opening the given file itself. It that case it does not set the close-on-exec flag, and will presumably leak the file descriptor to children. Use O_CLOEXEC on the fallback path, too. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
* weston-launcher: Fix uninitialized variable warningKristian Høgsberg2012-04-101-5/+4
|
* weston-launcher: Fix aliasing warningsKristian Høgsberg2012-04-101-6/+11
|
* Introduce weston-launchBenjamin Franzke2012-04-061-0/+156
weston-launch starts weston and provides mechanism for weston to set/drop drm master, open a tty, and read input devices without being root. Execution is allowed for local-active sessions or users in the group weston-launch.