It has always been rumored that Qt is bloated so programs written in Qt should be bloated. Some even argued that the LXDE developers made a wrong decision on the migration to LXQt.
Why not replace the assumptions with some experiments?
In fact, LXQt 0.11 even uses slightly less memory than XFCE (with gtk+ 2). After cold boot, LXQt uses 112 MB in the testing environment.
This is the testing setup:
- Debian testing: Clean install in Virtualbox 5.1.6 (2016-10-02)
- CPU: 2-core
- RAM: 512 MB
- Resolution: 1024 x 768
- Desktop environments: LXQt 0.11, XFCE: 4.12.3, Cinnamon 3, Gnome 3.20
- Cold boot 1: After cold boot, I opened the application menu to make the icons loaded. Then, open an “xterm” window and get the result of `free -mh` command.
- Cold boot 2: same as 1, but it’s tested after installing Cinnamon and Gnome3, which bring some additional system services, so the memory usage after boot increased for all DEs.
- Open default FM: After cold boot, open the default file manager to browse the home directory. (For openbox, which brings no file manager, the gtk2 version of pcmanfm is used)
The memory usage of LXQt is quite similar to the original LXDE (gtk2) while many new features are added. Actually I used LXQt on my Raspberry Pi instead and it works flawlessly. It’s a pity that Rasbian does not ship with LXQt by default. 🙁
Next time, if others tell you Qt is bloated, and LXQt is not lightweight anymore, just direct them to this post.
To see is to believe:
There has long been needs for a simple Qt frontend for pulseaudio-based audio mixer. So I ported the gtk+ version pavucontrol program to Qt5 for use in LXQt. Here is a screenshot.
The source code is here. https://github.com/lxde/pavucontrol-qt
Since the original source code of pavucontrol is written in C++, it becomes trivial to port it to Qt. The whole porting process took me two days only. Porting programs from gtk+ 3 to Qt 5 is not really that difficult as long as you know how to do it. You see the proof. 🙂
A lot of time passed since the first stable release and a lot of issues found in it. Be them small or not, they’ve got their fixes so new release was waited a lot, and it finally happens. Thank you everyone for your patience and bugs reported!
A release tarball download link:
menu-cache-1.0.1.tar.xz – SHA1: 58862c665f2ae56870a9937cdcd643674b2ac8ba
Changes since release 1.0.0 (see git log for details):
- Fixed crash on generating menu with both tags <DefaultAppDirs/> and <KDELegacyDirs/> present.
- Fixed crash when menu-cache-gen ran manually without CACHE_GEN_VERSION.
- Fixed crash in menu-cache-gen on <Filename> in menu layout with <OnlyUnallocated/> tag present.
- Fixed incorrect processing of <Merge type=”files”> in menu-cache-gen.
- Added safeguards against environment variables containing newlines.
- Fixed case when cache was not updated while it should, it was claimed to be fixed in 1.0.0 but apparently fix was incomplete.
- Fixed ignored <Filename> tags inside of <Layout>.
- Fixed memory corruption in scanning <LegacyDir> addressed directory.
After some bugs gathered and fixed, the bugfix release of LXPanel got its time to happen. So 0.8.1 now. In addition to 17 complete translations in 0.8.0, it now also completely translated to Japanese and Polish languages. The most probably it’s the fisrt and the last in 0.8.x series, time to do some development is around, you can wait for new awesome features, of course.
New release tarball download link:
Changes since previous release 0.8.0 (see git log for details):
- Improved OSS headers detection a bit.
- Fixed expand setting on plugins with default_expand when more than one is available on the same panel.
- Fixed icon for task button that retrieved using WM_HINTS.
- Fixed wrong PanelIconGrid arrangement in vertical panel orientation.
- Fixed missing handlers disconnect when destroying Task structure.
- Removed writing debug messages to file when ‘indicator’ plugin is in use – it will write all the debug there and that changes the behavior which was not intended really.
- Corrected background for ‘indicator’ plugin.
- Fixed update ‘indicator’ plugin on configuration changes.
- Fixed battery status: if discharge rate is 0 then it’s charged.
- Fixed incorrect cycle in netproc_devicelist_clear() leading to crash on resume (after suspend).
- Fixed scanning for temperature sensors which failed with some kernels.
- Changed reconfiguring panel behavior: callbacks to plugins will be sent on idle, not immediately to avoid “stuck” spin button (and eventually even crash was possible).
- Fixed initial icon on ‘volumealsa’ plugin to show real state instead of muted.
- Fixed ‘dclock’ updating that it will show time on start, not just on next second change. It would create impression it’s slow otherwise.
- Fixed wrong task button activation on not processed drag of button.
Since the release of LXQt 0.9 several days ago, many people are curious about its memory usage since in the release announcement we mentioned the use of two libraries from KDE framework 5. Don’t worry! They are just “pure Qt libraries” without other KDE dependencies (Thank you KDE guys!). Good engineers always base their design desicions on careful analysis, experiments, and measurements, not politics. If a library works pretty well, it does not really matter where it comes from or it belongs to which camp. If it’s free software and it’s suitable for our need, I’d say “use it”. Here are some numbers of memory usage after cold boot.
- Debian testing (32 bit)
- LXQt 0.9, Qt 5.3, and KF5 packages are taken from Siduction
- Running in Virtualbox 4.3.20
- RAM: 512 MB
- CPU core: 1
- Screen resolution: 1024×768
- Measurement: Open xterm, and type `free -mh` (cache and buffer are excluded)
Memory usage after cold boot:
- LXQt 0.9: 118 MiB
- LXDE: 98 MiB
- XFCE: 107 MiB
- plain Openbox (without running any apps): 70 MiB
Well, for those who still remembered my previous report, the memory usage increased. But wait! All of the DEs, including Openbox, have the same degree of growth in memory usage. So it’s more possibly caused by the upgrade of the system itself. If you see the difference between plain openbox and LXQt, we only added 38 MiB (LXQt 0.8 added 37 MiB). Given that we migrated to Qt5 and added new features, both of which should normally increase memory usage, the current results are reasonable. Seriously, there are still room for more optimizations but we need some time to finish them.
LXQt aims to be a “modern” desktop with some “classic” designs which does not get in your way. We’re not going to clone KDE. Besides, don’t worry about resource usage. That’s the challange for developers and we’ll fight for it. 🙂
As we’re going to have a new release for LXQt 0.9, I’d like to provide some performance tips for users and packagers.
- Consider compiling lxqt-panel and lxqt-runner with menu-cache support whenever possible:
Menu-cache is a mechanism to cache the generated freedesktop.org application menu so we don’t need to parse hundreds of files everytime. Though you can compile lxqt-panel and lxqt-runner without it and things still work, these two components will generally load faster if you use menu-cache.
- Compile libfm with libexif:
Libfm if the core library of PCManFM file manager. When compiled with libexif support, it can extract the thumbnails created by the cameras which are often embedded in jpeg files. So we can avoid loading the photo and generate the thumbnail ourselves. With libexif, loading folders with many photos will be faster.
- Try to “prelink” your system:
When you launch a program, your system will load it alone with the libraries it requires. Then, dynamic linking will be performed to make these libraries work together. The process could take seconds in some cases and affect the speed of program startup. By using “prelink”, part of the linking/relocation process can be done once and cached; then in the future the dynamic linking becomes faster. It’s tool worth trying if your desktop takes quite a long time to login.
- Avoid GTK+ theme:
Qt developers did a great job and provided a “GTK+” style for theming the Qt programs so they can look like GTK+/Gnome programs when running in Gnome. The magic behind this is simple. Your Qt style engine loads GTK+ 2 and creates fake Gtk UI elements. Then, copy the images painted by GTK+ to your Qt widgets. By using this, you have both Qt and GTK+ 2 theme engines loaded for every Qt program. Not really a big deal since the operations are still fast enough, but if you don’t need a GTK+ theme, don’t use it. Try “fusion” for Qt5 or “Cleanlook” for Qt 4.
- Some notes about gvfs:
Removing gvfs won’t make your file manager faster. PCManFM-Qt does not use it for most of the local file operations. So it’s safe to keep it around since it does not slow down things. We used “gvfs” from Gnome internally for trash can, volume management, and mounting various network filesystems. Yes, the UI is in Qt and its core uses few Gnome stuff. Don’t hate gvfs just because there’s a “g” in its name. It’s a quite good VFS implementation which does not have Gnome dependencies. So don’t remove it just because its name contains a “g”. It provides you some good features, including mounting sftp filesystems or accessing Android mtp devices if you have proper plugins installed.
Generally speaking, it might be a good idea for packagers to add “gvfs” to the dependencies or package suggestion list of pcmanfm-qt.
- Avoid Qt 5.4.0 if possible:
We encountered several weird regression bugs of Qt 5.4 while debugging LXQt. It breaks drag and drop crossing different programs. With Qt 5.4, you cannot drag a file from my file manager to other programs, but it’s not my fault. 🙂
(The bug will be fixed in Qt 5.4.1, which is not yet released.)
We’re going to release LXQt 0.9 very soon!
Hope these tips help. Cheers!
As already was announced, the time to release next LXPanel has came. The release goals for 0.8 were:
- complete multi-monitor support
- improve and further simplify plugins API
It also happen to have better performance than before, that was a side effect of optimizations. The release 0.8.0 comes fully translated to 17 languages: Chinese (China), Dutch, Finnish, French, Galician, Ganda, German, Greek, Icelandic, Indonesian, Italian, Portuguese, Russian, Spanish, Swedish, Turkish, Ukrainian. As usual, a lot of bugs were fixed, and you are welcome to report any bugs you happen to find yet. Work on LXPanel features will be continued shortly, stay in touch, it will become yet more convenient later. 🙂
New release tarball download link:
lxpanel-0.8.0.tar.xz – SHA1: c0b2d9edfd0d95ee142db7cd0e55763a785daa0a
Changes since previous release 0.7.2 (see git log for details):
- Added workaround for crash in gtk-run with old libmenu-cache.
- Core functions are separated into a private library to allow reliable linking of modules using -Wl,-z,defs.
- Added macro LXPANEL_CHECK_VERSION() for third party pluguns API check.
- Added CONF_TYPE_EXTERNAL support for lxpanel_generic_config_dlg().
- Implemented property “aspect-width” for PanelIconGrid to allow using non-square tray sockets.
- Added support for monitors “All” to span panel over all monitors (i.e. to allow pre-0.6.0 behavior).
- Implemented monitors hotplug support.
- Fixed popups positioning in multi-monitor environment.
- Fixed updating panel size if appropriate monitor changed its size or position.
- Implemented disabling for “Reserve space” button if another monitor lies beyond the edge so reservation will cover it. Also reservation will not be applied in such cases even if set in config manually.
- Some edge and monitors selections in panel configuration dialog may be insensitive now if appropriate edge and monitor combination is not available, to avoid panels stacking one over another.
- Fixed bug with hidden panel disappearing after resolution change.
- Add lxpanel_image_new_for_icon() API to replace another (obsolete) API _gtk_image_new_from_file_scaled().
- Added API panel_config_hotkey_button_new() to use as CONF_TYPE_EXTERNAL widget to allow configure global hotkeys for plugins functions.
- Added API lxpanel_apply_hotkey() as a convenient libkeybinder interface to use in modules that also use panel_config_hotkey_button_new(). Now LXPanel requires libkeybinder too.
- Added API panel_config_click_button_new() to configure mouse gestures and panel_config_click_parse() to parse its output.
- Added “icon-size-changed” signal to LXPanel which is emitted when icons size in configuration dialog was changed.
- Improved lxpanel_image_new_for_icon() API to follow panel icons size changes, not only theme changes. This way calls on lxpanel_image_* APIs on theme or panel changes may be eliminated, i.e. code becomes simpler.
- Added new lxpanel_image_change_icon() API for simplification reasons so other lxpanel_image_* APIs can be replaced completely.
- APIs lxpanel_button_set_icon() lxpanel_button_update_icon() now don’t require setting icon size since created button already follows size from panel settings. Also it doesn’t require refresh after the panel configuration change.
- Optionally scaling up small icons in the taskbar may be disabled: scaled up icons may look bad due to pixelization (patch from Anton Lobashev).
- When adding new panel, now correctly edges of monitor where popup was are tried before any other monitors.
- Correctly open ‘netstat’ plugin own menu on left-click since right-click should open panel context menu instead.
- System critical temperature level in ‘thermal’ plugin now is properly ignored if manual levels are active.
- Fixed click on ‘menu’ plugin, only image was clickable, not whole area.
- Added API panel_config_int_button_new() for generic plugin config spin button with custom range, not just generic 0…1000.
- Fixed wrong behavior with PanelIconGrid constrained width after child was removed: size wasn’t always renegotiated correctly.
- Fixed range of space reservation in multi-monitor setup (reservation might cover another monitor).
- Numeric-only string will be saved now double-quoted to distinguish it from number in config.
- Implemented flashing on task with urgency in grouped task list menu.
- Disabled flashing on urgency hint if window has focus, most of window managers do the same on window decorations.
- Fixed border of ‘batt’ plugin, it should correctly use panel settings.
Also Size setting on it doesn’t include border width anymore.
- Allowed default alarmCommand on ‘batt’ plugin be translated.
- Implemented sorting plugins in Add plugin window in alphabetic order.
- Fixed font in the weather plugin to use panel settings.
- Added new API lxpanel_button_compose() for future usage by plugins.
- Added optional ‘volumealsa’ plugin volume mapping from alsamixer (patch from Peter).
- Added new API lxpanel_button_set_label() to change label of button that was created using some lxpanel_button_*() API.
- Added “panel-font-changed” signal to LXPanel to be able follow settings change in font configuration of panel using lxpanel_button_*() API.
- Fixed nasty bug with autohidden panel after unhide appeared for short time somewhere at the screen.
- Fixed calendar and configuration windows blinking on their appearance.
- Fixed panel update when background image changed in configuration.
- Changed to use persistent background image for panel and Cairo. This way updating background should be faster, and also fixed background of plugins when image is used, both placement and alpha color.
- Urgent window is now always visible on the taskbar irrelevant of the desktop number on which it appears, because urgent window requires user attention (patch from Andy Balaam).
- Moved bit of code that is used out from src/bg.c and discarded src/bg.c from code used.
- Dropped setting members of Panel structure: workarea, wa_len, bg.
- Replaced GtkComboBoxEntry in ‘netstatus’ plugin window with GtkComboBox.
- Simplified plugins background setting – they should never use any own background but either use one from panel or from theme (depending on panel configuration). This should improve performance.
- Don’t update a whole panel background anymore after some plugin was resized, only update the plugin itself to improve performance.
After next round of bugfixes next version of LXDE session manager finally came to the release time. We all hope it is more stable and bugless now.
New release tarball download link:
lxsession-0.5.2.tar.xz – SHA1: 00d45cccbdd6fb05c46998671a7c12123a0a2179
Changes since previous release 0.5.1 (see git log for details):
- Corrected connect and emit signals for lxsession-db to fix hanging in some cases.
- Fixed duplicate lxpolkit invocation.
- Updated few translations.
- Added some environment variables for LXQt and Qt support.
- Fixed D-Bus string comparison in lxsession-logout.
- Added ESCAPE key to close the lxsession-logout menu.
- Created lock file to prevent more than one logout dialog.
- Using libunique for lxpolkit and lxclipboard, to avoid launching it twice.
- Fixed gtk3 compilation.
- Few small corrections in the Makefile.
After some development, it’s time to release next feature version of LXPanel. The release goals for 0.8 were:
- complete multi-monitor support
- improve and further simplify plugins API
Now that it was done, and numerous bugs fixed along with that, LXPanel has come to release time, which is scheduled in about 2 weeks. We would appreciate all the testing and feedback on it. The fresh sources are in GIT repository, as usual. The changelog since version 0.7.2 is big enough, you can find it in the sources or read online.
I also would like to ask all our translators to come into Pootle and translate it. I would ask to read the Wiki if you didn’t do that lately. Thank you in advance, everyone.
Although people often compare LXDE and the “so-called” Qt port, LXQt with each other, they are actually from different code bases.
The most parts of LXQt are actually built on top of razor-qt, a lightweight Qt-based DE with the same philosophy as LXDE. We reorganized the source code of razor-qt and removed unused pieces. Then we ported several LXDE components to Qt and also developed some new ones. Hence it’s more the merge of developers than the merge of the actual source code. That’s why they have slightly different feature sets. Without the work of razor-qt project, we can’t have LXQt now. Its developers deserved the credit. Since the story is too long for the tiny “About” dialog, I wrote the blog post here to thank their contributions.
Long live free software!