Bug 318567

Summary: Window switching and resizing is slow for some window decoration schemes
Product: [Plasma] kwin Reporter: Kaorukun
Component: auroraeAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version: 4.10.1   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: System Settings / Desktop Effects / Advanced is showing composite type as OpenGL, although compositing is disabled

Description Kaorukun 2013-04-18 20:21:14 UTC
When the focus switches to a different window, the switching process is visibly delayed. This can occur when opening a new window (e.g. when application opens a dialog window) or when switching between windows via Alt-Tab, task bar or mouse selection in the main screen area.

When switching window using one of these ways, the new window quickly appears, but stays inactive for 0.5-1 second, then becomes active. This behavior appeared after upgrade from 4.9.5 to 4.10.1. Prior to that, and also in older versions, window switching was near instantaneous.

After experimenting with settings, I found out that this behavior is observed only with some of the window decoration schemes, such as Plastik, while with other schemes, like Nano are fast.

Further, I noticed that the decoration scheme also affects the window resizing speed. Resizing window with Plastik scheme selected is extremely jerky, sometimes it takes almost a second to redraw window with the new size. Just moving windows around the screen is fast.

Reproducible: Always

Steps to Reproduce:
1. Open any application, e.g. KWrite
2. Go to System Settings / Window Decorations and select and apply "Plastik" theme
3. Resize KWrite window
4. Open a dialog in KWrite, e.g. by pressing Ctrl+O to open a file chooser dialog
5. Minimize KWrite window, then restore it again
6. Repeat the steps, but using window decoration theme "Nano"
Actual Results:  
Step 3: window resizing is jerky
Step 4: file chooser dialog takes a long time to become active (and the main KWrite window in background to become inactive)
Step 5: restored window takes a similarly long time to activate
Step 6: resizing is smooth, switching to file chooser dialog is fast, minimizing and restoring window is fast

Expected Results:  
Window resizing and switching should be as fast as in previous versions of KDE for all standard themes

Platform: Gentoo Linux, 32-bit.
Graphics: AMD Catalyst 13.2_beta7
KDE: Compiled from source through Gentoo's Portage.
Comment 1 Thomas Lübking 2013-04-18 20:30:20 UTC
most likely dupe of bug #313016

are you using the native graphiccsystem or no compositing?
what also hits you on window activation is the animated transition which is iirc disabled w/o compositing or on the native graphicssystem (now)
Comment 2 Kaorukun 2013-04-18 21:19:42 UTC
As far as I know, I'm using default settings for compositing and did no changes between KDE versions. My settings under Effects/Advanced:
Compositing type : OpenGL
Qt graphics system : Raster
Keep window thumbnails: never
Scale method: smooth
[x] Suspend desctop effects ...
[x] Use OpenGL 2 Shaders
[x] Use VSync
[ ] Enable Color correction

I also keep all effects and animations disabled.
Comment 3 Thomas Lübking 2013-04-18 21:26:20 UTC
fyi, you can just post the output of "qdbus org.kde.kwin /KWin supportInformation"

The animations in plastik are "hardcoded" - but it's QML.

I assume you don't have this problem with the laptop decoration or oxygen or dekorator themes, qtcurve, bespin, skulpture, eventually smaragd?

So basically it's an issue of (atm mostly) Plastik.

/usr/share/apps/kwin/decorations/kwin4_decoration_qml_plastik/contents/ui/main.qml
Set animationDuration's to "0" and restart kwin.
Comment 4 Kaorukun 2013-04-18 22:09:02 UTC
OK, this just got a lot weirder - I ran "qdbus org.kde.kwin /KWin supportInformation" as you suggested and to my surprise it showed me that "Compositing is not active", although System Settings/Desktop Effects/Advanced clearly shows that it is set to OpenGL/Raster ! In fact, I could not switch it to XRender before because it gave me an error message about being unable to start some effects.

After a bit of searching, I edited ~/.kde4/share/config/kwinrc where I found "Enabled=false" under the [Compositing] section and changed it to true. After KDE restart, qdbus now shows compositing working, and the Qt graphics system has switched to "native". After changing that to "Raster" I'm now able to use Plastik theme without issues!

In short - the performance issue was indeed caused by the disabled compositing, respective Qt graphics system being set to native. For some reason however, the System Settings GUI incorrectly assured me that the compositing was enabled!
Comment 5 Thomas Lübking 2013-04-18 22:17:50 UTC
(In reply to comment #4)
> OK, this just got a lot weirder - I ran "qdbus org.kde.kwin /KWin
> supportInformation" as you suggested and to my surprise it showed me that
> "Compositing is not active", although System Settings/Desktop
> Effects/Advanced clearly shows that it is set to OpenGL/Raster !

Regardless of the configuration, compositing can (iff supported) be de/activated any time.

> After a bit of searching, I edited ~/.kde4/share/config/kwinrc where I found
> "Enabled=false"
This is also on the primary tab of the compositing settings. 

> the System Settings GUI incorrectly assured me that the
> compositing was enabled!
Misconception - the "settings" (esp. on the advanced page) don't hint anything about the current state (at least not in the English version) and even the "Enabled" key only sets whether to "Enable desktop effects at startup" (the setting on the first page)

There's actually no explicit comment on whether compositing is enabled (implicitly, you won't get animations, translucency and shadows etc. w/o it)

*** This bug has been marked as a duplicate of bug 313016 ***
Comment 6 Kaorukun 2013-04-18 22:18:25 UTC
Created attachment 79014 [details]
System Settings / Desktop Effects / Advanced is showing composite type as OpenGL, although compositing is disabled