Obconf (Openbox Config Tool) is ported to Qt

Since we’re using Openbox as our default window manager, we need a GUI way to configure it. Previously, we have a GUI config tool for OpenBox named obconf, which is based on gtk+ 2 and libglade. However, since we plan to use Qt, and gtk+ 2 is no longer officially supported by its upstream, a Qt port is wanted.
Hence, as part of LXDE-Qt project, I started a Qt port of obconf and that’s obconf-qt.
It’s a pure Qt program so it works as well outside LXDE-Qt. It’s also useful for the upcoming razor-qt 0.6.

Please test the source code in git:
> git clone git://----escape_autolink_uri:5acf69934b3dbf516eae5a6e8c914e7f----

Or, browse the code online:
http://lxde.git.sourceforge.net/git/gitweb.cgi?p=lxde/obconf-qt;a=summary

Most of the original features are already been ported to Qt.
What still does not work:
1. font settings.
2. dock settings.
3. preview of themes
Other stuff should work as expected.

If anyone is willing to help, please contact me.
Thank you.

“The future of Razor and LXDE-Qt”

Jerome Leclanche from the Razor-qt project posted to the LXDE and Razor-qt mailing lists yesterday about the future of the Razor project and the LXDE Qt subproject.

“…we have decided that the best course of action for both projects is to focus on a single desktop environment, instead of two.
There have been talks of ‘merging’ ever since LXDE-Qt was announced. Having taken the decision to collaborate, we’ve all had the pleasure of working together already.
Our plan is to cherry-pick the best parts of Razor and LXDE and include or port those to LXDE-Qt. Other components will be ported straight from GTK code or rewritten from scratch. In the end, we want to offer the best possible experience while reusing as much code as possible.”

In the coming weeks, our two teams will coordinate LXDE-Qt’s first release and Razor-qt’s official final release. The GTK version of LXDE will still be worked on and kept up to date with any improvement to the Qt version for the forseeable future.

In the longer term, most Razor-qt components will fully be integrated into the LXDE-Qt and both teams will focus on the same project. Looking further ahead, the GTK version of LXDE will be dropped and all efforts will be focused on the Qt port. We, the main developers and administrators of the projects, will try to figure out where we align and where we have differences to grind out.

See the complete posting at the mail archive for either Razor Qt or LXDE-list.

Bringing these two fine projects together will require help and we invite developers, translators and early adopters to join the effort at lxde-list@lists.sourceforge.net.

PCManFM 1.1.1 and libfm 1.1.1

Nine months and a bunch of bug fixes to the stable branch of PCManFM+libfm. We’re also adding a bunch of translations on top of that (not included in the changelog below).

Download
pcmanfm-1.1.1.tar.gz, sha1: e125124b8d22f90800c3ba020f59cada0b728154
libfm-1.1.1.tar.gz, sha1: 2b20675b68cdd820ff6dbec960816bbaffc449b9

Changelog for PCManFM

