Merge lp:~larsu/bamf/lp1407711 into lp:bamf

Proposed by Lars Karlitski
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 606
Merged at revision: 606
Proposed branch: lp:~larsu/bamf/lp1407711
Merge into: lp:bamf
Diff against target: 59 lines (+12/-1)
3 files modified
m4/gcov.m4 (+1/-1)
src/bamf-matcher.c (+10/-0)
src/bamf-matcher.h (+1/-0)
To merge this branch: bzr merge lp:~larsu/bamf/lp1407711
Reviewer Review Type Date Requested Status
Rico Tzschichholz (community) Needs Information
Marco Trevisan (Treviño) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+246048@code.launchpad.net

Commit message

Matcher: honor the _GTK_APPLICATION_ID xprop

And give it priority over _NET_WM_DESKTOP_FILE if the application has a matching desktop file installed.

Description of the change

Matcher: honor the _GTK_APPLICATION_ID xprop

And give it priority over _NET_WM_DESKTOP_FILE if the application has a matching desktop file installed.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Looks good, just a small fix is needed.

As for the grouping, we should probably keep a list of applications for each app_id, and as soon as we find a window with a matching app-id we'll ignore all the other tests and assign that window for the given Bamf app.

lp:~larsu/bamf/lp1407711 updated
606. By Lars Karlitski

Matcher: fix a memory leak

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Looks good

review: Approve
lp:~larsu/bamf/lp1407711 updated
607. By Lars Karlitski

m4: update accepted lcov versions

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

This breaks "bamf_application_get_desktop_file" which starts to return this favored application_id in contradiction to its purpose and documented behavior.

review: Needs Information

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'm4/gcov.m4'
2--- m4/gcov.m4 2014-01-08 18:36:02 +0000
3+++ m4/gcov.m4 2015-01-12 11:13:42 +0000
4@@ -33,7 +33,7 @@
5 AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
6 fi
7
8- lcov_version_list="1.6 1.7 1.8 1.9 1.10"
9+ lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12"
10 AC_CHECK_PROG(LCOV, lcov, lcov)
11 AC_CHECK_PROG(GENHTML, genhtml, genhtml)
12
13
14=== modified file 'src/bamf-matcher.c'
15--- src/bamf-matcher.c 2014-04-09 16:59:37 +0000
16+++ src/bamf-matcher.c 2015-01-12 11:13:42 +0000
17@@ -1617,6 +1617,7 @@
18 BamfMatcherPrivate *priv;
19 BamfLegacyWindow *window;
20 GList *desktop_files = NULL, *l;
21+ gchar *app_id;
22 char *desktop_file = NULL;
23 const char *desktop_class = NULL;
24 const char *class_name = NULL;
25@@ -1629,6 +1630,7 @@
26
27 priv = self->priv;
28 window = bamf_window_get_window (bamf_window);
29+ app_id = bamf_legacy_window_get_hint (window, _GTK_APPLICATION_ID);
30 desktop_file = bamf_legacy_window_get_hint (window, _NET_WM_DESKTOP_FILE);
31 class_name = bamf_legacy_window_get_class_name (window);
32 instance_name = bamf_legacy_window_get_class_instance_name (window);
33@@ -1656,6 +1658,14 @@
34 }
35 }
36
37+ if (app_id)
38+ {
39+ if (g_hash_table_contains (priv->desktop_id_table, app_id))
40+ desktop_files = g_list_prepend (desktop_files, app_id);
41+ else
42+ g_free (app_id);
43+ }
44+
45 if (desktop_file)
46 {
47 desktop_class = bamf_matcher_get_desktop_file_class (self, desktop_file);
48
49=== modified file 'src/bamf-matcher.h'
50--- src/bamf-matcher.h 2013-08-07 15:50:56 +0000
51+++ src/bamf-matcher.h 2015-01-12 11:13:42 +0000
52@@ -46,6 +46,7 @@
53 #define BAMF_MATCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAMF_TYPE_MATCHER, BamfMatcherClass))
54
55 #define _NET_WM_DESKTOP_FILE "_NET_WM_DESKTOP_FILE"
56+#define _GTK_APPLICATION_ID "_GTK_APPLICATION_ID"
57
58 typedef struct _BamfMatcher BamfMatcher;
59 typedef struct _BamfMatcherClass BamfMatcherClass;

Subscribers

People subscribed via source and target branches

to all changes: