[plasma-breeze] 5.2.1-3

Rex Dieter rdieter at fedoraproject.org
Tue Mar 10 18:47:29 UTC 2015


commit 283ca278d827296b92409cbc8cf2603c40cbe085
Author: Rex Dieter <rdieter at math.unl.edu>
Date:   Tue Mar 10 13:47:28 2015 -0500

    5.2.1-3
    
    - backport upstream fixes (mostly crashers)
    - .spec cosmetics

 ...plicit-flag-as-output-from-captionRect-to.patch | 84 ++++++++++++++++++++++
 ...scrollbar-policy-before-forwarding-events.patch | 37 ++++++++++
 ...nt-style-method-when-option-passed-to-tab.patch | 31 ++++++++
 ...idget-validity-before-calling-deleteLater.patch | 26 +++++++
 plasma-breeze.spec                                 | 22 +++++-
 5 files changed, 197 insertions(+), 3 deletions(-)
---
diff --git a/0003-Added-an-explicit-flag-as-output-from-captionRect-to.patch b/0003-Added-an-explicit-flag-as-output-from-captionRect-to.patch
new file mode 100644
index 0000000..12e86bd
--- /dev/null
+++ b/0003-Added-an-explicit-flag-as-output-from-captionRect-to.patch
@@ -0,0 +1,84 @@
+From a8d2104ab36c91053da1fee3ad31d68c979965a7 Mon Sep 17 00:00:00 2001
+From: Hugo Pereira Da Costa <hugo.pereira at free.fr>
+Date: Thu, 26 Feb 2015 00:17:18 +0100
+Subject: [PATCH 3/8] Added an explicit flag as output from captionRect to tell
+ whether caption must be ellided or not. BUG: 344552
+
+---
+ kdecoration/breezedecoration.cpp | 18 ++++++++++--------
+ kdecoration/breezedecoration.h   |  8 +++++++-
+ 2 files changed, 17 insertions(+), 9 deletions(-)
+
+diff --git a/kdecoration/breezedecoration.cpp b/kdecoration/breezedecoration.cpp
+index 3b1479a..f633065 100644
+--- a/kdecoration/breezedecoration.cpp
++++ b/kdecoration/breezedecoration.cpp
+@@ -440,10 +440,13 @@ namespace Breeze
+ 
+         // draw caption
+         painter->setFont(s->font());
+-        const QRect cR = captionRect();
+-        const QString caption = painter->fontMetrics().elidedText(c->caption(), Qt::ElideMiddle, cR.width());
++        const auto cR = captionRect();
++        const QString caption = cR.second ?
++            painter->fontMetrics().elidedText(c->caption(), Qt::ElideMiddle, cR.first.width()):
++            c->caption();
++
+         painter->setPen(m_colorSettings.font(c->isActive()));
+-        painter->drawText(cR, Qt::AlignVCenter| Qt::AlignLeft | Qt::TextSingleLine, caption);
++        painter->drawText(cR.first, Qt::AlignVCenter| Qt::AlignLeft | Qt::TextSingleLine, caption);
+ 
+         // draw all buttons
+         m_leftButtons->paint(painter, repaintRegion);
+@@ -470,7 +473,7 @@ namespace Breeze
+     { return borderTop() - settings()->smallSpacing()*(Metrics::TitleBar_BottomMargin + Metrics::TitleBar_TopMargin ) - 1; }
+ 
+     //________________________________________________________________
+-    QRect Decoration::captionRect() const
++    QPair<QRect,bool> Decoration::captionRect() const
+     {
+         const int leftOffset = m_leftButtons->geometry().x() + m_leftButtons->geometry().width() + Metrics::TitleBar_SideMargin*settings()->smallSpacing();
+         const int rightOffset = size().width() - m_rightButtons->geometry().x() + Metrics::TitleBar_SideMargin*settings()->smallSpacing();
+@@ -480,9 +483,8 @@ namespace Breeze
+         boundingRect.setTop( yOffset );
+         boundingRect.setHeight( captionHeight() );
+ 
+-        /* need to increase the bounding rect because it is sometime (font dependent)
+-        too small, resulting in text being elided */
+-        boundingRect.setWidth( boundingRect.width()+4 );
++        // store original width to detect when text ellision is needed
++        const int boundingRectWidth( boundingRect.width() );
+ 
+         switch( m_internalSettings->titleAlignment() )
+         {
+@@ -518,7 +520,7 @@ namespace Breeze
+             boundingRect.setLeft( qMax( boundingRect.left(), leftOffset ) );
+         }
+ 
+-        return boundingRect;
++        return qMakePair( boundingRect, boundingRect.width() < boundingRectWidth );
+ 
+     }
+ 
+diff --git a/kdecoration/breezedecoration.h b/kdecoration/breezedecoration.h
+index 9eb6c65..ccdc6a6 100644
+--- a/kdecoration/breezedecoration.h
++++ b/kdecoration/breezedecoration.h
+@@ -109,7 +109,13 @@ namespace Breeze
+         void updateAnimationState();
+ 
+         private:
+-        QRect captionRect() const;
++
++        /**
++        return the smallest rect in which caption will be drawn,
++        properly positionned inside the title bar. Second return parameter
++        is set to true when text ellision is required
++        */
++        QPair<QRect,bool> captionRect() const;
+ 
+         void createButtons();
+         void paintTitleBar(QPainter *painter, const QRect &repaintRegion);
+-- 
+2.3.1
+
diff --git a/0004-Check-scrollbar-policy-before-forwarding-events.patch b/0004-Check-scrollbar-policy-before-forwarding-events.patch
new file mode 100644
index 0000000..88834e0
--- /dev/null
+++ b/0004-Check-scrollbar-policy-before-forwarding-events.patch
@@ -0,0 +1,37 @@
+From 759ff9bf1ba38a47214849bc0a80cfbc7333c3a9 Mon Sep 17 00:00:00 2001
+From: Hugo Pereira Da Costa <hugo.pereira at free.fr>
+Date: Sun, 1 Mar 2015 18:19:10 +0100
+Subject: [PATCH 4/8] Check scrollbar policy before forwarding events BUG:
+ 343659
+
+---
+ kstyle/breezestyle.cpp | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp
+index 818eaec..6caa00b 100644
+--- a/kstyle/breezestyle.cpp
++++ b/kstyle/breezestyle.cpp
+@@ -1002,8 +1002,9 @@ namespace Breeze
+                 QList<QScrollBar*> scrollBars;
+                 if( QAbstractScrollArea* scrollArea = qobject_cast<QAbstractScrollArea*>( widget ) )
+                 {
+-                    scrollBars.append( scrollArea->horizontalScrollBar() );
+-                    scrollBars.append( scrollArea->verticalScrollBar() );
++
++                    if( scrollArea->horizontalScrollBarPolicy() != Qt::ScrollBarAlwaysOff ) scrollBars.append( scrollArea->horizontalScrollBar() );
++                    if( scrollArea->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff )scrollBars.append( scrollArea->verticalScrollBar() );
+ 
+                 } else if( widget->inherits( "KTextEditor::View" ) ) {
+ 
+@@ -5440,7 +5441,6 @@ namespace Breeze
+ 
+         const bool hasPopupMenu( toolButtonOption->subControls & SC_ToolButtonMenu );
+         const bool hasInlineIndicator( toolButtonOption->features & QStyleOptionToolButton::HasMenu && !hasPopupMenu );
+-
+         const QRect buttonRect( subControlRect( CC_ToolButton, option, SC_ToolButton, widget ) );
+         const QRect menuRect( subControlRect( CC_ToolButton, option, SC_ToolButtonMenu, widget ) );
+ 
+-- 
+2.3.1
+
diff --git a/0006-return-parent-style-method-when-option-passed-to-tab.patch b/0006-return-parent-style-method-when-option-passed-to-tab.patch
new file mode 100644
index 0000000..8ff6883
--- /dev/null
+++ b/0006-return-parent-style-method-when-option-passed-to-tab.patch
@@ -0,0 +1,31 @@
+From ac6e765800cf6e78a2cae8692f6c49b75df49bda Mon Sep 17 00:00:00 2001
+From: Hugo Pereira Da Costa <hugo.pereira at free.fr>
+Date: Tue, 3 Mar 2015 16:37:55 +0100
+Subject: [PATCH 6/8] return parent style method when option passed to tabBar
+ rect is invalid, instead of full option rect removed check on invalid tabbar
+ size BUG: 344779
+
+---
+ kstyle/breezestyle.cpp | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp
+index 6caa00b..e91b5da 100644
+--- a/kstyle/breezestyle.cpp
++++ b/kstyle/breezestyle.cpp
+@@ -1548,11 +1548,10 @@ namespace Breeze
+ 
+         // cast option and check
+         const QStyleOptionTabWidgetFrame* tabOption = qstyleoption_cast<const QStyleOptionTabWidgetFrame*>( option );
+-        if( !tabOption ) return option->rect;
++        if( !tabOption ) return ParentStyleClass::subElementRect( SE_TabWidgetTabBar, option, widget );
+ 
+         // do nothing if tabbar is hidden
+         const QSize tabBarSize( tabOption->tabBarSize );
+-        if( tabBarSize.isEmpty() ) return option->rect;
+ 
+         QRect rect( option->rect );
+         QRect tabBarRect( QPoint(0, 0), tabBarSize );
+-- 
+2.3.1
+
diff --git a/0008-check-widget-validity-before-calling-deleteLater.patch b/0008-check-widget-validity-before-calling-deleteLater.patch
new file mode 100644
index 0000000..b5eaded
--- /dev/null
+++ b/0008-check-widget-validity-before-calling-deleteLater.patch
@@ -0,0 +1,26 @@
+From 72d18b7f5245d265fb0eb974854989aebc357724 Mon Sep 17 00:00:00 2001
+From: Hugo Pereira Da Costa <hugo.pereira at free.fr>
+Date: Mon, 9 Mar 2015 20:52:13 +0100
+Subject: [PATCH 8/8] check widget validity before calling deleteLater BUG:
+ 344980
+
+---
+ kstyle/breezepalettehelper.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kstyle/breezepalettehelper.cpp b/kstyle/breezepalettehelper.cpp
+index e134a65..1fcb3e6 100644
+--- a/kstyle/breezepalettehelper.cpp
++++ b/kstyle/breezepalettehelper.cpp
+@@ -44,7 +44,7 @@ namespace Breeze
+ 
+     //_____________________________________________________
+     PaletteHelper::~PaletteHelper()
+-    { _widget->deleteLater(); }
++    { if( _widget ) _widget->deleteLater(); }
+ 
+ 
+     //_____________________________________________________
+-- 
+2.3.1
+
diff --git a/plasma-breeze.spec b/plasma-breeze.spec
index afa87d9..e088689 100644
--- a/plasma-breeze.spec
+++ b/plasma-breeze.spec
@@ -4,7 +4,7 @@
 
 Name:           plasma-breeze
 Version:        5.2.1
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Artwork, styles and assets for the Breeze visual style for the Plasma Desktop
 
 License:        GPLv2+
@@ -18,6 +18,12 @@ URL:            https://projects.kde.org/projects/kde/workspace/breeze
 %endif
 Source0:        http://download.kde.org/%{stable}/plasma/%{version}/%{base_name}-%{version}.tar.xz
 
+## upstream fixes
+Patch3: 0003-Added-an-explicit-flag-as-output-from-captionRect-to.patch
+Patch4: 0004-Check-scrollbar-policy-before-forwarding-events.patch
+Patch6: 0006-return-parent-style-method-when-option-passed-to-tab.patch
+Patch8: 0008-check-widget-validity-before-calling-deleteLater.patch
+
 BuildRequires:  kf5-rpm-macros
 BuildRequires:  extra-cmake-modules
 BuildRequires:  qt5-qtbase-devel
@@ -71,11 +77,13 @@ Provides:       plasma-breeze-kde4%{?_isa} = %{version}-%{release}
 %{summary}.
 %endif
 
+
 %prep
-%setup -q -n %{base_name}-%{version}
+%autosetup -n %{base_name}-%{version} -p1
+
 
 %build
-mkdir -p %{_target_platform}
+mkdir %{_target_platform}
 pushd %{_target_platform}
 %{cmake_kf5} ..
 popd
@@ -92,13 +100,16 @@ popd
 make %{?_smp_mflags} -C %{_target_platform}_kde4
 %endif
 
+
 %install
 make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
 %find_lang breeze --with-qt --all-name
+
 %if 0%{?build_kde4:1}
 make install/fast DESTDIR=%{buildroot} -C %{_target_platform}_kde4
 %endif
 
+
 %files
 %doc cursors/Breeze/README COPYING COPYING-ICONS
 %{_kf5_qtplugindir}/org.kde.kdecoration2/breezedecoration.so
@@ -142,7 +153,12 @@ fi
 %{_kde4_appsdir}/kstyle/themes/breeze.themerc
 %endif
 
+
 %changelog
+* Tue Mar 10 2015 Rex Dieter <rdieter at fedoraproject.org> - 5.2.1-3
+- backport upstream fixes (mostly crashers)
+- .spec cosmetics
+
 * Fri Feb 27 2015 Daniel Vrátil <dvratil at redhat.com> - 5.2.1-2
 - Rebuild (GCC 5)
 


More information about the scm-commits mailing list