mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-02 05:12:02 +00:00
[client] main: display spice VM name in process title
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user