Hello.
I think I've managed to fix it. The patch is attached.
--- plank-0.11.89.orig/docklets/Applications/ApplicationsDockItem.vala
+++ plank-0.11.89/docklets/Applications/ApplicationsDockItem.vala
@@ -22,7 +22,7 @@ namespace Docky
public class ApplicationsDockItem : DockletItem
{
GMenu.Tree apps_menu;
- Mutex apps_menu_mutex;
+ bool need_update = false;
/**
* {@inheritDoc}
@@ -38,24 +38,19 @@ namespace Docky
Text = _("Applications");
apps_menu = new GMenu.Tree ("applications.menu", GMenu.TreeFlags.SORT_DISPLAY_NAME);
- apps_menu.changed.connect (update_menu);
- update_menu ();
+ apps_menu.changed.connect (menu_changed);
+ need_update = true;
}
~ApplicationsDockItem ()
{
if (apps_menu != null)
- apps_menu.changed.disconnect (update_menu);
+ apps_menu.changed.disconnect (menu_changed);
}
- void update_menu ()
+ void menu_changed()
{
- Worker.get_default ().add_task_with_result.begin<void*> (() => {
- apps_menu_mutex.lock ();
- apps_menu.load_sync ();
- apps_menu_mutex.unlock ();
- return null;
- }, TaskPriority.HIGH);
+ need_update = true;
}
protected override AnimationType on_scrolled (Gdk.ScrollDirection direction, Gdk.ModifierType mod, uint32 event_time)
@@ -70,6 +65,11 @@ namespace Docky
public override Gee.ArrayList<Gtk.MenuItem> get_menu_items ()
{
+ if (need_update) {
+ need_update = false;
+ apps_menu.load_sync ();
+ }
+
var items = new Gee.ArrayList<Gtk.MenuItem> ();
var iter = apps_menu.get_root_directory ().iter ();