diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-06-29 12:13:19 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-06-29 15:28:52 +0200 |
commit | 1d032975519e1008ea3ab1687b431e255c71d948 (patch) | |
tree | 7c83490e385008a4a93c9f672b2fe5edffd14622 /vcl | |
parent | bce80115787661c2a701118282f4255003a82c3c (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/+/118093
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 3c4e3136a0f9..9c3b67f79bdb 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -16475,7 +16475,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) @@ -16501,7 +16501,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) @@ -16680,7 +16680,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) @@ -16722,12 +16722,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(); } |