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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 29 10:13:53 UTC 2021


 tools/source/generic/poly.cxx |    5 +++--
 vcl/unx/gtk3/gtkinst.cxx      |    8 +++++---
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 2a1725fbc248ccaccbe754b5f62a02f99e077290
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jun 29 09:06:08 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jun 29 12:13:33 2021 +0200

    ofz#35504 promote to double earlier
    
    Change-Id: I20906d61f411bba5b37f7248ba9b544afa27a0a9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118051
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index 2575d262a68a..70bafc824404 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -56,8 +56,9 @@
 
 static double ImplGetParameter( const Point& rCenter, const Point& rPt, double fWR, double fHR )
 {
-    const tools::Long nDX = rPt.X() - rCenter.X();
-    double fAngle = atan2( -rPt.Y() + rCenter.Y(), ( ( nDX == 0 ) ? 0.000000001 : nDX ) );
+    const double nDX = static_cast<double>(rPt.X()) - rCenter.X();
+    const double nDY = static_cast<double>(rCenter.Y()) - rPt.Y();
+    double fAngle = atan2(nDY, (nDX == 0) ? 0.000000001 : nDX);
 
     return atan2(fWR*sin(fAngle), fHR*cos(fAngle));
 }
commit e82527d1fcee6bfb47b4e2a7bc51a7d097f662b0
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jun 28 15:15:05 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jun 29 12:13:18 2021 +0200

    gdk_events_pending->gdk_display_has_pending
    
    the latter at least still exists, if mostly private, in GTK4
    
    Change-Id: I0c008b505823d3f2b1ea332a9602399b77fd29c9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118050
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 9e00cd6d62b3..9af25f36e56b 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -433,8 +433,10 @@ bool GtkInstance::AnyInput( VclInputFlags nType )
     EnsureInit();
     if( (nType & VclInputFlags::TIMER) && IsTimerExpired() )
         return true;
+
 #if !GTK_CHECK_VERSION(4, 0, 0)
-    if (!gdk_events_pending())
+    GdkDisplay* pDisplay = gdk_display_get_default();
+    if (!gdk_display_has_pending(pDisplay))
         return false;
 #endif
 
@@ -445,7 +447,7 @@ bool GtkInstance::AnyInput( VclInputFlags nType )
 #if !GTK_CHECK_VERSION(4, 0, 0)
     std::deque<GdkEvent*> aEvents;
     GdkEvent *pEvent = nullptr;
-    while ((pEvent = gdk_event_get()))
+    while ((pEvent = gdk_display_get_event(pDisplay)))
     {
         aEvents.push_back(pEvent);
         VclInputFlags nEventType = categorizeEvent(pEvent);
@@ -458,7 +460,7 @@ bool GtkInstance::AnyInput( VclInputFlags nType )
     while (!aEvents.empty())
     {
         pEvent = aEvents.front();
-        gdk_event_put(pEvent);
+        gdk_display_put_event(pDisplay, pEvent);
         gdk_event_free(pEvent);
         aEvents.pop_front();
     }


More information about the Libreoffice-commits mailing list