summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-06-29 12:13:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-06-29 15:28:30 +0200
commitd0bdc56da1833bc07992ddc87eb1fcffb926cee9 (patch)
treec3193a2656a23e79969a48b1de50d706257f45ba /vcl
parentde15196a5ccc49b4daa90e3bd25b3cac441f5d2a (diff)
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. under gtk with start center open use gnome-tweaks to toggle in/out of a dark theme and the branding logo should continue to switch dark/light variants Change-Id: I64fd12e4bcb8e4fd131effe94e6882e54cfcaf19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118083 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk3/gtkinst.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 9af25f36e56b..1be34140abeb 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -16411,7 +16411,7 @@ private:
}
#endif
- 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)
@@ -16437,7 +16437,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));
}
#if !GTK_CHECK_VERSION(4, 0, 0)
@@ -16616,7 +16616,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 !GTK_CHECK_VERSION(4, 0, 0)
@@ -16658,12 +16658,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();
}