This commit is contained in:
zhuzichu 2023-04-22 18:29:43 +08:00
parent 2bd03ad9d8
commit 67518fb4e6
2 changed files with 2 additions and 6 deletions

View File

@ -6,9 +6,6 @@
#include <ctime>
#include <random>
#ifndef _MSC_VER
#include <unistd.h>
#endif
IPC::IPC(uint32_t profileId)
: profileId{profileId}
@ -88,7 +85,7 @@ time_t IPC::postEvent(const QString& name, const QByteArray& data, uint32_t dest
memcpy(evt->data, data.constData(), data.length());
mem->lastEvent = evt->posted = result = qMax(mem->lastEvent + 1, time(nullptr));
evt->dest = dest;
evt->sender = getpid();
evt->sender = qApp->applicationPid();
qDebug() << "postEvent " << name << "to" << dest;
}
globalMemory.unlock();
@ -170,7 +167,7 @@ IPC::IPCEvent* IPC::fetchEvent()
memset(evt, 0, sizeof(IPCEvent));
}
if (evt->posted && !evt->processed && evt->sender != getpid()
if (evt->posted && !evt->processed && evt->sender != qApp->applicationPid()
&& (evt->dest == profileId || (evt->dest == 0 && isCurrentOwnerNoLock()))) {
return evt;
}

View File

@ -8,7 +8,6 @@ Item {
id:root
anchors.fill: parent
anchors.margins: -3
Rectangle{
width: root.width
height: root.height