<html>
<head>
<base href="https://bugzilla.gnome.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - wayland: Use g_get_prgname as the xdg surface application id"
href="https://bugzilla.gnome.org/show_bug.cgi?id=746435#c12">Comment # 12</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - wayland: Use g_get_prgname as the xdg surface application id"
href="https://bugzilla.gnome.org/show_bug.cgi?id=746435">bug 746435</a>
from <span class="vcard"><a href="page.cgi?id=describeuser.html&login=jadahl%40gmail.com" title="Jonas Ådahl <jadahl@gmail.com>"> <span class="fn">Jonas Ådahl</span></a>
</span></b>
<pre>(In reply to Matthias Clasen from <a href="show_bug.cgi?id=746435#c11">comment #11</a>)
<span class="quote">> Review of <span class=""><a href="attachment.cgi?id=300110&action=diff" name="attach_300110" title="wayland: Set the correct xdg_surface application id">attachment 300110</a> <a href="attachment.cgi?id=300110&action=edit" title="wayland: Set the correct xdg_surface application id">[details]</a></span> <a href='review?bug=746435&attachment=300110'>[review]</a> [review]:
>
> Looking at the documentation of set_app_id and at the mutter implementation,
> I actually have doubts that using the actual application id for this is
> going to do us much good.
> The spec is much to unclear to be useful; it appears to be a mixture between
> traditional wm_class and desktop id. And the mutter code calls set_wm_class.</span >
The reason for writing this patch was me trying to improve the documentation of
xdg_surface.set_app_id and make GTK+ behave more according to the intention.
I've been explained that the intention is to allow the shell to find the
.desktop file as well as the DBUS name if the .desktop file basename is the
same as the DBUS name (for DBUS-activatable applications).
mutter calls meta_window_set_wm_class with the app_id as both the name and
instance. gnome-shell then tries to use these to find the appliation, either by
its the StartupWMClass or the .desktop basename.
Now gtk+ sets the app_id to the "program class" which is never the same as
either the .desktop file basename or the DBUS name. gnome-shell will still be
able to work with this since it reverses the change GTK+ did (by doing a upper
-> lower case of the string), and it'll effectively work almost the same as the
next method:
Using g_get_prgname makes it succeed occasionally when the result happen to be
the same as the .desktop name.
Using the application ID from the GTK application object makes it succeed
occasionally when the application is DBUS-activatable.
If there is any API in GTK application to get the basename of the .desktop
application, it'd probably be best to try that first and then fallback to
g_get_prgname. I don't think we should keep using the GDK program class, as
it'll never be correct.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>