[Libreoffice-commits] core.git: 2 commits - comphelper/source vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 6 10:01:44 UTC 2020


 comphelper/source/misc/threadpool.cxx |    2 +-
 vcl/unx/gtk3/gtk3gtkinst.cxx          |    6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 197c91c45a0ff691af5089b2603737c1320880c1
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Oct 5 20:45:12 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Oct 6 12:01:06 2020 +0200

    avoid calling gtk_widget_add_events when not needed
    
    because it triggers premature creation of a11y objects
    for custom widgets
    
    Change-Id: I17eddd2856767c7da9c3a8c8ad0e11ba1a92e4d4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104007
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index c16099ad7432..8404a7f7dff1 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -13258,13 +13258,15 @@ public:
 
     virtual void connect_mouse_press(const Link<const MouseEvent&, bool>& rLink) override
     {
-        gtk_widget_add_events(m_pWidget, GDK_BUTTON_PRESS_MASK);
+        if (!(gtk_widget_get_events(m_pWidget) & GDK_BUTTON_PRESS_MASK))
+            gtk_widget_add_events(m_pWidget, GDK_BUTTON_PRESS_MASK);
         GtkInstanceWidget::connect_mouse_press(rLink);
     }
 
     virtual void connect_mouse_release(const Link<const MouseEvent&, bool>& rLink) override
     {
-        gtk_widget_add_events(m_pWidget, GDK_BUTTON_RELEASE_MASK);
+        if (!(gtk_widget_get_events(m_pWidget) & GDK_BUTTON_RELEASE_MASK))
+            gtk_widget_add_events(m_pWidget, GDK_BUTTON_RELEASE_MASK);
         GtkInstanceWidget::connect_mouse_release(rLink);
     }
 
commit 3a6a7f71ec1f5423fcd0bcea20f6831eaafb9c86
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Mon Oct 5 21:06:39 2020 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Oct 6 12:00:54 2020 +0200

    fix possible >= 0 warning
    
    Change-Id: I7b5595265d00a33e933a1768d8c80a7ffd25c8a6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103997
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/comphelper/source/misc/threadpool.cxx b/comphelper/source/misc/threadpool.cxx
index 906189202cdd..044362eef055 100644
--- a/comphelper/source/misc/threadpool.cxx
+++ b/comphelper/source/misc/threadpool.cxx
@@ -242,8 +242,8 @@ void ThreadPool::incBusyWorker()
 
 void ThreadPool::decBusyWorker()
 {
+    assert(mnBusyWorkers >= 1);
     --mnBusyWorkers;
-    assert(mnBusyWorkers >= 0);
 }
 
 void ThreadPool::waitUntilDone(const std::shared_ptr<ThreadTaskTag>& rTag, bool bJoinAll)


More information about the Libreoffice-commits mailing list