Resolves: tdf#143398 mouse event processed twice
this is a problem since:
commit 67b157e994d9bef01f6117b53fc29e1fee538715
Author: Caolán McNamara <caolanm@redhat.com>
Date: Tue Jun 29 13:00:45 2021 +0100
tdf#143088 multiple Application::EventListeners is expensive
turns out that AddChildEventListener is sufficient to get events
for the widget and its children so the widget-only AddEventListener
isn't needed or wanted
Change-Id: I635419df10fce1d4441b2d85627a6cbe99adb6aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118930
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 1bab62f..9b4baab 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -219,7 +219,6 @@ void SalInstanceWidget::ensure_mouse_listener()
{
if (!m_bMouseEventListener)
{
m_xWidget->AddEventListener(LINK(this, SalInstanceWidget, MouseEventListener));
m_xWidget->AddChildEventListener(LINK(this, SalInstanceWidget, MouseEventListener));
m_bMouseEventListener = true;
}
@@ -518,10 +517,7 @@ SalInstanceWidget::~SalInstanceWidget()
if (m_aMnemonicActivateHdl.IsSet())
m_xWidget->SetMnemonicActivateHdl(Link<vcl::Window&, bool>());
if (m_bMouseEventListener)
{
m_xWidget->RemoveChildEventListener(LINK(this, SalInstanceWidget, MouseEventListener));
m_xWidget->RemoveEventListener(LINK(this, SalInstanceWidget, MouseEventListener));
}
if (m_bKeyEventListener)
Application::RemoveKeyListener(LINK(this, SalInstanceWidget, KeyEventListener));
if (m_bEventListener)