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:
Tautvis
2025-09-27 01:49:49 +03:00
committed by Enrico Weigelt
parent 8d90cd0060
commit 1ac940c01d
8 changed files with 38 additions and 4 deletions

View File

@@ -134,6 +134,13 @@ static xf86ConsOpen_t xf86ConsTab[] = {
(xf86ConsOpen_t) NULL
};
Bool
xf86VTKeepTtyIsSet(void)
{
return KeepTty;
}
void
xf86OpenConsole(void)
{

View File

@@ -57,6 +57,12 @@ xf86UseMsg()
return;
}
Bool
xf86VTKeepTtyIsSet(void)
{
return FALSE;
}
void
xf86OpenConsole()
{

View File

@@ -27,6 +27,5 @@
#define XF86_LINUX_H
int linux_parse_vt_settings(int may_fail);
int linux_get_keeptty(void);
#endif

View File

@@ -167,8 +167,8 @@ linux_parse_vt_settings(int may_fail)
return 1;
}
int
linux_get_keeptty(void)
Bool
xf86VTKeepTtyIsSet(void)
{
return KeepTty;
}

View File

@@ -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");

View File

@@ -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)

View File

@@ -15,6 +15,13 @@ xf86CloseConsole(void)
{
}
Bool
xf86VTKeepTtyIsSet(void)
{
return FALSE;
}
int
xf86ProcessArgument(int argc, char *argv[], int i)
{

View File

@@ -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);