QML Support For KDE KWin Window Decorations

Posted by Michael Larabel on July 27, 2012

KDE's KWin compositing window manager now has support for QML window decorations.

Martin Gräßlin has written today on his blog about QML support for window decorations.

For the key information relevant to KDE developers and users with this change:
In the current state the decoration consists of 370 lines of QML code and I expect to need an additional 100 lines to finish the buttons (they are already functional, that is the close button closes the window) and add some of the configuration options. The same API in C++ consists of 1500 lines of code. So we do not only get fewer lines of code but also a more readable and easier to maintain codebase. For something like a window decoration a declarative approach is much better suited than the imperative C++ way of painting elements.

Overall the new QML API will provide the same powerful features as the KDecoration API, but also provides convenience functionality as KCommonDecoration, e.g. a button group taking care of laying out the decoration buttons. To make development of QML based decorations quite simple support is currently being added to Plasmate as part of the Google Summer of Code project. So you will be able to design and also test the decoration directly from inside Plasmate. This is also quite some improvement as with C++ the only way to test a decoration is to use it in KWin, which can be quite nasty during development.

The API will need some more love till I’m quite confident to provide it’s usage but there is enough time till 4.10 :-) So I hope that we can provide a better decoration experience in 4.10. I have a few ideas concerning the usage of QML based decorations in KWin and are looking forward to experiment with them.

Discuss this article in our forums, IRC channel, or email the author. You can also follow our content via RSS and on social networks like Facebook, Identi.ca, and Twitter (@Phoronix and @MichaelLarabel). Subscribe to Phoronix Premium to view our content without advertisements, view entire articles on a single page, and experience other benefits.
Latest Hardware Reviews
  1. Sumo Lounge Emperor
  2. Gallium3D Continues Improving OpenGL For Older Radeon GPUs
  3. 15-Way Open vs. Closed Source NVIDIA/AMD Linux GPU Comparison
  4. Nouveau vs. NVIDIA Linux Comparison Shows Shortcomings
Latest Software Articles
  1. GCC 4.8.0 vs. LLVM Clang 3.3 Compiler Performance
  2. Intel Linux OpenGL Driver Leading Over Apple OS X
  3. The Cost Of Ubuntu Disk Encryption
  4. Btrfs vs. EXT4 vs. XFS vs. F2FS On Linux 3.10
Latest Linux News
  1. Unity 8, Mir Made Progress This Week On Features
  2. LLVM Clang 3.3 RC2 Is Ready For Testing
  3. AMD RadeonSI Gallium3D Begins Simple CL Demos
  4. Intel Shows Off GNOME3-Based Tizen Shell
  5. Linux Desktop Security Could Be A Whole Lot Better
  6. KDE 4.11 Will Be The Last Major KDE4 Workspaces Feature Release
  7. New NVIDIA Linux Driver Supports The GeForce GTX 780
  8. Chrome 28 To Offer More Speed Improvements
  9. Digia Announces "Boot To Qt" Project
  10. X.Org Libraries Hit By Round Of Security Issues
  11. Wayland's Weston Gets Output Scaling Support
Latest Forum Talk
  1. GCC 4.8.0 vs. LLVM Clang 3.3 Compiler Performance
  2. AMD RadeonSI Gallium3D Begins Simple CL Demos
  3. Sun x4500 firmware
  4. KDE 4.11 Will Be The Last Major KDE4 Workspaces...
  5. Could the forum help improve the quality of...
  6. Linux Desktop Security Could Be A Whole Lot Better
  1. Computers
  2. Display Drivers
  3. Graphics Cards
  4. Motherboards
  5. Peripherals
  6. Processors
  7. Software
  8. Operating Systems
  9. All Articles
  1. Linux Benchmarking
  2. OpenBenchmarking.org
  3. Phoronix Test Suite