Resolves: rhbz#1373933 gtk 3.21 emits way too many style-set signals

f41
Caolán McNamara 8 years ago
parent 040030436a
commit 042c7d7b38

@ -0,0 +1,100 @@
From 265829dd1a0fb6bd271f3661803645bd42e0ce39 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Fri, 16 Sep 2016 11:19:52 +0100
Subject: [PATCH] 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@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
(cherry picked from commit ef7abe81df10cb8a8c04afbb1fbe700f94e73f04)
---
vcl/inc/unx/gtk/gtkframe.hxx | 6 +++++-
vcl/unx/gtk3/gtk3gtkframe.cxx | 19 +++++--------------
2 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 2b5dc55..1b48aa3 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -242,7 +242,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 9ea6237..1eba8e2 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -993,7 +993,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 ));
@@ -3145,22 +3145,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 )
--
2.7.4

@ -55,7 +55,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice
Epoch: 1
Version: %{libo_version}.1
Release: 1%{?libo_prerelease}%{?dist}
Release: 2%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 and CC0
URL: http://www.libreoffice.org/
@ -241,6 +241,7 @@ Patch10: 0001-Resolves-rhbz-1351224-wayland-grab-related-crashes.patch
Patch11: 0001-Resolves-rhbz-1352965-gtk3-infinite-clipboard-recurs.patch
Patch12: 0001-Related-rhbz-1351369-gtk3-clipboards-have-to-live-to.patch
Patch13: 0001-add-xdg-email-as-the-default-email-route.patch
Patch14: 0001-Resolves-rhbz-1373933-gtk-3.21-emits-a-lot-more-styl.patch
%if 0%{?rhel}
# not upstreamed
@ -2296,6 +2297,9 @@ done
%endif
%changelog
* Fri Sep 16 2016 Caolán McNamara <caolanm@redhat.com> - 1:5.2.2.1-2
- Resolves: rhbz#1373933 gtk 3.21 emits way too many "style-set" signals
* Wed Sep 14 2016 David Tardon <dtardon@redhat.com> - 1:5.2.2.1-1
- update to 5.2.2 rc1

Loading…
Cancel
Save