[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 1 09:09:45 UTC 2021


 vcl/unx/gtk3/gtk3gtkinst.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit e754591fc13cf29c21fbbe4fb05146dbf4b60679
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jun 29 12:13:19 2021 +0100
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Thu Jul 1 11:09:09 2021 +0200

    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 at allotropia.de>
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>

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();
 }


More information about the Libreoffice-commits mailing list