Bug 291052 - Flicker when changing between Areas
Summary: Flicker when changing between Areas
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: git master
Platform: Gentoo Packages Linux
: VLO minor
Target Milestone: 4.2.3
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-09 13:40 UTC by Gunther Piez
Modified: 2012-12-10 14:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gunther Piez 2012-01-09 13:40:56 UTC
Version:           git master (using KDE 4.7.4) 
OS:                Linux

When changing views, the whole window seems to get repainted or parts get resized several times. 

This becomes especially noticeable if the views a heavily populated and if the "Dim Inactive" desktop effect is activated. In this case the whole window gets dimmed shortly (as if in background), causing an additional flicker effect.

Reproducible: Always

Steps to Reproduce:
Open several files in a project
Start a debug run
Do some changes and commit
Switch between Code/Debug/Review

Actual Results:  
Flicker all over the screen.

Expected Results:  
No flickering.
Comment 1 Aleix Pol 2012-01-18 01:12:38 UTC
This problem just happens sometimes, I actually worked on it a bit during the last sprint, I think it works quite well at the moment, reducing priority.
Comment 2 Kevin Funk 2012-11-24 12:32:12 UTC
This is still *veeery* slow for me. Taking up to 2-3 seconds to switch between 'Debug' and 'Code'.
Using the qtcurve style right now. Can someone confirm/reproduce?

Aleix, can you show me the commits that were supposed to improve this behavior? Might investigate it then.
Comment 3 Aleix Pol 2012-11-26 02:21:28 UTC
You can for HoldUpdates in kdevplatform/sublime/mainwindow.cpp

If you want to look into this, maybe you could try to delay the document creation on display. Also a similar solution for Toolviews could be found, maybe.

The problem is that every time you switch area everything is closed and re-opened, even if there are repeated things...

Another thing you can do, is remove code from widgets initialization... It's not easy to profile GUI, but maybe it's worth it.

Good luck! :)
Comment 4 Aleix Pol 2012-11-28 02:36:28 UTC
Git commit 8c22f2ffdc5b1df0c6b111868a5aca8debca5ced by Aleix Pol.
Committed on 28/11/2012 at 01:29.
Pushed by apol into branch 'master'.

Delay initialization of TextEditorWidget

This patch reduces the initialization of the loading a text document view
by delaying the initialization.
This is useful because when we change areas we close all the opened views
and then we reopen the new ones. The loading of document views was one of
the most expensive calls that happened there. This is now delayed to the
event loop so the view creation now is trivial by creating only an empty
widget that will be instantiated afterwards.

I'm not closing the bug for the moment, but it would be interesting to know
how it went, so feedback is welcome!

M  +38   -20   shell/textdocument.cpp
M  +6    -4    shell/textdocument.h

http://commits.kde.org/kdevplatform/8c22f2ffdc5b1df0c6b111868a5aca8debca5ced
Comment 5 Aleix Pol 2012-11-28 02:36:28 UTC
Git commit cd3d48751c167ac547682a559e98e7dd7aa425a3 by Aleix Pol.
Committed on 28/11/2012 at 03:30.
Pushed by apol into branch 'master'.

Don't resize the vertical IdealButtonBarWidget when it's empty

This greatly reduces the flickering on area switching. What was happening
is that when changing areas all buttons were removed and re-added. In this
process the button bar would shrink when empty and that would trigger a
re-layout of the whole GUI. Now we keep the width of the buttons we've
added.

This won't be a regression given that my previous commit improves the
behavior when there are no buttons on the button bar, so we won't get
a big gray area.

Now all the flickering when changing area should be gone.

M  +6    -0    sublime/ideal.cpp

http://commits.kde.org/kdevplatform/cd3d48751c167ac547682a559e98e7dd7aa425a3
Comment 6 Gunther Piez 2012-11-28 10:04:25 UTC
Great patch :-)

I didn't do anything for me at first, but after deleting everything beginning with "kdev*" in ~/.kde/share/apps and deleting old sessions the flickering is ultimately gone.

Guess a lot of stale config files had accumulated over the years.

Thank you the good work, KDevelop looks _much_ better now :-)
Comment 7 Andreas Pakulat 2012-12-10 14:23:00 UTC
Git commit e0583cfbd36ade497039ae8464f876ab70b450b5 by Andreas Pakulat.
Committed on 10/12/2012 at 15:22.
Pushed by apaku into branch 'master'.

Revert lazy initialization of the Text Editor

This essentially reverts 8c22f2ffdc5b1df0c6b111868a5aca8debca5ced but without
reverting most of the actual code changes since in the meantime other changes
depend on the adjusted API. Instead the initialization call is just done
synchronously from the constructor instead of through the QMetaObject API.

This fixes the problem of context menus not being shown in the editor most
of the time after opening a file that happened since the above mentioned
commit. Neither keyboard nor mouse clicks where triggering a context menu,
only after switching to another tab and back did things work correctly. Its
unclear to me why that happens, but I'd rather have a bit slower area
switching than non-working context menus.

M  +1    -1    shell/textdocument.cpp

http://commits.kde.org/kdevplatform/e0583cfbd36ade497039ae8464f876ab70b450b5
Comment 8 Andreas Pakulat 2012-12-10 14:23:08 UTC
Git commit e0583cfbd36ade497039ae8464f876ab70b450b5 by Andreas Pakulat.
Committed on 10/12/2012 at 15:22.
Pushed by apaku into branch 'master'.

Revert lazy initialization of the Text Editor

This essentially reverts 8c22f2ffdc5b1df0c6b111868a5aca8debca5ced but without
reverting most of the actual code changes since in the meantime other changes
depend on the adjusted API. Instead the initialization call is just done
synchronously from the constructor instead of through the QMetaObject API.

This fixes the problem of context menus not being shown in the editor most
of the time after opening a file that happened since the above mentioned
commit. Neither keyboard nor mouse clicks where triggering a context menu,
only after switching to another tab and back did things work correctly. Its
unclear to me why that happens, but I'd rather have a bit slower area
switching than non-working context menus.

M  +1    -1    shell/textdocument.cpp

http://commits.kde.org/kdevplatform/e0583cfbd36ade497039ae8464f876ab70b450b5