From a4549ec2b353a0995bcfba17b7d42c047e7c8ee8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 3 Jun 2018 22:35:20 +0300 Subject: fixes #1401 (fixes inactive session detection) --- plugins/Scriver/src/msgdialog.cpp | 2 +- plugins/Scriver/src/msgs.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'plugins/Scriver/src') diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index b008fa924b..383dd6cb8e 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -1412,7 +1412,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) if (m_hDbEventFirst == 0) m_hDbEventFirst = hDbEvent; if (DbEventIsShown(dbei)) { - bool bIsActive = GetActiveWindow() == m_hwndParent && GetForegroundWindow() == m_hwndParent && m_pParent->hwndActive == m_hwnd; + bool bIsActive = IsActive(); if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & (DBEF_SENT))) { /* store the event when the container is hidden so that clist notifications can be removed */ if (!IsWindowVisible(m_hwndParent) && m_hDbUnreadEventFirst == 0) diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index 16c6b6e5d6..2ca2855895 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -90,6 +90,11 @@ public: virtual void LoadSettings() override; virtual void SetStatusText(const wchar_t*, HICON) override; + bool IsActive() const + { + return GetActiveWindow() == m_hwndParent && GetForegroundWindow() == m_hwndParent && m_pParent->hwndActive == m_hwnd; + } + void Reattach(HWND hwndContainer); ParentWindowData *m_pParent; -- cgit v1.2.3