Open rfrancisco opened 11 years ago
I have the same thing. I've installed Sublime Text 2, it has a menu entry and shows in the list of apps, but if i choose to pin it it doesn't stay pinned. It disappears as soon as the application closes.
Ok i"ll see what I can do I have been developing very slowly because of my job but work is slow right now
Can you add these programs to the menus favorites?
sublime text seems to be working for me can anyone confirm?
Sublime Text 2 still doesn't seem to pin right now with the latest commit that I have.
Awesome I wasn't able to duplicate the issue. Does it through an error?
-----Original Message----- From: "aikeru" notifications@github.com Sent: 9/22/2014 12:40 PM To: "jake-phy/WindowIconList" WindowIconList@noreply.github.com Cc: "jake-phy" jake.phy@gmail.com Subject: Re: [WindowIconList] Pin not working for some applications (#30)
Sublime Text 2 still doesn't seem to pin right now with the latest commit that I have. — Reply to this email directly or view it on GitHub.=
No but I think I see the problem. In applet.js _addFavorite is called. Cinnamon.AppSystem.get_default().lookup_app(appId) and Cinnamon.AppSystem.get_default().lookup_settings_app(appId) return null.
When these fail, _addFavorite returns early (if(!app) return false;).
Ok found some additional info. I can find the app by appId if I loop through AppSystem.get_default().get_running(); and check running.get_id(); (ie: window:6 or window:47) I then realized that maybe this applet's favorite system is probably expecting an installed app, and sublime isn't in that collection of apps.
I tried this with a standalone Java .jar and get the same behavior.
I am very new to all of this but I think you may need to find a different way to pin these sort of applications.
Here's what some of my test code looked like:
_addFavorite: function (appId, pos) {
if (appId in this._favorites)
return false;
let appSystem = Cinnamon.AppSystem.get_default();
let app = appSystem.lookup_app(appId);
if (!app) app = appSystem.lookup_settings_app(appId);
if (!app) {
//Search for it
let running = appSystem.get_running();
global.log('apps ' + running.length);
for(var i = 0; i < running.length; i++) {
var runningId = running[i].get_id();
global.log('running ' + runningId);
if(appId === runningId) {
app = running[i];
global.log('found app!');
break;
}
}
if(!app) return false;
}
let ids = this._getIds();
if (pos == -1)
ids.push(appId);
else
ids.splice(pos, 0, appId);
this._applet.settings.setValue("pinned-apps", ids);
this._favorites[appId] = app;
return true;
},
I found these helpful too: https://github.com/linuxmint/Cinnamon/blob/master/src/cinnamon-app.c https://github.com/linuxmint/Cinnamon/blob/master/src/cinnamon-app-system.c
Looks good I will see about adding that.
Please know that while my sample code finds the app it isn't a complete solution. I'm not sure what else is needed.
Right but it is a great start.
Seeing this as well. Problem present pinning not system installed, but custom executables (ie. eclipse). Closing said execs unpins the icon.
aikeru you are on the right track but if we can find location, it would be nice. From below https://github.com/linuxmint/Cinnamon/blob/master/src/cinnamon-app-system.c cinnamon_app_system_lookup_app_for_path() may be a solution.
Wondering if we can get path from appId.. Is there doc on Cinnamon = imports.gi.Cinnamon?
cinnamon_app_system_lookup_app_for_path (CinnamonAppSystem system, const char desktop_path) ... app = cinnamon_app_system_lookup_app (system, basename); if (!app) return NULL;
app_path = gmenu_tree_entry_get_desktop_file_path (cinnamon_app_get_tree_entry (app)); if (strcmp (desktop_path, app_path) != 0) return NULL; ...
It looks like aikeru's solution is the only(?) possible one as you need app to get desktop file path.
Edit: However, I still cannot get the favourite app to persist after I close it.
I'm going to have to completely rewrite this system, to allow for apps that are not installed. I want to get the appmenu stable and released so hopefully on the next release after the appmenu i'll implement this.
for fixing invalid grouping, you may do folowing steaps:
xprop WM_CLASS
into terminal and click on your app window. you will get something like WM_CLASS(STRING) = "sublime_text", "Sublime_text"
or WM_CLASS(STRING) = "TeamViewer.exe", "Wine"
.desktop
file for your problem application in owe of folowing locations:
StartupWMClass
field of [Desktop Entry]
block in your .desktop
file. for example StartupWMClass=TeamViewer.exe
this helps if
.desktop
filefor me, changes haven't applied even after reboot, but it have applied after unknown conditions in few hours
I tried to pin NetBeans and MySql Workbench but they dont stay pinned.