Planet Bluesabre

All the latest from Xfce, Xubuntu, & Friends.

Bountysource update

I quickly wanted to share an update to my previous post our leaving Bountysource behind (at least as platform for individual bug bounties).

Bountysource support has informed us that “All bounties on Xfce issues have been refunded and backers notified.”

If you are a backer of one of our issues registered on Bountysource and haven’t been refunded or at least approached please reach out to Bountysource support! (support@bountysource.com)

Meanwhile others (e.g. the elementary project) have also decided to move on for the same reasons…

elementary-xfce (0.15.1-1) unstable

  • New upstream version 0.15.1.
  • d/control, d/copyright: Update my email address.
  • d/control:
    • Build-Depend on librsvg2-dev.
    • Bump DH compat to 13.

xfce4-eyes-plugin (4.5.1-1) unstable

  • d/watch: Update for upstream’s move to mirrorbit.
  • New upstream version 4.5.1.
  • d/compat, d/control:
    • Drop d/compat in favor of debhelper-compat, bump to 13.
  • d/control, d/copyright: Update my email address, bump years.
  • d/control:
    • Update homepage.
    • Set xfce4-eyes-plugin M-A: same.
    • R³: no.
  • d/rules: Drop dh_autoreconf and dh_clean overrides.
  • d/watch: Use uscan special strings.
  • Update Standards-Version to 4.5.0.

Thunar, GtkAction and a big mess

Overview

My journey into the GtkAction abysses of Thunar began in the mid of 2019. Be warned, it is no story of success. It is rather a story about finding a way through a maze while walking into almost every dead end.

Actually I just wanted to fix #198 (Merge all file-context-menus into one). But somehow things got weird. More than half a year later and after numerous interactive rebases I finally merged my branch into master \o/

Motivation

The old Thunar used to create the same menu items in different places using different code. In the past that led to inconsistencies. E.g. the location bar only provided a very minimal context menu, no custom actions at all.

location button context menu

From time to time I found myself right-clicking on a location-button, just to find out that there still is no custom action. At some point of maximal annoyance I decided to fix that problem … not sure if I would have done so when I knew how long that road would be.

Looking at thunar-location-buttons.c revealed a lot of duplicated code. thunar-standard-view and thunar-window both used the deprecated GtkActionEntry to define menu item labels and related actions. The location buttons just mirrored parts of that code. On top some other actions were defined in thunar-launcher or had their own classes, inheriting GtkAction.

So yay, lets just copy+paste the missing stuff to the location buttons? Nah, that would be too easy. As a developer who values DRY, it would hurt my belief in clean code to produce more mess.

Let’s Start Hacking

I started to do some coding .. first I created a new widget thunar-menu which internally is a gtk-menu, and moved menu-item creation and the related actions for copy/cut/paste/delete/move_to_trash there to have them at some central place, so they can be reused by different menus. I as well moved the actions from thunar-launcher to thunar-menu (I guess the original intention of the launcher was, to actually launch things, not to manage menu-items) and replaced separate action classes in favour of methods inside thunar-menu.

Meanwhile the location-button-menu and the context-menu, which I used for testing, were populated with some items again.

The old code made massive use of the deprecated GtkAction and GtkActionEntry classes together with GtkUiManager. I did not want to add more G_GNUC_BEGIN_IGNORE_DEPRECATIONS to silence warnings. So I decided to replace the deprecated calls.

Looking into the gtk3 documentation revealed that there now is GAction and GActionEntry which provides some service around accelerator activation, and there is GtkMenu/GMenu for which at that time I had no clear idea why there are two of them.

The documentation of GAction told me that it should not be used for anything related to labels, icons or creation of visual widgets, damn. So at that time I did not see an advantage in using this class. I decided to rather go for GtkMenu together with some custom replacement for GtkActionEntry: XfceGtkActionEntry.

In retrospective ignoring GAction might not have been my smartest move. Meanwhile I understood how GAction can be used with GtkMenu, and I will most likely go for it at some later point.

Regarding GtkUiManager: The definition of menu-items of Thunar was scattered across 7 different *-ui.xml files, making it hard to figure out what belongs together. Because of that I decided to just get rid of the deprecated GtkUiManager and create menu-items in the code instead of predefining their order in xml. IMO the usage of xml files might be nice for static GUI’s, though for dynamic menu-creation it just introduces unnecessary complexity.

So I started to build XfceGtkActionEntry and some support methods.XfceGtkActionEntry is a structure which holds labels, tooltips, icons, types, the accelerator paths and callbacks to the related actions. Like GtkActionEntry it is just a struct and can be filled in a static way.

Next problem: The menus in Thunar so far did not get destroyed, but were updated whenever the selected items got changed, and got shown when needed. That sounded wrong to me. Why should I want to update menu-items, which can be expensive, while no menu is visible at all ? There were bugs about menu flickering and slowness while rubber banding/mass select which seem to be related. Since I anyhow needed to touch that part, I decided to build menus only when they need to be shown.

