phocean / TopIcons-plus

An gnome-shell extension to put the icons back to the tray.
678 stars 98 forks source link

Dropbox icon not showing up after login #121

Closed demokritos closed 4 years ago

demokritos commented 5 years ago

From some tests, dropbox icon does not show up if there is no tray when dropbox starts to run. I think that this is dropbox's bug. But it seems that topicons-plus unnecessarily delays the moveToTop() using GLib.idle_add(). According to the document, GLib.idle_add() repeatedly calls the callback function. Should moveToTop() be called repeatedly?

With the code below, dropbox icon shows up. (I placed this code below the settings assignment and settings.connect()'s)

    if (tray)
        //GLib.idle_add(GLib.PRIORITY_LOW, moveToTop);
        moveToTop();
    else
        //GLib.idle_add(GLib.PRIORITY_LOW, createTray);
        createTray();
phocean commented 4 years ago

Thank you for this report.

First, and as I don't use Dropbox, do you still have the issue?

Regarding the code, it's purpose was to add a delay, but the repeated call are probably unwanted.

I have to investigate this indeed.

demokritos commented 4 years ago

I have used the extension with my patch. Today, I rebuilt the latest git version without the patch. This issue seems fixed.

FYI, the patch was actually the following:

diff --git a/extension.js b/extension.js
index 58a0433..220a1eb 100644
--- a/extension.js
+++ b/extension.js
@@ -49,11 +49,6 @@ function init() { Convenience.initTranslations(); }
 function enable() {
     tray = Main.legacyTray;

-    if (tray)
-        GLib.idle_add(GLib.PRIORITY_LOW, moveToTop);
-    else
-        GLib.idle_add(GLib.PRIORITY_LOW, createTray);
-
     settings = Convenience.getSettings();
     settings.connect('changed::icon-opacity', Lang.bind(this, setOpacity));
     settings.connect('changed::icon-saturation', Lang.bind(this, setSaturation));
@@ -64,6 +59,11 @@ function enable() {
     settings.connect('changed::tray-pos', Lang.bind(this, placeTray));
     settings.connect('changed::tray-order', Lang.bind(this, placeTray));

+    if (tray)
+        moveToTop();
+    else
+        createTray();
+
     connectPanelChildSignals();
 }
phocean commented 4 years ago

Ok, thank you for the feedback and good news. :) I am closing it.