* 9574948 – Fix format warning (%lld should get long long int instead of gint64).
* e81cdc1 – Set wrap_license in About dialog to False, it’s wrapped oddly otherwise.
* 8026681 – man page: minus signs should be escaped in groff text.
* fe743d7 – Copyright update in About dialog: it should show 2013, not 2012.
* b926a11 – Fix ‘make check’: add autogenerated files into POTFILES.skip list.
* 6b07135 – Improve debug on fm_tab_page_destroy() to diagnose #3614500.
* 6e88042 – Remove unused ‘wp_modes’ from pref.glade (it is used in desktop-pref.glade).
* 326e424 – [#3590050]Handle busy cursor on page opening and closing correctly.
* 56c9b2b – [#3533841]Fix: files on the desktop open on hover.
* 9ebdfed – [#3600900]Fix build with automake 1.13.
* 608070c – [#3600913]Remove obsolete automake macro AM_PROG_CC_STDC.
* 84d832b – [#3613685]The “drag-drop” handler should use fm_dnd_dest_find_target().
* fc33db1 – [#3598807]Return of fm_key_file_get_int() should be checked.
* f17ed8c – Add workaround for tab too small with GTK3. – Add workaround for pcmanfm –help showing garbage message.
* 3c3e621 – [#3591767]Don’t hilight desktop item if we cannot drop on it.
* b0f0cf4 – [#3602662]Fix for SIGSEGV on middle-click.
* ca5630e – Desktop items layout haven’t respected reserved space on monitor.
* 26dcbab – [#3589448]Folder view grabs focus only once.
* 3f7cadb – Hotkeys for sort modes and for New Empty File
* f1902e6 – [#3585895]Fix for SIGSEGV in get_nearest_item() with focus=NULL.
* 05357d4 – Revert “Hotkeys for sort modes and for New Empty File”
* daf7118 – Hotkeys for sort modes and for New Empty File
* 1238e8d – Display full path in tab tooltip
* 119e525 – [#3582257]“Open entered folder” button do nothing
* 876740e – Manual page update: desktop management and missing –wallpaper-mode option.
* f53d9b1 – [#3586151]‘Open in …’ actions should be available only for directories.

Changelog for libfm

* ff1e040 – Increase ABI revision to 2 before release (now ABI code is 4:2:1)
* a884433 – Fix for SIGSEGV in fm_file_info_set_from_gfileinfo() for empty display name.
* bbe97fa – Make fm_init() idempotent, it should be more safe that way.
* cf55932 – fm_init() should call g_type_init() since application may don’t call it.
* ca6f02f – Fix for Gtk-Critical on accel_group on window destroy.
* 98bcc3c – [#3614507]Fix: recursive copying should copy symlinks as symlinks.
* b7e7248 – Eliminate memory leak in fm_file_menu_new_for_files().
* 023a117 – Fix race condition on GMutex allocation in fm_run_in_default_main_context().
* e6ad58c – [#3614473]If permission value wasn’t set then don’t update it.
* 63ff747 – [#3599638]Not escape chars such as ‘[' from path bar when make an URI.
* b8dafba - Keybindings Shift+Insert and Ctrl+Insert are swapped out.
* 169491a - [#3589641]scripts are ran from $HOME instead of current dir.
* 0f7f9ce – [#3613685]FmDndDest “drag-drop” handler should use fm_dnd_dest_find_target().
* bdac966 – [#3613305]Unescape file names on copy from virtual to native FS.
* 9de8c02 – Fix over previous commit.
* 04cd938 – Eliminate assertion on adding a column while FmFolderModel wasn’t initialized.
* 415d247 – [#3606577]Error window should be above others or else it may be invisible.
* 65e83dd – [#3591771]Adding file to folder right after deletion shouldn’t be missed.
* 552d91d – [#3590304]Fallback themed icon “folder-video” to “folder” not to gnome.
* 01c1de2 – Fix over previous commit: it leaded to crash.
* 7d31d56 – Fix: after changing the folder selection isn’t reset
* 0beaa48 – [#3589259]Fix for dropping files onto Trash in Places sidebar.
* 70ff12a – Change FM_CONFIG_DEFAULT_NO_USB_TRASH to more expecting TRUE.
* e1029d5 – Fix: disabled name cannot be copied to clipboard, make it unfocusable instead.
* 7b83548 – Fix: file owner/group should be properly disabled in dialog.
* 3cea23d – Adding tooltips for file name and location in file properties.
* a105732 – Disabling input for file name in properties dialog window.
* afbe7e2 – [#3587571]Ctrl+A should select all depending on focus.
* 9242089 – Fix for localizations of Detailed List View headers.
* 690e15b – smb:// symlinked locations cannot be launched from folder view.
* 40aa4a6 – [#3584798]We shouldn’t disable DnD on non-native targets completely.
* 195e18e – Another fix for possible SIGSEGV in src/base/fm-path.c.
* 19801e7 – [#3586178]Comparison is wrong (bug #6421 in libexo).
* 83f0300 – [#3586178]gtk3 css strings have significantly different syntax from gtk2 rc strings
* 80c568c – [#3586178]doc build wasn’t updated for ‘–with-gtk=3′ case
* ea6d673 – [#3582493]Fixing test-fm-path two tests.
* 86717c4 – [#3582493]Fix for SIGSEGV in fm_path_new_child() with parent=NULL.
* e098be3 – [#3584608]Fix for rarely broken DnD due to FmDndDest source caching.
* 74901d7 – [#3582816]If no region is selected in editable then apply ‘Delete’ to char next to cursor.
* 224d382 – [#3583229]Fix for broken DnD in ExoTreeView.

menu-cache 0.5.0 released

The backend library to read freedesktop.org application menu files has been released with four major changes.

  • Added a possibility to include NoDisplay files into cache file. This can be achieved by adding suffix ‘+hidden’ to requested name in call to menu_cache_lookup(). The hidden items will be returned along with visible ones by any API that returns listing of cache directory. The menu_cache_app_get_is_visible() API will return FALSE for hidden item with any DE mask passed to the API.
  • New macro MENU_CACHE_CHECK_VERSION() to test version of library.
  • Added new APIs: menu_cache_find_item_by_id, menu_cache_find_child_by_id, menu_cache_find_child_by_name.
  • Two bugfixes for crashes, and for some another bugs.

menu-cache-0.5.0.tar.gz, sha1sum: 0f107e62f50f0ea37b9d984ddd7e2ef042ce64c1

changelog

d643bd1 – Remove unused code (enclosed into #if 0 … #endif)
a4ea086 – Remove dependency of menu-cache-gen on libmenu-cache from Makefile.
45731ed – Remove incorrect logic of monitoring in menu-cached.
44f9914 – Speed up menu-cached, not delay reload if there was none in last 3 seconds.
210e1ae – Fix over previous commit, it had incorrect test for file existance.
4320ad6 – Ignore not-existant files from menu-cache-gen.
70156ce – Enable a debug message on file monitor activity.
b9917d3 – New APIs menu_cache_find_child_by_id() and menu_cache_find_child_by_name().
76d3ce8 – Fix incorrect debug format message (%d should get int instead of gsize).
5322cd7 – Don’t call g_type_init() with glib>=2.36 (it’s marked deprecated).
080c3f9 – The menu_cache_item_from_path() returned wrong item.
fd7a65f – ‘show hidden’ mode (+hidden) should enable empty directories too.
1d7c627 – Fix compilation with automake 1.13
c767802 – debian: new package libmenu-cache-bin: binaries should not come with library.
13bf998 – Use pkglibexecdir instead of libexecdir to install binaries.
5deaa82 – Developers’ documentation update.
b73770d – menu_cache_item_unref() should return FALSE.
ab61990 – Fix on SIGSEGV in menu_cache_item_from_path() on strcmp.
801cc89 – New API menu_cache_find_item_by_id() to do fast cache scan for id.
25d1656 – Replaced g_return_val_if_fail() with if().
7c2aa7a – Remove extra g_io_channel_unref() on termination.
4287e58 – Update for NEWS file.
6563ccd – New macro MENU_CACHE_CHECK_VERSION() to test library version.
5902579 – Fix segfault
1a48be7 – Use setsid() in menu-cached to complete daemonize.
6cd7839 – Eliminate secondary main loop in libmenu-cache.
6bb4960 – Adding possibility to include NoDisplay files into cache file.
1b3fd7a – debian: Add breaks/conflicts for libmenu-cache1-dev to make the upgarde nicer
c85e46c – debian: also remove .a files
67bdf10 – Adding libmenu-cache-dbg package.
fdd3e0f – Adding suggestion on libmenu-cache-doc package from libmenu-cache-dev.
4f8dd2b – Adding libmenu-cache-doc package.
53ff37e – Renaming libmenu-cache1-dev into proper unversioned package.
c374e0c – debian: Use autogen.sh instead of the dh sequence

No, LXDE-Qt is not bloated

After posting a preview screenshot for LXDE-Qt, I got quite a lot of feedback from various sources. Generally the responses from the users are positive, but there are also some people saying that LXDE is no longer lightweight.

Please, in the free world we’re all friends and let’s not spread FUDs to hurt each other. I’m not going to respond to groundless accuse or get involved in toolkit wars. Just see the screenshot.

This screenshot is done for a cleanly installed Debian testing system running LXDE-Qt after a cold boot. The Qt theme engine used is “CleanLook”.

The command “free -h” shows that 252 MB is in use. However, most of the space is used for buffers and caches. After excluding caches and buffers, the memory usage is 91 MB. On the same machine, LXDE gtk+ version uses 86 MB. Will you call this “bloated”? Please note that I open “lxterminal”, a GTK+ 2 terminal emulator, to execute the “free” command. That means doing this also loads GTK+ so the actual memory usage should be lower than this. Besides, I’m using zh_TW locale since I’m from Taiwan and we use traditional Chinese here. That means, I also have Chinese fonts and input methods loaded in the memory. If you’re a western user, you probably don’t need them and can save a little bit here.

By default, similar setting under Ubuntu will use around 200 MB of RAM.  That’s caused by differences between distros, not the bloat of LXDE. So, please stop spreading unfounded FUDs. Qt is designed for use with embedded systems and cell phones. How fat and resource hungry can it be? It’s the way you use it that really matters.

Delivering a good lightweight desktop is always our goal no matter what approach we’re using. So stay tunned and be confident.

LXDE-Qt Preview

Many users have read about our recent Qt-related work in prior blog posts.
The GTK+ version of LXDE is still under development, but we did some experiments with Qt, too. Now I have some things to show you. :-)
Here is a preview screenshot for LXDE-Qt.

At the bottom of the screen is lxpanel-qt, the Qt port of lxpanel. Now it basically works, but it’s still rough and needs much polishing. Besides, there are no GUI configuration tools for it yet. Editing the xml config file manually is needed. Later there will be preferences dialogs as the old gtk+ version of lxpanel. Most of the major applets already work. However, don’t expect too much!
It’s still a work in progress and it can be better in the future.

In the middle of the screen is PCManFM-Qt, the Qt port of the PCManFM file manager. It looks very similar to the original gtk+ version. The desktop wallpaper and icons are also managed by PCManFM-Qt, just like what the gtk+ version does.
The memory usage of PCManFM-Qt is slightly higher than that of the gtk+ 2 version, but the difference is not very significant. The overall performance is similar to the original gtk+ 2 version. Now it has most of the features of the original one and is almost ready for daily use. \o/

On the right side of the screen is the new Qt-based image view, LxImage-Qt.
It’s not really a port of the original gtk+ GPicView. I regard it the successor of GPicView in the Qt world. It works better than GPicView and is as fast.

Most of the work demonstrated in the screenshot is still in our git repository and is not ready for a new stable release, but there is really much progress and LXDE-Qt is no more a plan or a concept. It’s a real project that gradually shapes.

OK, back to what most user will concern, the resource usage.
To be honest, migrating to Qt will cause mild elevation of memory usage compared to the old Gtk+ 2 version. Don’t jump to the conclusion too soon. Migrating to gtk+ 3 also causes similar increase of resource usage.
Since gtk+ 2 is no longer supported by its developer and is now being deprecated, porting to Qt is not a bad idea at the moment.
Besides, the slightly higher memory usage is still acceptable for most of the existing old machines. The real resource usage may differ a lot among different Linux distros. For example, Ubuntu-based distros running LXDE tends to use more memory than ArchLinux-based ones. So more testing and real benchmarks are needed before making a conclusion on this.

Anyway, glad to share with you what we already done. Hope that you like it. :-)
Long live LXDE!

Edited on 2013-07-04
Answer the questions in the comments of this blog entry:

  1. Cooperation with razor-qt is going on. We subscribed razor-qt google groups and discussed about possible cooperation earlier. Currently, the ported LXDE components are designed with Razor-Qt in mind. For example, PCManFM-Qt and LxImage-Qt will reads razor-qt config file when running in razor-qt session. We’ll try to keep the interchangeability between the two DEs. Further integration is also possible. Actually, I personally am running a mixed desktop with LXDE-Qt + Razor-Qt components on my laptop. Components from the both DE blends well.
  2. The version of Qt supported now is Qt 4. I’m going to skip Qt 5 and wait for Qt 5.1. Qt4 and Qt5 are compatible in many areas and porting to Qt5 should be easy in most of the cases. Unfortunately, this is not the case when you use X11-related stuff. Qt 5 removed many X11-related APIs and there are no direct equivalent methods. So the porting is not painless for desktop environments. In addition, some freedesktop.org specs are designed to work with X11 only, such as the EWMH/NETWM spec and Xsettings spec. To port to Wayland, these problems need to be solved first. Gnome and KDE guys will fix them so we can just wait. Then why Qt 5.1? Because Qt 5.1 added back the once-removed X11-related APIs. So porting from Qt 4 to Qt 5.1 should be the most smooth path. It takes time for distros to adopt Qt 5.1, though.

Please use PCManFM-Qt git version for now.

As many people know, a Qt port of PCManFM is under heavy development. Although we released PCManFM-Qt 0.1 previously, it contains some bugs and memory leaks. Most of the issues are already solved in the latest source code in our online git repository and will be available in the next release. However, the new code depends on the latest libfm 1.2, which is not released yet. Due to the small delay of libfm release, the new release for PCManFM-Qt cannot be made at the moment. Brave users who cannot wait for the final release are encouraged to try the latest git version of libfm and PCManFM-Qt to get the latest features and fixes.

Here is a short list of what’s in the latest git version (and will be in the next release):

  1. Fix several important memory leaks in version 0.1
  2. Some optimizations for memory usage and speed are done
  3. Full thumbnail support (can show thumbnails for image files and other formats with external thumbnailer installed)
  4. Extract thumbnails from EXIF data of jpeg files (via libfm 1.2)
  5. Optimize column widths of detailed list view automatically
  6. Correctly handle desktop icons when a work area is set
  7. Detects icon theme automatically according to current desktop environment. No need to set an icon theme manually in LXDE, XFCE, Gnome, and Razor-Qt.
  8. Some other small bug fixse

The current code of PCManFM-Qt in the git repo is nearly ready for daily use. The memory usage and overall performance are acceptable, too. When Andriy finishes libfm 1.2 and makes a new release, I’ll make one for PCManFM-Qt at the same time. Before that, users are encouraged to try the git version.

PCManFM-Qt:

> git clone git://pcmanfm.git.sourceforge.net/gitroot/pcmanfm/pcmanfm-qt

For compiling the latest code in git, you also need the git version of libfm and menu-cache:
> git clone git://pcmanfm.git.sourceforge.net/gitroot/pcmanfm/libfm
> git clone git://pcmanfm.git.sourceforge.net/gitroot/lxde/menu-cache

Have fun!

A Guide for Migrating from Gtk+ to Qt

Since I started learning Qt recently, I noted some issues when trying to port Gtk+ programs to Qt. There are tons of tutorials for Gtk+ and Qt, but a guide for porting is lacking. Most of the articles comparing Gtk+ and Qt did not go into detailed issues people will encounter during coding.
To help people porting their Gtk+ programs to Qt, I just started a wiki page documenting what I’ve learned so far.
Currently it provides a long table listing equivalent Qt classes for
commonly used GtkWidget classes. Since I cannot find a similar list with Google, I built one. This is useless for experts, but it’s very handy and helpful for Qt beginners who already know Gtk+. The mapping between Gtk+ and Qt classes is not yet finished, but I’ll try to make it complete soon.
I also documented things you need to know to safely mix glib/gio/GObject code with Qt. Later I’ll add docs describing how the translation systems differ.
I hope that developers interested in this topic can help edit the wiki
page to make it more complete and free from errors. It’s still a work in progress but I hope it helps someone as more and more people are using Qt and some more LXDE components *might* get Qt ports later. BTW, since Ubuntu guys is moving toward Qt, this also helps them.
Cheers!

PCManFM Qt 0.1.0 released

Hello world,
I just released PCManFM Qt file manager 0.1.0, the first Qt port of PCManFM.
The tarball is available for download from our project page.
You’ll need libfm to build it (which is included in many distros).
P.S. When running the program for the first time, please choose an icon theme from the [Edit] / [Preferences] menu. Otherwise you’ll get no file icons.
If you install the program into /usr/local, don’t forget to run “ldconfig” after installation, or libfm-qt won’t be correctly loaded by the loader.
This release contains no thumbnail support yet.
However a fully working thumbnail support is already in the git.
Because this requires some changes to the upstream libfm library,
it’s scheduled for the next release and not make public at the moment.
To turn on the desktop icon management feature, run with the command:
> pcmanfm-qt –desktop
>
Generally it’s a good idea to add this command to your session startup script.
To turn the desktop icon manager off again, do this:
> pcmanfm-qt –desktop-off
>
If you don’t want to use the desktop icons, you can still add the
command to your session startup script:
> pcmanfm-qt –daemon
>
In this way, it will becomes a background daemon. Every time you need
to open a folder with pcmanfm-qt, it can be shown “immediately”.
BTW, please don’t mail me and ask if PCManFM will shift to Qt.
The Gtk+ and Qt versions will coexist.
There will still be new releases for the Gtk+ version in the future.
The Qt port is only an alternative, not a replacement.
Thank you!
I, however, need to admit that working with Qt/C++ is much more pleasant and productive than messing with C/GObject/GTK+.
Since GTK+ 3 breaks backward compatibility a lot and it becomes more memory hungry and slower, I don’t see much advantage of GTK+ now. GTK+ 2 is lighter, but it’s no longer true for GTK+ 3. Ironically, fixing all of the broken compatibility is even harder than porting to Qt in some cases (PCManFM IMO is one of them).
So If someone is starting a whole new project and is thinking about what GUI toolkit to use, personally I might recommend Qt if you’re not targeting Gnome 3.
Update 2013-03-27:
I got some feedback about the toolkit choice above. Don’t get me wrong. I’m not saying that gtk+ is bad and did not intend to start a toolkit flame war. If you’re going to use python, C#, or other scripting language, gtk+ is still a good choice due to its mature language bindings.
Vala  is attractive initially, but after trying it in real development, you’ll see the shortcomings of this approach. Because it sometimes generates incorrect C code that still compiles, we got some really hard-to-find bugs. So we need to examine the generated C code to make sure it does things right. This takes much more time than just writing plain C code myself. Besides, the generated C code is not quite human-readable and debugging becomes a problem. Another issue that’ll hit you is the problems in the library bindings. Though there exists many vala bindings for various C library, their quality is uncertain. Finally, debugging, examing, and fixing the bindings all the time takes even more time and offsets the time saved by using Vala.
To sum up, for compiled binary programs, Qt IMHO is a good choice to consider if you don’t hate C++.

PCManFM Qt port is 85% finished now!

A picture is worth a thousands words so again let’s see the screenshot first.

PCManFM Qt with desktop manager turned on

This is the Qt port of PCManFM with desktop management feature turned on. The desktop icons and the wallpaper were painted by PCManFM-Qt, just like the gtk+ version of the original PCManFM. The new Qt port is in a pretty good shape now.
Although it’s not yet ready for production use, it’s almost there. About 85% of the planned features are finished.

What already works:
  1. Nearly all folder browsing features
  2. Change icon theme
  3. Preferences dialog (most options work)
  4. Load/save settings
  5. Single instance + dbus service
  6. Command line options
  7. Desktop icon manager: enable with “pcmanfm-qt –desktop”. You can add “pcmanfm-qt –desktop” to the startup script of your desktop environment/window manager.
  8. Change wallpapers via “Desktop Preferences” dialog
  9. Mount remote filesystems and removable devices (requires gvfs)
  10. Split into pcmanfm-qt and libfm-qt library.
  11. Install libfm-qt header files to /usr/includ/libfm-qt along with a pkgconfig file, so later libfm-qt can be used in other Qt programs
  12. Most file operations, move/copy/symlink/trash/rename, change file attributes in the file properties dialog.
  13. Basic drag and drop support (very basic)

Things which do not work or are still work in progress:

  1. Create new folders/files
  2. Edit bookmarks
  3. Auto-mount/auto-run for removable devices
  4. No thumbnail support yet. (This may require some changes of the upstream libfm library)
  5. No ABI version (libtool soname not set yet)
  6. No translations yet (Qt Linguist and the *.ts files are hard to work with and lack features I need, I consider using GNU gettext instead)
Also noted that the git repository is now moved to:
The original libfm-qt repo will be removed later.
The binary program pcmanfm-qt and the library libfm-qt.so are bundled in the same package.
Please help test and give some comments.
If anyone is interested in helping the development, patches are welcomed.
Thank you!