Merge lp:~midori/midori/startupWmClass into lp:midori

Proposed by Cris Dywan
Status: Merged
Approved by: Paweł Forysiuk
Approved revision: 6598
Merged at revision: 6630
Proposed branch: lp:~midori/midori/startupWmClass
Merge into: lp:midori
Diff against target: 50 lines (+16/-2)
3 files modified
extensions/apps.vala (+6/-0)
midori/midori-frontend.c (+8/-0)
midori/midori-view.c (+2/-2)
To merge this branch: bzr merge lp:~midori/midori/startupWmClass
Reviewer Review Type Date Requested Status
Paweł Forysiuk Approve
Review via email: mp+211157@code.launchpad.net

Commit message

Use sanitized app URI as wm_classname/ StartupWMClass

Description of the change

Note: This change only fully applies to new apps because it requires a change in the .desktop file.

To post a comment you must log in.
Revision history for this message
Paweł Forysiuk (tuxator) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'extensions/apps.vala'
2--- extensions/apps.vala 2014-01-25 21:34:30 +0000
3+++ extensions/apps.vala 2014-03-15 00:45:48 +0000
4@@ -69,6 +69,12 @@
5 keyfile.set_string (entry, "TryExec", PACKAGE_NAME);
6 keyfile.set_string (entry, "Icon", icon_name);
7 keyfile.set_string (entry, "Categories", "Network;");
8+ /*
9+ Using the sanitized URI as a class matches midori_web_app_new
10+ So dock type launchers can distinguish different apps with the same executable
11+ */
12+ if (exec.has_prefix (APP_PREFIX))
13+ keyfile.set_string (entry, "StartupWMClass", uri.delimit (":.\\/", '_'));
14
15 return keyfile.to_data();
16 }
17
18=== modified file 'midori/midori-frontend.c'
19--- midori/midori-frontend.c 2014-02-22 22:35:42 +0000
20+++ midori/midori-frontend.c 2014-03-15 00:45:48 +0000
21@@ -56,6 +56,14 @@
22 g_return_val_if_fail (webapp != NULL, NULL);
23
24 midori_paths_init (MIDORI_RUNTIME_MODE_APP, webapp);
25+ /*
26+ Set sanitized URI as class name which .desktop files use as StartupWMClass
27+ So dock type launchers can distinguish different apps with the same executable
28+ */
29+ gchar* wm_class = g_strdelimit (g_strdup (webapp), ":.\\/", '_');
30+ gdk_set_program_class (wm_class);
31+ g_free (wm_class);
32+
33 MidoriBrowser* browser = midori_browser_new ();
34 g_signal_connect (browser, "new-window",
35 G_CALLBACK (midori_frontend_browser_new_window_cb), NULL);
36
37=== modified file 'midori/midori-view.c'
38--- midori/midori-view.c 2014-03-06 23:51:01 +0000
39+++ midori/midori-view.c 2014-03-15 00:45:48 +0000
40@@ -3572,8 +3572,8 @@
41 midori_view_list_versions (GString* markup,
42 gboolean html)
43 {
44- midori_view_add_version (markup, html, g_strdup_printf ("%s %s (%s)",
45- g_get_application_name (), PACKAGE_VERSION, midori_app_get_name (NULL)));
46+ midori_view_add_version (markup, html, g_strdup_printf ("%s %s (%s) %s",
47+ g_get_application_name (), PACKAGE_VERSION, midori_app_get_name (NULL), gdk_get_program_class ()));
48 midori_view_add_version (markup, html, g_strdup_printf ("GTK+ %s (%u.%u.%u)\tGlib %s (%u.%u.%u)",
49 GTK_VERSION, gtk_major_version, gtk_minor_version, gtk_micro_version,
50 GIO_VERSION, glib_major_version, glib_minor_version, glib_micro_version));

Subscribers

People subscribed via source and target branches

to all changes: