GNOME Bugzilla – Bug 669182
web application mode could set _NET_WM_ICON
Last modified: 2012-02-08 20:03:37 UTC
I created a web application icon for https://trello.com/ with epiphany. I'm still using metacity as my window manager, and noticed that the icon used in the .desktop file, etc, is not picked up in the alt-tab window, window list, etc.
Created attachment 206671 [details] [review] ephy-web-app-utils: add EPHY_WEB_APP_ICON define Stands for "app-icon.png", which is of interest outside ephy-web-app-utils.c
Created attachment 206672 [details] [review] ephy-main: always set a default icon for windows The web-browser icon for the normal/private mode, or the corresponding Web Application icon.
Review of attachment 206671 [details] [review]: ::: embed/ephy-web-app-utils.h @@ +41,2 @@ #define EPHY_WEB_APP_PREFIX "app-" +#define EPHY_WEB_APP_ICON "app-icon.png" Nitpick: unsure about EPHY_WEB_APP_ICON or EPHY_WEB_APP_ICON_NAME.
Review of attachment 206672 [details] [review]: ::: src/ephy-main.c @@ +442,3 @@ if (app_name) { /* Skip the 'app-' part */ app_name += strlen (EPHY_WEB_APP_PREFIX); I believe char *app_icon should go inside this if (). However, I'm slightly confused about what happens if app_name is NULL. I have not read the rest of the file, but I guess we are being smart, right? guys? @@ +448,3 @@ + gtk_window_set_default_icon_from_file (app_icon, NULL); + No &error because we really don't care about it. No sensible icon could be used, except for the (already default in this case) "window icon" that GtkWindows with no icon have. @@ +461,3 @@ g_set_application_name (_("Web")); + + gtk_window_set_default_icon_name ("web-browser"); If you use Epiphany in metacity/fallback (or other WM) it will get no icon. Other GNOME 3 applications are behaving correctly and showing an icon. Totem was my code example for this.
Review of attachment 206671 [details] [review]: EPHY_WEB_APP_ICON_NAME seems better, ok with that change.
(In reply to comment #4) > Review of attachment 206672 [details] [review]: > > ::: src/ephy-main.c > @@ +442,3 @@ > if (app_name) { > /* Skip the 'app-' part */ > app_name += strlen (EPHY_WEB_APP_PREFIX); > > I believe char *app_icon should go inside this if (). > > However, I'm slightly confused about what happens if app_name is NULL. I have > not read the rest of the file, but I guess we are being smart, right? guys? Not sure what this means, what do you mean by mean smart? In any case app_name being NULL should really never happen.
(In reply to comment #6) > (In reply to comment #4) > > Review of attachment 206672 [details] [review] [details]: > > > > ::: src/ephy-main.c > > @@ +442,3 @@ > > if (app_name) { > > /* Skip the 'app-' part */ > > app_name += strlen (EPHY_WEB_APP_PREFIX); > > > > I believe char *app_icon should go inside this if (). > > > > However, I'm slightly confused about what happens if app_name is NULL. I have > > not read the rest of the file, but I guess we are being smart, right? guys? > > Not sure what this means, what do you mean by mean smart? In any case app_name > being NULL should really never happen. I meant that what happens if profile_dir does not exist, this runs fine: epiphany --application-mode --profile=/home/diego/.gnome2/epiphany/app-INVALID-epiphany-facebook---diegoe-2777bb786830fa0a3d224bb40ec3d26eee4b4642-INVALID-INVALID facebook.com The profile dir is created, and used as if this was a fresh Epiphany (non private) instance with a profile-dir set. Is this the desired behavior? Should we fail if the profile-dir does not exist and it is supposed to be a web application?
(In reply to comment #7) > I meant that what happens if profile_dir does not exist, this runs fine: > > epiphany --application-mode > --profile=/home/diego/.gnome2/epiphany/app-INVALID-epiphany-facebook---diegoe-2777bb786830fa0a3d224bb40ec3d26eee4b4642-INVALID-INVALID > facebook.com > > The profile dir is created, and used as if this was a fresh Epiphany (non > private) instance with a profile-dir set. > > Is this the desired behavior? Should we fail if the profile-dir does not exist > and it is supposed to be a web application? It should fail if --application-mode is passed, yeah.
Review of attachment 206672 [details] [review]: So, I think the patch is OK. We should double check the profile exists in app mode, but that should be in a different patch.
Done. Thanks. I will open a bug for failing profile-dir Attachment 206671 [details] pushed as b02b30c - ephy-web-app-utils: add EPHY_WEB_APP_ICON define Attachment 206672 [details] pushed as 99251b7 - ephy-main: always set a default icon for windows