[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jul 10 18:59:06 UTC 2020
vcl/unx/gtk3/gtk3gtkinst.cxx | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
New commits:
commit 76f3995c0ddb06ca5d3e1b147bbd5cc9d74c8654
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Jul 10 14:55:07 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Jul 10 20:58:40 2020 +0200
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 at redhat.com>
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)
More information about the Libreoffice-commits
mailing list