[arch-commits] Commit in libreoffice-fresh/trunk (3 files)

Andreas Radke andyrtr at archlinux.org
Thu Oct 13 19:27:31 UTC 2016


    Date: Thursday, October 13, 2016 @ 19:27:30
  Author: andyrtr
Revision: 278798

upgpkg: libreoffice-fresh 5.2.2-2

apply upstream fixes to work better with recent gtk3 releases

Added:
  libreoffice-fresh/trunk/gtk3-lot-of-style-updated-signals.diff
  libreoffice-fresh/trunk/gtk3-use-style-updated-signal.diff
Modified:
  libreoffice-fresh/trunk/PKGBUILD

----------------------------------------+
 PKGBUILD                               |   15 ++-
 gtk3-lot-of-style-updated-signals.diff |  134 +++++++++++++++++++++++++++++++
 gtk3-use-style-updated-signal.diff     |   94 +++++++++++++++++++++
 3 files changed, 240 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-10-13 16:37:19 UTC (rev 278797)
+++ PKGBUILD	2016-10-13 19:27:30 UTC (rev 278798)
@@ -13,7 +13,7 @@
 pkgname=('libreoffice-fresh-sdk' 'libreoffice-fresh')
 _LOver=5.2.2.2
 pkgver=5.2.2
-pkgrel=1
+pkgrel=2
 arch=('i686' 'x86_64')
 license=('LGPL3')
 url="http://www.libreoffice.org/"
@@ -64,7 +64,9 @@
 	make-pyuno-work-with-system-wide-module-install.diff
 	libreoffice-fresh.sh libreoffice-fresh.csh
 	update_liborcus_to_0.11.0.diff
