summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-06-29 12:13:19 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-07-01 11:09:09 +0200
commite754591fc13cf29c21fbbe4fb05146dbf4b60679 (patch)
tree4b7da048abc3a557568b972e3df7409ac77b10c3
parenttdf#142061 Consider window scaling for XOR drawing on macOS (diff)
downloadcore-e754591fc13cf29c21fbbe4fb05146dbf4b60679.tar.gz
core-e754591fc13cf29c21fbbe4fb05146dbf4b60679.zip
Related: tdf#143088 listen to DefaultWindow for Settings changed
having multiple Application::EventListener are expensive while a Window::EventListener is cheap and in this document there are thousands of comments so having thousands of EventListeners is problematic. Change-Id: I64fd12e4bcb8e4fd131effe94e6882e54cfcaf19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118084 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 2d4dc36ce5fe..6b2e557c35bf 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -13642,7 +13642,7 @@ private:
GtkInstanceDrawingArea* pThis = static_cast<GtkInstanceDrawingArea*>(widget);
return pThis->signal_scroll(pEvent);
}
- DECL_LINK(SettingsChangedHdl, VclSimpleEvent&, void);
+ DECL_LINK(SettingsChangedHdl, VclWindowEvent&, void);
public:
GtkInstanceDrawingArea(GtkDrawingArea* pDrawingArea, GtkInstanceBuilder* pBuilder, const a11yref& rA11y, bool bTakeOwnership)
: GtkInstanceWidget(GTK_WIDGET(pDrawingArea), pBuilder, bTakeOwnership)
@@ -13660,7 +13660,7 @@ public:
g_object_set_data(G_OBJECT(m_pDrawingArea), "g-lo-GtkInstanceDrawingArea", this);
m_xDevice->EnableRTL(get_direction());
- Application::AddEventListener(LINK(this, GtkInstanceDrawingArea, SettingsChangedHdl));
+ ImplGetDefaultWindow()->AddEventListener(LINK(this, GtkInstanceDrawingArea, SettingsChangedHdl));
}
AtkObject* GetAtkObject(AtkObject* pDefaultAccessible)
@@ -13798,7 +13798,7 @@ public:
virtual ~GtkInstanceDrawingArea() override
{
- Application::RemoveEventListener(LINK(this, GtkInstanceDrawingArea, SettingsChangedHdl));
+ ImplGetDefaultWindow()->RemoveEventListener(LINK(this, GtkInstanceDrawingArea, SettingsChangedHdl));
g_object_steal_data(G_OBJECT(m_pDrawingArea), "g-lo-GtkInstanceDrawingArea");
if (m_pAccessible)
@@ -13830,12 +13830,12 @@ public:
}
};
-IMPL_LINK(GtkInstanceDrawingArea, SettingsChangedHdl, VclSimpleEvent&, rEvent, void)
+IMPL_LINK(GtkInstanceDrawingArea, SettingsChangedHdl, VclWindowEvent&, rEvent, void)
{
- if (rEvent.GetId() != VclEventId::ApplicationDataChanged)
+ if (rEvent.GetId() != VclEventId::WindowDataChanged)
return;
- DataChangedEvent* pData = static_cast<DataChangedEvent*>(static_cast<VclWindowEvent&>(rEvent).GetData());
+ DataChangedEvent* pData = static_cast<DataChangedEvent*>(rEvent.GetData());
if (pData->GetType() == DataChangedEventType::SETTINGS)
signal_style_updated();
}