Merge lp:~larsu/bamf/fixup-gtk-application-matching into lp:bamf

Proposed by Lars Karlitski on 2015-01-29
Status: Merged
Approved by: Marco Trevisan (Treviño) on 2015-02-02
Approved revision: 610
Merged at revision: 609
Proposed branch: lp:~larsu/bamf/fixup-gtk-application-matching
Merge into: lp:bamf
Diff against target: 62 lines (+21/-10)
1 file modified
src/bamf-matcher.c (+21/-10)
To merge this branch: bzr merge lp:~larsu/bamf/fixup-gtk-application-matching
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) 2015-01-29 Approve on 2015-02-02
PS Jenkins bot continuous-integration Needs Fixing on 2015-01-29
Review via email: mp+247975@code.launchpad.net

Commit Message

Matcher: use desktop file path when matching on _GTK_APPLICATION_ID

Previously, bamf_application_get_application_desktop_file() would return the bare id in those cases.

Description of the Change

Matcher: use desktop file path when matching on _GTK_APPLICATION_ID

Previously, bamf_application_get_application_desktop_file() would return the bare id in those cases.

To post a comment you must log in.
610. By Lars Karlitski on 2015-01-29

Matcher: fix memory leak

PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Rico Tzschichholz (ricotz) wrote :

I tested it and it fixes the issue, I had, for me.

611. By Marco Trevisan (Treviño) on 2015-02-02

matcher: look for app ids only if desktop_file is not set

Marco Trevisan (Treviño) (3v1n0) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/bamf-matcher.c'
2--- src/bamf-matcher.c 2015-01-12 11:01:36 +0000
3+++ src/bamf-matcher.c 2015-02-02 09:57:30 +0000
4@@ -1617,7 +1617,7 @@
5 BamfMatcherPrivate *priv;
6 BamfLegacyWindow *window;
7 GList *desktop_files = NULL, *l;
8- gchar *app_id;
9+ char *app_id;
10 char *desktop_file = NULL;
11 const char *desktop_class = NULL;
12 const char *class_name = NULL;
13@@ -1630,7 +1630,6 @@
14
15 priv = self->priv;
16 window = bamf_window_get_window (bamf_window);
17- app_id = bamf_legacy_window_get_hint (window, _GTK_APPLICATION_ID);
18 desktop_file = bamf_legacy_window_get_hint (window, _NET_WM_DESKTOP_FILE);
19 class_name = bamf_legacy_window_get_class_name (window);
20 instance_name = bamf_legacy_window_get_class_instance_name (window);
21@@ -1658,14 +1657,6 @@
22 }
23 }
24
25- if (app_id)
26- {
27- if (g_hash_table_contains (priv->desktop_id_table, app_id))
28- desktop_files = g_list_prepend (desktop_files, app_id);
29- else
30- g_free (app_id);
31- }
32-
33 if (desktop_file)
34 {
35 desktop_class = bamf_matcher_get_desktop_file_class (self, desktop_file);
36@@ -1688,6 +1679,26 @@
37 {
38 desktop_files = g_list_prepend (desktop_files, desktop_file);
39 }
40+ else
41+ {
42+ app_id = bamf_legacy_window_get_hint (window, _GTK_APPLICATION_ID);
43+
44+ if (app_id)
45+ {
46+ for (l = g_hash_table_lookup (priv->desktop_id_table, app_id); l; l = l->next)
47+ {
48+ desktop_file = l->data;
49+ desktop_class = bamf_matcher_get_desktop_file_class (self, desktop_file);
50+
51+ if ((!filter_by_wmclass && !desktop_class) || g_strcmp0 (desktop_class, target_class) == 0)
52+ {
53+ desktop_files = g_list_prepend (desktop_files, g_strdup (desktop_file));
54+ }
55+ }
56+
57+ g_free (app_id);
58+ }
59+ }
60 }
61
62 desktop_file = NULL;

Subscribers

People subscribed via source and target branches

to all changes: