!Rant: Desktop Effects? Hell, yeah!
April 02, 2009 by Thiago Macieira | Comments
Last year I wrote a rather strong blog when I was frustrated, titled Desktop Effects? Never more. In that blog, I was relating one of the side-effects that I had when I switched from KDE 3 to KDE 4. For context, for those who don't want to read the entire blog (and you shouldn't), I finally switched just before KDE 4.1 was released. Until then, I had been running KDE 3 and 4 in alternance, or with some KDE 4 applications inside KDE 3, etc. (and it would be a few more months until I stopped using my last two KDE 3 applications: Amarok and Kontact).
The issue that was driving me crazy was that desktop effects were unusable at that time. First, kwin would use 90% of the CPU. Second, windows would disappear (100% transparent) or turn black. To top it off, one runaway debug message in kio_imap4 ate all of my disk space, driving me over the edge (as far as I know, that issue is still present). Since then, I have also had problems with Kontact / KMail -- every two weeks, more or less, it would forget its account configuration then proceed to delete all my email cache.
This blog now had been long coming: I officially apologise for my words and retract all I said. I have been running desktop effects for months now, without a hitch. What's more, all the issues I mentioned in the blog are fixed (aside from the kio_imap4 debug output), including Konsole's redrawing speed on window resize. Turns out that KWin taking 90% of the CPU when using glib was caused by some code that had been designed to save CPU when using glib...
Also contributed to this the newest NVidia binary drivers. It took a long time, but finally the 180.22 version fixed all issues I had in my workstation (8600GT, TwinView) and in my laptop (8400GM, also running TwinView). All versions prior to it had issues, either causing freezes or showing garbage or with disappearing windows.
Now, it would be a pretty boring blog if it didn't have a plot twist: I have been thinking about writing this blog for over a month now. I was delayed due to travelling (I did OSL-MUC-SFO-PDX-DFW-SAO-REC-SAO-FRA-OSL in 15 days, attended two conferences, visited my parents and two offices). And I was delayed by a bug in Plasma.
Last week, after updating Plasma from Subversion trunk and restarting it, the secondary (right) screen in my dual-screen setup started not repainting completely. The wallpaper was shown only at the top-left corner, leaving the bottom and right not painted. And with desktop effects enabled, this not-painted area got composited with the windows, thus yielding garbage. (Think about it: if you alpha-blend a nice Konsole window with unpainted garbage, you get blended garbage)
So I had to turn off desktop effects. And I felt it would be hypocritical to say I've been using desktop effects while I had it turned off.
Well, if I'm blogging now, it's because it's fixed. And desktop effects are back on. The bug was quite simple and doesn't deserve much attention (r948226 is the fix). What's interesting is what I learnt in the process. Besides, this was a one-week period only, whereas I have been using desktop effects for months now.
Remember: I'm the network guy, who knows the tool classes and maintains D-Bus. I don't have the first clue about painting. What's more, my day job now is about maintaining Powerpoint presentations...
- First thing I learnt is that Qt Creator can already load CMake-based projects quite fine;
- To load a CMake project, Qt Creator requires a generator called "CodeBlocks", so you should start cmake like this:
cmake "-GCodeBlocks - Unix Makefiles" <other options> $srcdir; - If you already have a CMake build tree, you can add a new generator (or any other options) by using the undocumented -H and -B options:
cmake "-GCodeBlocks - Unix Makefiles" -H$srcdir -B$builddir; - Once I did that, I could use Qt Creator's very useful "find definition" F2 shortcut to navigate the code. It came in very handy as well when I was debugging D-Bus last week. And note that D-Bus uses an automake/autoconf-based buildsystem which is not supported yet;
- The CMake support in Qt Creator lets you choose which targets to build and to debug. The list was impressive when I loaded kdebase;
- Debugging Plasma inside Qt Creator is possible;
- However, debugging my problem in Qt Creator was extremely slow. Apparently having 120+ stack frames slows things down considerably (but I hear it's being worked on already);
- Turns out that the 120+ stack frames should have hinted me to the problem in Plasma (having three nested paint events was the clue);
- If you're step-by-step debugging Plasma, the clock doesn't get updated,
On that last thing, here's how I found out: I was debugging Plasma while in a phone conference, and every time I looked at my clock, I wondered, "Time is going slow today, it's still 14:25. This phone conference seems like it's never going to end". I really should have clued in by the third time...
The remaining things I would like to see fixed (they're by now only annoyances):
- The NVidia binary Open GL libraries are compiled without -fPIC. This means every single process that links to libGL.so on Linux automatically uses 10 MB of non-shared memory, at load time, and there's nothing we can do about it. This affects every user of the binary drivers, regardless of desktop.
- My keyboard has a few extra keys labelled 1 to 5 that xev recognises, but I can't get them to work as application switchers with KWin. I've heard that this is related to a Qt issue (have you ever tried to set a shortcut and the KDE dialog tells you "the key you pressed is not supported by Qt"?), but I have yet to see some confirmation on the issue. If you know this to be a bug, please report it.
And, oh, it's now way over a month since my last blog when I said the snow was melting away... we're now in April and the snow is not completely gone yet.
Blog Topics:
Comments
Subscribe to our newsletter
Subscribe Newsletter
Try Qt 6.9 Now!
Download the latest release here: www.qt.io/download.
Qt 6.9 is now available, with new features and improvements for application developers and device creators.
We're Hiring
Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.
Commenting for this post has ended.
>... but I have yet to see some confirmation on the issue...
You've got it then. I got the message in question when trying to assign Shift+Alt shortcut in KDE.
Have a look at http://www.qtsoftware.com/d... . It explains the needed steps to support your keys. I actually plan to do this but have currently major time problems.
That's one of the reasons i wanted a contact person from you (ddenis).
mjansen
for the ones as curious as me as to what change 948226 looks like, here's the link :)
http://websvn.kde.org/?view...
As for KDE - I'm a happy KDE 4 user since KDE 3.9.something, and have to say that I'm simply amazed by the achievements over time. Sigh - if I just had another life to be able to commit more...
> The NVidia binary Open GL libraries are compiled without -fPIC. This means every single process that links to libGL.so on Linux automatically uses 10 MB of non-shared memory, at load time, and there's nothing we can do about it.
Wanna bet :) ?
Luboš: the only thing I figured we could do is blog and, pardon for the term, bitch about it. That's what I'm doing now.
So, if NVidia is listening: you're the greatest memory hog right now in KDE 4, for no good reason. All the other memory hogs at least are concentrated (MySQL Embedded in Amarok, for instance, 17MB malloc on startup) or serve a very good purpose.
I have a slightly older Radeon on my desktop and am using the open source driver. It took me a while tweaking my xorg.conf, but I finally have desktop effects that are smooth, snappy and awesome. But my laptop has to use the proprietary catalyst/fglrx driver, and it truly sucks. I have to keep desktop effects off because the jerkiness is migraine inducing.
Desktop effects are still a hit-or-miss feature.
I was eager to try Qt Creator with a real-life project, but I'm really confused about Qt Creator's CMake support. As the File -> Open dialog offers to directly open CMakeLists.txt files (which did not work for me, by the way), I would not have expected to actually have to run CMake with a generator first. And why on earth the Code::Blocks generator? For me, "CMake support" would mean to be able to directly open CMakeLists.txt files as project files from within Qt Creator. Everything else is support for some other's IDE project files, and you could use CMake to generate these files, but that's not "CMake support", IMHO.
I just saw in Qt Creator's Git repository that full / native CMakeLists.txt support is supposed to be available in version 1.1, yay!