diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-07-10 14:55:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-07-10 20:58:40 +0200 |
commit | 76f3995c0ddb06ca5d3e1b147bbd5cc9d74c8654 (patch) | |
tree | c3266a38437c5d4de862bb9c86cc87c8a0bcfa77 | |
parent | e7026e72a2b24d9ccdc3d4693b2b1656e22526cb (diff) |
disable animations during widget render to surface
Change-Id: I6b3073092e8eaf83bff89b35c50b3476039af410
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98531
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 6a8adcbc9ad5..d1503f4cae44 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3056,12 +3056,19 @@ public: assert(gtk_widget_is_drawable(m_pWidget)); // all that should result in this holding + // turn off animations, otherwise we get a frame of an animation sequence + gboolean bAnimations; + GtkSettings* pSettings = gtk_widget_get_settings(m_pWidget); + g_object_get(pSettings, "gtk-enable-animations", &bAnimations, nullptr); + if (bAnimations) + g_object_set(pSettings, "gtk-enable-animations", false, nullptr); + Size aSize(rRect.GetSize()); GtkAllocation aOrigAllocation; gtk_widget_get_allocation(m_pWidget, &aOrigAllocation); - GtkAllocation aNewAllocation {aOrigAllocation.x, + GtkAllocation aNewAllocation {aOrigAllocation.x + 100, aOrigAllocation.y, static_cast<int>(aSize.Width()), static_cast<int>(aSize.Height()) }; @@ -3084,6 +3091,9 @@ public: rOutput.DrawOutDev(rRect.TopLeft(), aSize, Point(), aSize, *xOutput); + if (bAnimations) + g_object_set(pSettings, "gtk-enable-animations", true, nullptr); + if (!bAlreadyMapped) gtk_widget_unmap(m_pWidget); if (!bAlreadyVisible) |