After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 669182 - web application mode could set _NET_WM_ICON
web application mode could set _NET_WM_ICON
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Interface
3.2.x (obsolete)
Other Linux
: Normal minor
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-02-01 15:23 UTC by Sam Morris
Modified: 2012-02-08 20:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ephy-web-app-utils: add EPHY_WEB_APP_ICON define (1.86 KB, patch)
2012-02-03 06:59 UTC, Diego Escalante Urrelo (not reading bugmail)
committed Details | Review
ephy-main: always set a default icon for windows (1.63 KB, patch)
2012-02-03 07:00 UTC, Diego Escalante Urrelo (not reading bugmail)
committed Details | Review

Description Sam Morris 2012-02-01 15:23:26 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.
Comment 1 Diego Escalante Urrelo (not reading bugmail) 2012-02-03 06:59:28 UTC
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
Comment 2 Diego Escalante Urrelo (not reading bugmail) 2012-02-03 07:00:49 UTC
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.
Comment 3 Diego Escalante Urrelo (not reading bugmail) 2012-02-03 07:07:51 UTC
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.
Comment 4 Diego Escalante Urrelo (not reading bugmail) 2012-02-03 07:13:28 UTC
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.
Comment 5 Xan Lopez 2012-02-07 10:31:17 UTC
Review of attachment 206671 [details] [review]:

EPHY_WEB_APP_ICON_NAME seems better, ok with that change.
Comment 6 Xan Lopez 2012-02-07 10:34:21 UTC
(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.
Comment 7 Diego Escalante Urrelo (not reading bugmail) 2012-02-08 09:19:32 UTC
(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?
Comment 8 Xan Lopez 2012-02-08 11:53:02 UTC
(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.
Comment 9 Xan Lopez 2012-02-08 11:56:31 UTC
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.
Comment 10 Diego Escalante Urrelo (not reading bugmail) 2012-02-08 20:03:32 UTC
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