<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>345553</bug_id>
          
          <creation_ts>2015-03-26 16:08:20 +0000</creation_ts>
          <short_desc>QApplication::setPalette causes massive cpu load on KTextEditor::EditorPrivate::updateColorPalette</short_desc>
          <delta_ts>2016-05-28 12:40:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>frameworks-ktexteditor</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>358526</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Thomas Lübking">thomas.luebking</reporter>
          <assigned_to name="KWrite Developers">kwrite-bugs-null</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1507511</commentid>
    <comment_count>0</comment_count>
    <who name="Thomas Lübking">thomas.luebking</who>
    <bug_when>2015-03-26 16:08:20 +0000</bug_when>
    <thetext>Virtuality UI style swaps the palette of modal dialogs, for that purpose (to cover style sheet abuse... ;-) it needs to temporarily alter the application palette.

For kwrite &amp; kate that caused quite some overhead, where I initially believed that this was an issue in kfiledialog and/or kcm, maybe sycoca, but then on kate w/ quite some docs open, the dialog wouldn&apos;t show up *after minutes* and so I checked where things were taking a nap.

It hangs around in KTextEditor::ViewPrivate::updateRendererConfig and one backtrace gave me 
text re-shaping.

The  QApplication::setPalette() call would happen twice at best in this occasion, so it&apos;s not like virtuality swaps the palette some thousand times.

Deactivating the feature shows the dialog instantly, so i&apos;m pretty sure this is the problem.

Since application palette changes might occur for other reasons (and at runtime) I assume this should be sorted out. Any idea what might be the cause (Arch doesn&apos;t provide debug enabled libs, i&apos;d have to compile libKF5TextEditor locally for a better backtrace if required)

---------

Backtrace:

#0  0xb725c7aa in ?? () from /usr/lib/libKF5TextEditor.so.5
#1  0xb725ca3a in ?? () from /usr/lib/libKF5TextEditor.so.5
#2  0xb7257f4f in ?? () from /usr/lib/libKF5TextEditor.so.5
#3  0xb7258e94 in ?? () from /usr/lib/libKF5TextEditor.so.5
#4  0xb726076c in ?? () from /usr/lib/libKF5TextEditor.so.5
#5  0xb72613cd in ?? () from /usr/lib/libKF5TextEditor.so.5
#6  0xb72bb5f3 in ?? () from /usr/lib/libKF5TextEditor.so.5
#7  0xb72bb8dd in ?? () from /usr/lib/libKF5TextEditor.so.5
#8  0xb72a3cd6 in KTextEditor::ViewPrivate::updateRendererConfig() () from /usr/lib/libKF5TextEditor.so.5
#9  0xb7256f13 in ?? () from /usr/lib/libKF5TextEditor.so.5
#10 0xb7307216 in KateRendererConfig::updateConfig() () from /usr/lib/libKF5TextEditor.so.5
#11 0xb731cd43 in KTextEditor::EditorPrivate::updateColorPalette() () from /usr/lib/libKF5TextEditor.so.5
#12 0xb731cd84 in KTextEditor::EditorPrivate::eventFilter(QObject*, QEvent*) () from /usr/lib/libKF5TextEditor.so.5
#13 0xb579065b in QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#14 0xb6144676 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#15 0xb6149ec1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#16 0xb57909ea in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#17 0xb6145400 in QApplicationPrivate::setPalette_helper(QPalette const&amp;, char const*, bool) () from /usr/lib/libQt5Widgets.so.5
#18 0xb61458fe in QApplication::setPalette(QPalette const&amp;, char const*) () from /usr/lib/libQt5Widgets.so.5
#19 0xae897058 in BE::Style::swapPalette(QWidget*) () from /usr/lib/qt/plugins/styles/libvirtuality.so
#20 0xae898731 in BE::Style::eventFilter(QObject*, QEvent*) () from /usr/lib/qt/plugins/styles/libvirtuality.so


Bit deeper steps (otherwise as above):

#3  0xb4721d7f in ?? () from /usr/lib/libharfbuzz.so.0
#4  0xb470718f in hb_shape_plan_execute () from /usr/lib/libharfbuzz.so.0
#5  0xb4706587 in hb_shape_full () from /usr/lib/libharfbuzz.so.0
#6  0xb5c5c85e in QTextEngine::shapeTextWithHarfbuzzNG(QScriptItem const&amp;, unsigned short const*, int, QFontEngine*, QVector&lt;unsigned int&gt; const&amp;, bool) const () from /usr/lib/libQt5Gui.so.5
#7  0xb5c605b1 in QTextEngine::shapeText(int) const () from /usr/lib/libQt5Gui.so.5
#8  0xb5c612d8 in QTextEngine::shape(int) const () from /usr/lib/libQt5Gui.so.5
#9  0xb5c739d8 in QTextLine::layout_helper(int) () from /usr/lib/libQt5Gui.so.5
#10 0xb5c74ec0 in QTextLine::setLineWidth(double) () from /usr/lib/libQt5Gui.so.5

Reproducible: Always</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1597186</commentid>
    <comment_count>1</comment_count>
    <who name="Dominik Haumann">dhaumann</who>
    <bug_when>2016-05-28 12:40:33 +0000</bug_when>
    <thetext>This was fixed end of January 2016, please update the KDE Frameworks to a recent version.

*** This bug has been marked as a duplicate of bug 358526 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>