From 67518fb4e691b0a23686004d5087bc65867d32a3 Mon Sep 17 00:00:00 2001 From: zhuzichu Date: Sat, 22 Apr 2023 18:29:43 +0800 Subject: [PATCH] update --- example/src/tool/IPC.cpp | 7 ++----- src/controls/FluFocusRectangle.qml | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/example/src/tool/IPC.cpp b/example/src/tool/IPC.cpp index f8466f4..49d3978 100644 --- a/example/src/tool/IPC.cpp +++ b/example/src/tool/IPC.cpp @@ -6,9 +6,6 @@ #include #include -#ifndef _MSC_VER -#include -#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; } diff --git a/src/controls/FluFocusRectangle.qml b/src/controls/FluFocusRectangle.qml index c59ab9a..7a3507d 100644 --- a/src/controls/FluFocusRectangle.qml +++ b/src/controls/FluFocusRectangle.qml @@ -8,7 +8,6 @@ Item { id:root anchors.fill: parent anchors.margins: -3 - Rectangle{ width: root.width height: root.height