From 10b491c252f739102c2724ecfaa3bb24f59d5ebf Mon Sep 17 00:00:00 2001 From: Julian Schacher Date: Mon, 5 Jul 2021 10:58:10 +0200 Subject: [PATCH] Update: Handle the Dropbox client better The Dropbox client appends its PID to the id, which gets used for the application name in `handleAppIndicatorKStatusNotifierItemItem`. This resulted in the creation of a new entry for the Dropbox client on basically every Dropbox client start, which would fill up the extensions settings and would also result in the user effectively not being able to set the position for the Dropbox client permanently. This commit fixes these issues by removing the PID (and the hypen before it) for the Dropbox client application name. --- .../AppIndicatorKStatusNotifierItemManager.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/extensionModules/AppIndicatorKStatusNotifierItemManager.js b/src/extensionModules/AppIndicatorKStatusNotifierItemManager.js index e4c3e85..6701de4 100644 --- a/src/extensionModules/AppIndicatorKStatusNotifierItemManager.js +++ b/src/extensionModules/AppIndicatorKStatusNotifierItemManager.js @@ -53,7 +53,11 @@ var AppIndicatorKStatusNotifierItemManager = class AppIndicatorKStatusNotifierIt handleAppIndicatorKStatusNotifierItemItem(indicatorContainer, role, boxOrder, boxOrders, atToBeginning = false) { // Get the application the AppIndicator/KStatusNotifierItem is // associated with. - const application = indicatorContainer.get_child()._indicator.id; + let application = indicatorContainer.get_child()._indicator.id; + + // Since the Dropbox client appends its PID to the id, drop the PID and + // the hyphen before it. + if (application.startsWith("dropbox-client-")) application = "dropbox-client"; // Associate the role with the application. let roles = this._applicationRoleMap.get(application);