-	remove_unnecessary_orcus_external_usage_from_makefiles.diff)
+	remove_unnecessary_orcus_external_usage_from_makefiles.diff
+	gtk3-use-style-updated-signal.diff
+	gtk3-lot-of-style-updated-signals.diff)
 noextract=(boost_1_60_0.tar.bz2
 	ce12af00283eb90d9281956524250d6e-xmlsec1-1.2.20.tar.gz
 	35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
@@ -126,7 +128,9 @@
          '4195735a80876ae812fca5736b50192a'
          'e7e4b3e70e99e5cba8f8dfcacf3b0d87'
          '3f526b966a672d1237cfcbadae0e3f95'
-         'ac71e21ecc0976b2ea6e233854963d4b')
+         'ac71e21ecc0976b2ea6e233854963d4b'
+         '3de4a8ba02b43f13dbd96cb9db240c60'
+         '0093815dfd534ac47a38aee8ac72bd0d')
 
 prepare() {
 
@@ -150,6 +154,11 @@
 	# fix not upstreamable pyuno paths - patch taken from Debian
 	patch -Np1 -i ${srcdir}/make-pyuno-work-with-system-wide-module-install.diff
 
+	# upstream backports for broken gtk3 vcl with recent gtk versions, taken from Debian
+	# FS#51002
+	patch -Np1 -i ${srcdir}/gtk3-use-style-updated-signal.diff
+        patch -Np1 -i ${srcdir}/gtk3-lot-of-style-updated-signals.diff
+
 	#use the CFLAGS but remove the LibO overridden ones
 	for i in $CFLAGS; do
 		case "$i" in

Added: gtk3-lot-of-style-updated-signals.diff
===================================================================
--- gtk3-lot-of-style-updated-signals.diff	                        (rev 0)
+++ gtk3-lot-of-style-updated-signals.diff	2016-10-13 19:27:30 UTC (rev 278798)
@@ -0,0 +1,134 @@
+From 29c55564070aa1fa7846448a6ca90fe47c38bd0a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
+Date: Mon, 19 Sep 2016 09:26:22 +0100
+Subject: Related: rhbz#1373933 gtk3 emits a lot of style-updateds signals
+
+so don't throw away font settings every time, check if the font settings
+changed and only emit FontChanged if they differ from the last seen settings.
+
+Change-Id: I129887e3e866f395da3b906a38cf568abea5de8e
+
+diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
+index 490cf69..514b13f 100644
+--- a/vcl/inc/unx/gtk/gtkinst.hxx
++++ b/vcl/inc/unx/gtk/gtkinst.hxx
+@@ -242,6 +242,8 @@ public:
+ #endif
+ 
+     virtual const cairo_font_options_t* GetCairoFontOptions() override;
++            const cairo_font_options_t* GetLastSeenCairoFontOptions();
++                                   void ResetLastSeenCairoFontOptions();
+ 
+     void                        RemoveTimer (SalTimer *pTimer);
+ 
+@@ -248,6 +248,7 @@ private:
+     std::vector<GtkSalTimer *>  m_aTimers;
+     bool                        IsTimerExpired();
+     bool                        bNeedsInit;
++    cairo_font_options_t*       m_pLastCairoFontOptions;
+ 
+     mutable std::shared_ptr<vcl::unx::GtkPrintWrapper> m_xPrintWrapper;
+ };
+diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx
+index 0f62467..9a535f0 100644
+--- a/vcl/unx/gtk/gtkinst.cxx
++++ b/vcl/unx/gtk/gtkinst.cxx
+@@ -155,6 +155,7 @@ GtkInstance::GtkInstance( SalYieldMutex* pMutex )
+     : X11SalInstance( pMutex )
+ #endif
+     , bNeedsInit(true)
++    , m_pLastCairoFontOptions(nullptr)
+ {
+ }
+ 
+@@ -200,6 +201,7 @@ GtkInstance::~GtkInstance()
+     while( !m_aTimers.empty() )
+         delete *m_aTimers.begin();
+     DeInitAtkBridge();
++    ResetLastSeenCairoFontOptions();
+ }
+ 
+ SalFrame* GtkInstance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle )
+@@ -483,7 +485,24 @@ GtkInstance::getPrintWrapper() const
+ 
+ const cairo_font_options_t* GtkInstance::GetCairoFontOptions()
+ {
+-    return gdk_screen_get_font_options(gdk_screen_get_default());
++    const cairo_font_options_t* pCairoFontOptions = gdk_screen_get_font_options(gdk_screen_get_default());
++    if (!m_pLastCairoFontOptions && pCairoFontOptions)
++        m_pLastCairoFontOptions = cairo_font_options_copy(pCairoFontOptions);
++    return pCairoFontOptions;
++}
++
++const cairo_font_options_t* GtkInstance::GetLastSeenCairoFontOptions()
++{
++    return m_pLastCairoFontOptions;
++}
++
++void GtkInstance::ResetLastSeenCairoFontOptions()
++{
++    if (m_pLastCairoFontOptions)
++    {
++        cairo_font_options_destroy(m_pLastCairoFontOptions);
++        m_pLastCairoFontOptions = nullptr;
++    }
+ }
+ 
+ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
+index 0d872cf..9167a3f 100644
+--- a/vcl/unx/gtk/gtksalframe.cxx
++++ b/vcl/unx/gtk/gtksalframe.cxx
+@@ -3235,7 +3235,21 @@ void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer fram
+         // so post user event to safely dispatch the SalEvent::SettingsChanged
+         // note: settings changed for multiple frames is avoided in winproc.cxx ImplHandleSettings
+         GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::SettingsChanged );
+-        GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::FontChanged );
++
++        // fire off font-changed when the system cairo font hints change
++        GtkInstance *pInstance = static_cast<GtkInstance*>(GetSalData()->m_pInstance);
++        const cairo_font_options_t* pLastCairoFontOptions = pInstance->GetLastSeenCairoFontOptions();
++        const cairo_font_options_t* pCurrentCairoFontOptions = gdk_screen_get_font_options(gdk_screen_get_default());
++        bool bFontSettingsChanged = true;
++        if (pLastCairoFontOptions && pCurrentCairoFontOptions)
++            bFontSettingsChanged = !cairo_font_options_equal(pLastCairoFontOptions, pCurrentCairoFontOptions);
++        else if (!pLastCairoFontOptions && !pCurrentCairoFontOptions)
++            bFontSettingsChanged = false;
++        if (bFontSettingsChanged)
++        {
++            pInstance->ResetLastSeenCairoFontOptions();
++            GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::FontChanged );
++        }
+     }
+ 
+     /* #i64117# gtk sets a nice background pixmap
+diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
+index 49bce84..3d3fc9e 100644
+--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
+@@ -3107,7 +3107,21 @@ void GtkSalFrame::signalStyleUpdated(GtkWidget*, gpointer frame)
+ 
+     // note: settings changed for multiple frames is avoided in winproc.cxx ImplHandleSettings
+     GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::SettingsChanged );
+-    GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::FontChanged );
++
++    // fire off font-changed when the system cairo font hints change
++    GtkInstance *pInstance = static_cast<GtkInstance*>(GetSalData()->m_pInstance);
++    const cairo_font_options_t* pLastCairoFontOptions = pInstance->GetLastSeenCairoFontOptions();
++    const cairo_font_options_t* pCurrentCairoFontOptions = gdk_screen_get_font_options(gdk_screen_get_default());
++    bool bFontSettingsChanged = true;
++    if (pLastCairoFontOptions && pCurrentCairoFontOptions)
++        bFontSettingsChanged = !cairo_font_options_equal(pLastCairoFontOptions, pCurrentCairoFontOptions);
++    else if (!pLastCairoFontOptions && !pCurrentCairoFontOptions)
++        bFontSettingsChanged = false;
++    if (bFontSettingsChanged)
++    {
++        pInstance->ResetLastSeenCairoFontOptions();
++        GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::FontChanged );
++    }
+ }
+ 
+ gboolean GtkSalFrame::signalWindowState( GtkWidget*, GdkEvent* pEvent, gpointer frame )
+-- 
+cgit v0.10.2
+

Added: gtk3-use-style-updated-signal.diff
===================================================================
--- gtk3-use-style-updated-signal.diff	                        (rev 0)
+++ gtk3-use-style-updated-signal.diff	2016-10-13 19:27:30 UTC (rev 278798)
@@ -0,0 +1,94 @@
+From ef7abe81df10cb8a8c04afbb1fbe700f94e73f04 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
+Date: Fri, 16 Sep 2016 11:19:52 +0100
+Subject: Resolves: rhbz#1373933 gtk 3.21 emits a lot more "style-set" signals
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+also deb#837356
+
+since gtk3 commit of...
+
+commit 0f116135f4a5033ce4e9dfa19f10624701fa615c
+Author: Matthias Clasen <mclasen at redhat.com>
+Date:   Fri May 6 10:12:14 2016 -0400
+
+    Avoid emitting ::style-set by name
+
+    GtkStyle is deprecated, but we still emit ::style-set quite
+    a bit, so lets at least not be slow while doing it.
+
+docs say...
+
+'GtkWidget::style-set has been deprecated since version 3.0 and should not be
+used in newly-written code.
+
+Use the “style-updated” signal'
+
+and this code just came over from gtk2 without any thought about it at the
+time, so change it over to the "style-updated" which makes everything happy
+again
+
+Change-Id: I9e920d2fb2d820ff1b1b5a9ecb228484df3d6146
+
+diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
+index b9fafd6..0cdff6c 100644
+--- a/vcl/inc/unx/gtk/gtkframe.hxx
++++ b/vcl/inc/unx/gtk/gtkframe.hxx
+@@ -239,7 +239,11 @@ class GtkSalFrame : public SalFrame
+ 
+     // signals
+     static gboolean     signalButton( GtkWidget*, GdkEventButton*, gpointer );
+-    static void         signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer );
++#if GTK_CHECK_VERSION(3,0,0)
++    static void         signalStyleUpdated(GtkWidget*, gpointer);
++#else
++    static void         signalStyleSet(GtkWidget*, GtkStyle* pPrevious, gpointer);
++#endif
+ #if GTK_CHECK_VERSION(3,0,0)
+     static gboolean     signalDraw( GtkWidget*, cairo_t *cr, gpointer );
+     static void         sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer frame);
+diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
+index 3a6eef7..49bce84 100644
+--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
++++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
+@@ -1009,7 +1009,7 @@ void GtkSalFrame::InitCommon()
+ 
+ 
+     // connect signals
+-    g_signal_connect( G_OBJECT(m_pWindow), "style-set", G_CALLBACK(signalStyleSet), this );
++    g_signal_connect( G_OBJECT(m_pWindow), "style-updated", G_CALLBACK(signalStyleUpdated), this );
+     gtk_widget_set_has_tooltip(pEventWidget, true);
+     m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "query-tooltip", G_CALLBACK(signalTooltipQuery), this ));
+     m_aMouseSignalIds.push_back(g_signal_connect( G_OBJECT(pEventWidget), "button-press-event", G_CALLBACK(signalButton), this ));
+@@ -3101,22 +3101,13 @@ gboolean GtkSalFrame::signalDelete( GtkWidget*, GdkEvent*, gpointer frame )
+     return true;
+ }
+ 
+-void GtkSalFrame::signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer frame )
++void GtkSalFrame::signalStyleUpdated(GtkWidget*, gpointer frame)
+ {
+     GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
+ 
+-    // every frame gets an initial style set on creation
+-    // do not post these as the whole application tends to
+-    // redraw itself to adjust to the new style
+-    // where there IS no new style resulting in tremendous unnecessary flickering
+-    if( pPrevious != nullptr )
+-    {
+-        // signalStyleSet does NOT usually have the gdk lock
+-        // so post user event to safely dispatch the SalEvent::SettingsChanged
+-        // note: settings changed for multiple frames is avoided in winproc.cxx ImplHandleSettings
+-        GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::SettingsChanged );
+-        GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::FontChanged );
+-    }
++    // note: settings changed for multiple frames is avoided in winproc.cxx ImplHandleSettings
++    GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::SettingsChanged );
++    GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr, SalEvent::FontChanged );
+ }
+ 
+ gboolean GtkSalFrame::signalWindowState( GtkWidget*, GdkEvent* pEvent, gpointer frame )
+-- 
+cgit v0.10.2
+



More information about the arch-commits mailing list