summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-03-24 15:27:29 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-03-24 15:27:29 +0300
commitd2feb899212b71faa50958c3bdd53ef3214c5b56 (patch)
tree2f61658d1a1e6b53f1f5db6fb87209a43c88efe1
parent9774715b1914ac65ada1211322bfd080af694af9 (diff)
fixes #4290 completely
-rw-r--r--plugins/NewEventNotify/src/main.cpp9
-rw-r--r--src/mir_app/src/srmm_util.cpp2
2 files changed, 2 insertions, 9 deletions
diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp
index f711c2aa5e..dd4205ea2e 100644
--- a/plugins/NewEventNotify/src/main.cpp
+++ b/plugins/NewEventNotify/src/main.cpp
@@ -142,18 +142,11 @@ int CMPlugin::Load()
/////////////////////////////////////////////////////////////////////////////////////////
// Check Window Message function
-// Took this snippet of code from "EventNotify" by micron-x, thx *g*
-// checks if the message-dialog window is already opened
-// return values:
-// 0 - No window found
-// 1 - Split-mode window found
-// 2 - Single-mode window found
-
int CheckMsgWnd(MCONTACT hContact)
{
MessageWindowData mwd;
if (!Srmm_GetWindowData(hContact, mwd))
- if (mwd.hwndWindow != nullptr && (mwd.uState & MSG_WINDOW_STATE_EXISTS))
+ if (mwd.hwndWindow != nullptr && (mwd.uState & MSG_WINDOW_STATE_FOCUS))
return 1;
return 0;
diff --git a/src/mir_app/src/srmm_util.cpp b/src/mir_app/src/srmm_util.cpp
index b9e4d4c4ff..43e90992eb 100644
--- a/src/mir_app/src/srmm_util.cpp
+++ b/src/mir_app/src/srmm_util.cpp
@@ -107,7 +107,7 @@ MIR_APP_DLL(int) Srmm_GetWindowData(MCONTACT hContact, MessageWindowData &mwd)
mwd.uState = MSG_WINDOW_STATE_EXISTS;
if (IsWindowVisible(hwnd))
mwd.uState |= MSG_WINDOW_STATE_VISIBLE;
- if (GetForegroundWindow() == hwnd)
+ if (GetForegroundWindow() == hwnd || GetForegroundWindow() == GetParent(hwnd))
mwd.uState |= MSG_WINDOW_STATE_FOCUS;
if (IsIconic(hwnd))
mwd.uState |= MSG_WINDOW_STATE_ICONIC;