Things went well, I came to the point where I needed some items from thunar-window, like the zoom-section and the view-specific settings. As well most file-menu items in the thunar-window menu did not work any more since I moved management of them from thunar-launcher to thunar-menu. So next step clearly was: Introduce XfceGtkActionEntry to thunar-window … and than shit hit the fan.

So far the thunar-window menu was always present and took care for any accelerator actions. Since my concept was “create menu on request”, there was no menu instance which could take care for accelerators any more, leading to dysfunctional accelerator keys, rendering my whole concept as faulty .. aargh.

Start all over again

After some time of grieve and doubts I fixed the problem by moving most of the code from thunar-menu back to thunar-launcher, which lifetime is coupled to thunar-window.

From now on thunar-menu was more or less just an convenience wrapper for thunar-launcher … still useful, but sadly it lost its glory. thunar-launcher now builds volatile menu items on request and permanently listens to the related accelerators. Finally accelerators started to work fine, and I was able to continue to fight with the window menu.

I had much more trouble with that menu, too much to tell it here .. however somehow I managed to get it functional, so that it mostly worked like before.

An unpleasant discovery

Later on, while reporting a bug against gtk I learned that the class gtk_accel_map, which I use as a central part will be deprecated soon … aargh again. The gtk devs so far just missed to set a deprecation macro. So it seems like I will need to touch the accelerator part again. This time I plan to make use of the GActionMap interface .. going to be a story for another day.

Testing and open issues

For first testing and code-review I luckily got support of some early adopters. They found many more defects and regressions which kept me busy a long while. Fortunately nothing concept-breaking was found.

While writing this there are still some regressions I introduced, waiting to get fixed by me before a stable release:

And there are related tasks on my agenda, for which I just did not find the time so far:

  • rename thunar-launcher to e.g. thunar-action-manager
  • use thunar-menu in bookmark view
  • use thunar-menu in Tree view
  • many minor things

Conclusion

Finally I ended up with 25 commits and +4717 / -7149 line changes. The occurrence of G_GNUC_BEGIN_IGNORE_DEPRECATIONS got reduced from 250 to 35. The remaining 35 occurrences will further drop when using GtkMenu for bookmark-view/tree-view. That should simplify the move to gtk4 in the future. The location-button context menu shows custom-actions now, and as well some other bugs got fixed with the changes.

So overall, the result does not look too bad I guess.

Well, this blogpost grew by far too long. I hope you nevertheless enjoyed the journey into the Thunar internals!

… enough storytelling for now, I really need to take care of these remaining regressions! :)

Thanks to Reuben, AndreLDM, DarkTrick and others for early testing and bug reporting! Special thanks to AndreLDM, motivating me to write this blogpost at all :D.

xfce4-dev-tools 4.15.0 released

[Please note that this is a development release.]

  • New macro XDT_VERSION_INIT(SEMVER[, TAG])

This macro takes care of setting up the version numbering. It will define the following macros based on SEMVER and TAG:

  • xdt_version
  • xdt_version_major
  • xdt_version_minor
  • xdt_version_micro
  • xdt_version_tag
  • xdt_version_build
  • xdt_debug_default

If TAG isn't specified, the xdt_version_tag and xdt_version_git will be empty and xdt_debug_default will be set to "minimum", otherwise the xdt_version_build will contain a git hash and xdt_debug_default will be set to "yes"

Example usage:

XDT_VERSION_INIT([4.15.3],[git]) AC_INIT([xfce4-someproject], [xdt_version()]) … XDT_FEATURE_DEBUG([xdt_debug_default])

  • XDT_I18N macro will now automatically find the linguas if none are specified during the autoconf run.

  • Install m4 macros in default search dir. This makes autoconf find the macros by default.

