Add optional fd parameter to mod_connect() method

The fd parameter can be used to immediately connect to a display
server, if an fd was obtained from sesman
This commit is contained in:
matt335672
2025-06-20 12:10:13 +01:00
parent 09e4a99bac
commit 3425ab6166
9 changed files with 45 additions and 14 deletions
+13 -3
View File
@@ -182,15 +182,25 @@ set_keyboard_overrides(struct mod *mod)
}
static int
lxrdp_connect(struct mod *mod)
lxrdp_connect(struct mod *mod, int fd)
{
boolean ok;
set_keyboard_overrides(mod);
LOG_DEVEL(LOG_LEVEL_TRACE, "lxrdp_connect:");
ok = freerdp_connect(mod->inst);
LOG_DEVEL(LOG_LEVEL_INFO, "lxrdp_connect: freerdp_connect returned %d", ok);
if (fd >= 0)
{
LOG(LOG_LEVEL_ERROR,
"NeutrinoRDP : Can't connect to a file descriptor");
ok = 0;
}
else
{
ok = freerdp_connect(mod->inst);
LOG_DEVEL(LOG_LEVEL_INFO,
"lxrdp_connect: freerdp_connect returned %d", ok);
}
if (!ok)
{
+1 -1
View File
@@ -74,7 +74,7 @@ struct mod
int version; /* internal version */
/* client functions */
int (*mod_start)(struct mod *v, int w, int h, int bpp);
int (*mod_connect)(struct mod *v);
int (*mod_connect)(struct mod *v, int fd);
int (*mod_event)(struct mod *v, int msg, long param1, long param2,
long param3, long param4);
int (*mod_signal)(struct mod *v);