[client] main: display spice VM name in process title

This commit is contained in:
Quantum
2026-07-29 00:37:26 -04:00
committed by Geoffrey McRae
parent 0f0f96394a
commit 1af909adae
3 changed files with 23 additions and 1 deletions

View File

@@ -24,11 +24,12 @@
#include "util.h" #include "util.h"
#include "kb.h" #include "kb.h"
#include "message.h" #include "message.h"
#include "message.h"
#include "common/time.h" #include "common/time.h"
#include "common/debug.h" #include "common/debug.h"
#include "common/array.h" #include "common/array.h"
#include "common/proctitle.h"
#include "common/version.h"
#include <math.h> #include <math.h>
@@ -757,3 +758,17 @@ void core_updateOverlayState(void)
} }
} }
} }
void core_setTitle(const char * title)
{
if (!lgCanSetProcessTitle())
return;
char * string;
if (asprintf(&string, "Looking Glass Client %s%s%s", BUILD_VERSION,
title && *title ? ": " : "", title ? title : "") >= 0)
{
lgSetProcessTitle(string);
free(string);
}
}

View File

@@ -42,5 +42,6 @@ void core_handleMouseGrabbed(double ex, double ey);
void core_handleMouseNormal(double ex, double ey); void core_handleMouseNormal(double ex, double ey);
void core_resetOverlayInputState(void); void core_resetOverlayInputState(void);
void core_updateOverlayState(void); void core_updateOverlayState(void);
void core_setTitle(const char * title);
#endif #endif

View File

@@ -49,6 +49,7 @@
#include "common/paths.h" #include "common/paths.h"
#include "common/cpuinfo.h" #include "common/cpuinfo.h"
#include "common/ll.h" #include "common/ll.h"
#include "common/proctitle.h"
#include "message.h" #include "message.h"
#include "core.h" #include "core.h"
@@ -739,6 +740,8 @@ void spiceReady(void)
PSServerInfo info; PSServerInfo info;
if (purespice_getServerInfo(&info)) if (purespice_getServerInfo(&info))
{ {
core_setTitle(info.name);
bool uuidValid = false; bool uuidValid = false;
for(int i = 0; i < sizeof(info.uuid); ++i) for(int i = 0; i < sizeof(info.uuid); ++i)
if (info.uuid[i]) if (info.uuid[i])
@@ -1631,6 +1634,9 @@ int main(int argc, char * argv[])
return -1; return -1;
} }
lgInitProcessTitle(argc, &argv);
core_setTitle(NULL);
DEBUG_INFO("Looking Glass (%s)", BUILD_VERSION); DEBUG_INFO("Looking Glass (%s)", BUILD_VERSION);
DEBUG_INFO("Locking Method: " LG_LOCK_MODE); DEBUG_INFO("Locking Method: " LG_LOCK_MODE);
cpuInfo_log(); cpuInfo_log();