1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-10 21:33:38 +00:00

1. Added ability to get/set remote mouse render

2. Fixed remoteMouseRender flag for Windows
This commit is contained in:
Bryan Roe
2020-04-07 10:32:03 -07:00
parent b8208f63ed
commit 0ce6fa835f
3 changed files with 41 additions and 2 deletions

View File

@@ -1189,9 +1189,21 @@ void kvm_relay_StdErrHandler(ILibProcessPipe_Process sender, char *buffer, int b
int kvm_relay_restart(int paused, void *pipeMgr, char *exePath, ILibKVM_WriteHandler writeHandler, void *reserved)
{
char * parms0[] = { " -kvm0", g_ILibCrashDump_path != NULL ? "-coredump" : NULL, NULL };
char * parms1[] = { " -kvm1", g_ILibCrashDump_path != NULL ? "-coredump" : NULL, NULL };
char * parms0[] = { " -kvm0", g_ILibCrashDump_path != NULL ? "-coredump" : NULL, NULL, NULL };
char * parms1[] = { " -kvm1", g_ILibCrashDump_path != NULL ? "-coredump" : NULL, NULL, NULL };
void **user = (void**)ILibMemory_Allocate(4 * sizeof(void*), 0, NULL, NULL);
if (parms0[1] == NULL)
{
parms0[1] = (gRemoteMouseRenderDefault != 0 ? "-remotecursor" : NULL);
parms1[1] = (gRemoteMouseRenderDefault != 0 ? "-remotecursor" : NULL);
}
else
{
parms0[2] = (gRemoteMouseRenderDefault != 0 ? "-remotecursor" : NULL);
parms1[2] = (gRemoteMouseRenderDefault != 0 ? "-remotecursor" : NULL);
}
user[0] = writeHandler;
user[1] = reserved;
user[2] = pipeMgr;

View File

@@ -1804,6 +1804,18 @@ duk_ret_t ILibDuktape_MeshAgent_getStartupOptions(duk_context *ctx)
return(1);
}
duk_ret_t ILibDuktape_MeshAgent_remoteMouseRender_get(duk_context *ctx)
{
duk_push_int(ctx, gRemoteMouseRenderDefault);
return(1);
}
duk_ret_t ILibDuktape_MeshAgent_remoteMouseRender_set(duk_context *ctx)
{
gRemoteMouseRenderDefault = duk_require_int(ctx, 0);
return(0);
}
void ILibDuktape_MeshAgent_PUSH(duk_context *ctx, void *chain)
{
MeshAgentHostContainer *agent;
@@ -1879,6 +1891,9 @@ void ILibDuktape_MeshAgent_PUSH(duk_context *ctx, void *chain)
#ifdef _LINKVM
ILibDuktape_CreateReadonlyProperty_int(ctx, "hasKVM", 1);
ILibDuktape_EventEmitter_CreateEventEx(emitter, "kvmConnected");
ILibDuktape_CreateEventWithGetterAndSetterEx(ctx, "remoteMouseRender", ILibDuktape_MeshAgent_remoteMouseRender_get, ILibDuktape_MeshAgent_remoteMouseRender_set);
#if defined(_POSIX) && !defined(__APPLE__)
ILibDuktape_CreateInstanceMethod(ctx, "enableKvmSlaveLog", ILibDuktape_MeshAgent_enableKvmSlaveLog, 1);
#endif

View File

@@ -63,6 +63,8 @@ INT_PTR CALLBACK DialogHandler(HWND, UINT, WPARAM, LPARAM);
MeshAgentHostContainer *agent = NULL;
DWORD g_serviceArgc;
char **g_serviceArgv;
extern int gRemoteMouseRenderDefault;
/*
extern int g_TrustedHashSet;
@@ -1109,6 +1111,11 @@ int wmain(int argc, char* wargv[])
parm[0] = kvm_serviceWriteSink;
((int*)&(parm[2]))[0] = 0;
((int*)&(parm[3]))[0] = (argc > 2 && strcasecmp(argv[2], "-coredump") == 0) ? 1 : 0;
if ((argc > 2 && strcasecmp(argv[2], "-remotecursor") == 0) ||
(argc > 3 && strcasecmp(argv[3], "-remotecursor") == 0))
{
gRemoteMouseRenderDefault = 1;
}
HMODULE shCORE = LoadLibraryExA((LPCSTR)"Shcore.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
DpiAwarenessFunc dpiAwareness = NULL;
@@ -1141,6 +1148,11 @@ int wmain(int argc, char* wargv[])
parm[0] = kvm_serviceWriteSink;
((int*)&(parm[2]))[0] = 1;
((int*)&(parm[3]))[0] = (argc > 2 && strcasecmp(argv[2], "-coredump") == 0) ? 1 : 0;
if ((argc > 2 && strcasecmp(argv[2], "-remotecursor") == 0) ||
(argc > 3 && strcasecmp(argv[3], "-remotecursor") == 0))
{
gRemoteMouseRenderDefault = 1;
}
HMODULE shCORE = LoadLibraryExA((LPCSTR)"Shcore.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
DpiAwarenessFunc dpiAwareness = NULL;