By setting version via XDT_VERSION_INIT and using XDT_I18N without arguments, this is no longer necessary to use a separate configure.ac.in and a plain configure.ac can be used ! A big thank to Natanael Copa (ncopa) for his work on this part !

  • xfce4-dev-tools now also handle the CI (docker container, .gitlab-ci.yml templates files etc) on our new gitlab instance. A merge request or a push to master to any of our projects automatically trigger a build. This will help us to catch errors quicker and have better quality. Thanks to Jason Yavorska and Simon Steinbeiss.

  • New helpers are also available (xfce-get-release-notes, xfce-get-translations, xfce-update-news) to help our maintainers to do releases ! Thanks Simon again.

  • Use datarootdir instead of datadir
  • xdt-autogen: explicitly set search path for m4 macros
  • Install the xfce-helpers
  • Add two new helpers to help releasers
  • Install m4 macros into default $datadir/aclocal
  • Update README for new gitlab urls
  • xdt-autogen: Improve and simplify linguas detection
  • Let XDT_I18N automatically find the po/*.po as default
  • Let configure generate the xdt-autogen script
  • Implement XDT_VERSION_INIT
  • Add manpage and tests to xdt-csource
  • Add xfce4-dev-tools build in addition to container build
  • Check BEFORE_SHA along with changes to .po files
  • gitlabci: Ensure to run autogen in distcheck stage
  • Switch to "foreign" mode for automake
  • Add CI templates notes
  • Update README with explanation of Dockerfile
  • Fix whitespace error
  • Add helper script to get all translation-updates
  • Integrate xfce-build container build/creation

xfce4-panel 4.15.3 released

[Please note that this is a development release.]

  • Add new app icon and rDNS icon name
  • Fix background of 48px app icons (Bug #16873)
  • dark-mode: Make property unique across panels
  • tasklist: Allow keyboard navigation within groups (Fixes #270)
  • applicationsmenu: Correctly block autohiding (Fixes #287)
  • action buttons: Fix combobox signal
  • action buttons: Drop 'inverted buttons' setting (#223)
  • action buttons: Add button title options (Bug #8980)
  • action buttons: Fix separator width (Bug #15558)
  • launcher: Fix launcher menu button state (Fixes #264)
  • launcher: Fix crash with actions menu (Bug #16823)
  • launcher: Fix in default panel configuration
  • Improve docs for xfce_panel_plugin_position_widget (Bug #9438)
  • Add Gio to libxfce4panel gir includes
  • Add basic GitLab pipeline
  • Fix whitespace error
  • Fix panel build with vala 0.48 (Bug #16426)
  • Fix build
  • Update gitignore (Fixes #295)
  • Drop references to Gtk2 and 4.6 panel plugins
  • Translation Updates: Albanian, Amharic, Arabic, Armenian (Armenia), Belarusian, Bengali, Bulgarian, Catalan, Chinese (China), Chinese (Hong Kong), Chinese (Taiwan), Croatian, Czech, Danish, Dutch, Eastern Armenian, English (Australia), English (United Kingdom), Estonian, Finnish, French, Galician, Georgian, German, Greek, Hebrew, Hungarian, Icelandic, Indonesian, Interlingue, Italian, Japanese, Kazakh, Korean, Lithuanian, Malay, Norwegian Bokmål, Norwegian Nynorsk, Occitan (post 1500), Panjabi (Punjabi), Polish, Portuguese, Portuguese (Brazil), Romanian, Russian, Sinhala, Slovak, Slovenian, Spanish, Swedish, Thai, Turkish, Uighur, Ukrainian, Vietnamese

v0.15.1

Bugfix release

Bug Fixes

  • Fixed nm-applet icon in notification bubble
  • Fixed several contrast problems and added new colored software-update (Issue #206)
  • Fix nm-applet vpn icons (Issue #212)
  • Fixed some bad icons used in help dialogs

LightDM GTK+ Greeter 2.0.8

General

  • Migrated code and issues to GitHub
  • Migrated translations to Transifex
  • Added GitHub distcheck test on each commit

Build changes

  • Migrated from deprecated exo-csource to xdt-csource (xfce4-dev-tools)
  • Dropped xdt-csource requirement from non-maintainer builds (GH: #53)
  • Enabled Ayatana libindicator/libido backend (GH: #74, Debian: #906026)

Bugs fixed

  • greeterbackground: Replaced deprecated instance private data API
  • Allow building with newer versions of gettext
  • Replace ungrammatical comma splice in 'Incorrect password' message (LP: #1810143)
  • Use 'Large Text' instead of 'Large Font' (LP: #1829070)
  • Fixed broken indicators when upstart is unavailable

Updated translations

Asturian, Czech, Danish, Dutch, German, Hebrew, Hungarian, Indonesian, Kabyle, Lithuanian, Occitan (post 1500), Portuguese, Portuguese (Brazil), Serbian, Spanish, Ukrainian

xfce4-eyes-plugin 4.5.1 released

  • Update URLs. Remove ref. to translations.x.o (Bug #16162)
  • Allow compilation with panel 4.15
  • Replace GtkStock buttons
  • Improve spacing (Bug #14664)
  • Make build less verbose
  • AC_CONFIG_MACRO_DIR -> AC_CONFIG_MACRO_DIRS
  • Translation Updates: Albanian, Amharic, Arabic, Armenian (Armenia), Asturian, Basque, Belarusian, Bulgarian, Catalan, Chinese (China), Chinese (Taiwan), Croatian, Czech, Danish, Dutch, English (Australia), English (United Kingdom), Esperanto, Estonian, Finnish, French, Galician, German, Greek, Hebrew, Hungarian, Icelandic, Indonesian, Italian, Japanese, Kazakh, Korean, Latvian, Lithuanian, Malay, Norwegian Bokmål, Occitan (post 1500), Polish, Portuguese, Portuguese (Brazil), Romanian, Russian, Serbian, Slovak, Slovenian, Spanish, Swedish, Thai, Turkish, Uighur, Ukrainian, Urdu, Urdu (Pakistan)

libxfce4util 4.15.1 released

[Please note that this is a development release.]

  • Add field codes expansion and related utilities (code moved from garcon)
  • docs: Show the "Miscellaneous Utilities" section
  • Add basic GitLab pipeline
  • Translation Updates: Albanian, Armenian (Armenia), Asturian, Belarusian, Hindi, Italian, Spanish, Uzbek