mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
Patch 3/5 os-support: add xf86VTKeepTtyIsSet
Add xf86VTKeepTtyIsSet function to export KeepTty state.
When seatd activates, it takes control of current vt (in global sense)!,
this code only activates sesion control code when XServer started
using same vt (for more context see c88a325899 commit ).
Signed-off-By: Tautvis <gtautvis@gmail.com>
This commit is contained in:
@@ -134,6 +134,13 @@ static xf86ConsOpen_t xf86ConsTab[] = {
|
||||
(xf86ConsOpen_t) NULL
|
||||
};
|
||||
|
||||
|
||||
Bool
|
||||
xf86VTKeepTtyIsSet(void)
|
||||
{
|
||||
return KeepTty;
|
||||
}
|
||||
|
||||
void
|
||||
xf86OpenConsole(void)
|
||||
{
|
||||
|
||||
@@ -57,6 +57,12 @@ xf86UseMsg()
|
||||
return;
|
||||
}
|
||||
|
||||
Bool
|
||||
xf86VTKeepTtyIsSet(void)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
xf86OpenConsole()
|
||||
{
|
||||
|
||||
@@ -27,6 +27,5 @@
|
||||
#define XF86_LINUX_H
|
||||
|
||||
int linux_parse_vt_settings(int may_fail);
|
||||
int linux_get_keeptty(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -167,8 +167,8 @@ linux_parse_vt_settings(int may_fail)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
linux_get_keeptty(void)
|
||||
Bool
|
||||
xf86VTKeepTtyIsSet(void)
|
||||
{
|
||||
return KeepTty;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
|
||||
#include "os.h"
|
||||
#include "linux.h"
|
||||
#include "xf86_os_support.h"
|
||||
#include "xf86_priv.h"
|
||||
#include "xf86platformBus_priv.h"
|
||||
#include "xf86Xinput_priv.h"
|
||||
@@ -659,7 +660,7 @@ static struct dbus_core_hook core_hook = {
|
||||
int
|
||||
systemd_logind_init(void)
|
||||
{
|
||||
if (!ServerIsNotSeat0() && xf86HasTTYs() && linux_parse_vt_settings(TRUE) && !linux_get_keeptty()) {
|
||||
if (!ServerIsNotSeat0() && xf86HasTTYs() && linux_parse_vt_settings(TRUE) && !xf86VTKeepTtyIsSet()) {
|
||||
LogMessage(X_INFO,
|
||||
"systemd-logind: logind integration requires -keeptty and "
|
||||
"-keeptty was not provided, disabling logind integration\n");
|
||||
|
||||
@@ -74,6 +74,14 @@ static char consoleDev[PATH_MAX] = "/dev/fb";
|
||||
Used by hw/xfree86/common/xf86AutoConfig.c for VIS_GETIDENTIFIER */
|
||||
char xf86SolarisFbDev[PATH_MAX] = "/dev/fb";
|
||||
|
||||
|
||||
Bool
|
||||
xf86VTKeepTtyIsSet(void)
|
||||
{
|
||||
return KeepTty;
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAS_USL_VTS
|
||||
static void
|
||||
switch_to(int vt, const char *from)
|
||||
|
||||
@@ -15,6 +15,13 @@ xf86CloseConsole(void)
|
||||
{
|
||||
}
|
||||
|
||||
Bool
|
||||
xf86VTKeepTtyIsSet(void)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
xf86ProcessArgument(int argc, char *argv[], int i)
|
||||
{
|
||||
|
||||
@@ -30,6 +30,12 @@ typedef void (*PMClose) (void);
|
||||
|
||||
void xf86OpenConsole(void);
|
||||
void xf86CloseConsole(void);
|
||||
|
||||
/**
|
||||
* @brief get keeptty switch state
|
||||
**/
|
||||
Bool xf86VTKeepTtyIsSet(void);
|
||||
|
||||
Bool xf86VTActivate(int vtno);
|
||||
Bool xf86VTSwitchPending(void);
|
||||
Bool xf86VTSwitchAway(void);
|
||||
|
||||
Reference in New Issue
Block a user