Merge lp:~unity-team/bamf/x-sru2 into lp:bamf/xenial

Proposed by Marco Trevisan (Treviño) on 2016-06-29
Status: Merged
Approved by: Andrea Azzarone on 2016-07-06
Approved revision: no longer in the source branch.
Merged at revision: 637
Proposed branch: lp:~unity-team/bamf/x-sru2
Merge into: lp:bamf/xenial
Diff against target: 370 lines (+134/-19)
9 files modified
debian/bamfdaemon.triggers (+2/-2)
debian/changelog (+15/-0)
src/bamf-control.c (+1/-1)
src/bamf-legacy-screen.c (+3/-3)
src/bamf-legacy-window.c (+1/-1)
src/bamf-matcher.c (+62/-8)
src/bamf-matcher.h (+1/-0)
src/bamf-view.c (+44/-3)
src/bamf-view.h (+5/-1)
To merge this branch: bzr merge lp:~unity-team/bamf/x-sru2
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) 2016-06-29 Approve on 2016-07-06
Review via email: mp+298662@code.launchpad.net

Commit message

Releasing SRU2 for Xenial

To post a comment you must log in.
Sebastien Bacher (seb128) wrote :

Looks fine but the SRU team likes to have rational about changes, is there a bug report corresponding to the first changeset? If not it would be good to at last describe in the changelog in which cases it would be useful

lp:~unity-team/bamf/x-sru2 updated on 2016-07-01
637. By CI Train Bot Account on 2016-07-01

* BamfMatcher: allow overriding desktop with the environment var
  BAMF_DESKTOP_FILE_HINT
* Daemon: manually set to complete the startup notification on view
  state change (LP: #1582430)
* debian/bamfdaemon.triggers: use interest-noawait (LP: #1589097)

Andrea Azzarone (azzar1) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/bamfdaemon.triggers'
--- debian/bamfdaemon.triggers 2010-05-25 11:06:17 +0000
+++ debian/bamfdaemon.triggers 2016-06-30 12:10:12 +0000
@@ -1,2 +1,2 @@
1interest /usr/share/applications1interest-noawait /usr/share/applications
2interest gmenucache2interest-noawait gmenucache
33
=== modified file 'debian/changelog'
--- debian/changelog 2016-05-23 18:05:14 +0000
+++ debian/changelog 2016-06-30 12:10:12 +0000
@@ -1,3 +1,18 @@
1bamf (0.5.3~bzr0+16.04.20160523-0ubuntu2) UNRELEASED; urgency=medium
2
3 [ Marco Trevisan (Treviño) ]
4 * BamfMatcher: allow overriding desktop with the environment var
5 BAMF_DESKTOP_FILE_HINT
6
7 [ Andrea Azzarone ]
8 * Daemon: manually set to complete the startup notification on view
9 state change (LP: #1582430)
10
11 [ Marco Trevisan (Treviño) ]
12 * debian/bamfdaemon.triggers: use interest-noawait (LP: #1589097)
13
14 -- Marco Trevisan (Treviño) <mail@3v1n0.net> Wed, 29 Jun 2016 17:57:07 +0200
15
1bamf (0.5.3~bzr0+16.04.20160523-0ubuntu1) xenial; urgency=medium16bamf (0.5.3~bzr0+16.04.20160523-0ubuntu1) xenial; urgency=medium
217
3 * bamfdaemon-dbus-runner: don't try to start again if already running18 * bamfdaemon-dbus-runner: don't try to start again if already running
419
=== modified file 'src/bamf-control.c'
--- src/bamf-control.c 2016-03-21 15:17:45 +0000
+++ src/bamf-control.c 2016-06-30 12:10:12 +0000
@@ -54,7 +54,7 @@
54 g_variant_get_child (parameters, 0, "^&ay", &desktop_file);54 g_variant_get_child (parameters, 0, "^&ay", &desktop_file);
55 g_variant_get_child (parameters, 2, "x", &pid);55 g_variant_get_child (parameters, 2, "x", &pid);
5656
57 bamf_matcher_set_starting_desktop_file (matcher, desktop_file, TRUE);57 bamf_matcher_set_starting_desktop_file (matcher, desktop_file, NULL, TRUE);
58 bamf_matcher_register_desktop_file_for_pid (matcher, desktop_file, pid);58 bamf_matcher_register_desktop_file_for_pid (matcher, desktop_file, pid);
59}59}
6060
6161
=== modified file 'src/bamf-legacy-screen.c'
--- src/bamf-legacy-screen.c 2016-03-21 15:21:45 +0000
+++ src/bamf-legacy-screen.c 2016-06-30 12:10:12 +0000
@@ -258,7 +258,7 @@
258 {258 {
259 SnStartupSequence *sequence = sn_monitor_event_get_startup_sequence (event);259 SnStartupSequence *sequence = sn_monitor_event_get_startup_sequence (event);
260 const gchar *app_id = sn_startup_sequence_get_application_id (sequence);260 const gchar *app_id = sn_startup_sequence_get_application_id (sequence);
261 g_signal_emit (self, legacy_screen_signals[WINDOW_OPENING], 0, app_id);261 g_signal_emit (self, legacy_screen_signals[WINDOW_OPENING], 0, app_id, sequence);
262 }262 }
263 break;263 break;
264 case SN_MONITOR_EVENT_COMPLETED:264 case SN_MONITOR_EVENT_COMPLETED:
@@ -477,8 +477,8 @@
477 G_SIGNAL_RUN_FIRST,477 G_SIGNAL_RUN_FIRST,
478 G_STRUCT_OFFSET (BamfLegacyScreenClass, window_opening),478 G_STRUCT_OFFSET (BamfLegacyScreenClass, window_opening),
479 NULL, NULL, NULL,479 NULL, NULL, NULL,
480 G_TYPE_NONE, 1,480 G_TYPE_NONE, 2,
481 G_TYPE_STRING);481 G_TYPE_STRING, G_TYPE_POINTER);
482482
483 legacy_screen_signals [WINDOW_OPENING_COMPLETED] =483 legacy_screen_signals [WINDOW_OPENING_COMPLETED] =
484 g_signal_new (BAMF_LEGACY_SCREEN_SIGNAL_WINDOW_OPENING_COMPLETED,484 g_signal_new (BAMF_LEGACY_SCREEN_SIGNAL_WINDOW_OPENING_COMPLETED,
485485
=== modified file 'src/bamf-legacy-window.c'
--- src/bamf-legacy-window.c 2016-04-09 02:06:08 +0000
+++ src/bamf-legacy-window.c 2016-06-30 12:10:12 +0000
@@ -194,7 +194,7 @@
194194
195 pid = bamf_legacy_window_get_pid (self);195 pid = bamf_legacy_window_get_pid (self);
196196
197 if (pid <= 0)197 if (pid < 2)
198 return NULL;198 return NULL;
199199
200 stat_path = g_strdup_printf ("/proc/%i/status", pid);200 stat_path = g_strdup_printf ("/proc/%i/status", pid);
201201
=== modified file 'src/bamf-matcher.c'
--- src/bamf-matcher.c 2016-03-22 13:36:15 +0000
+++ src/bamf-matcher.c 2016-06-30 12:10:12 +0000
@@ -30,6 +30,8 @@
30#include <strings.h>30#include <strings.h>
3131
32#define BAMF_INDEX_NAME "bamf-2.index"32#define BAMF_INDEX_NAME "bamf-2.index"
33#define EXEC_DESKTOP_FILE_OVERRIDE "--desktop_file_hint"
34#define ENV_DESKTOP_FILE_OVERRIDE "BAMF_DESKTOP_FILE_HINT"
3335
34G_DEFINE_TYPE (BamfMatcher, bamf_matcher, BAMF_DBUS_TYPE_MATCHER_SKELETON);36G_DEFINE_TYPE (BamfMatcher, bamf_matcher, BAMF_DBUS_TYPE_MATCHER_SKELETON);
35#define BAMF_MATCHER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE(obj, \37#define BAMF_MATCHER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE(obj, \
@@ -79,8 +81,6 @@
79 "com-sun-javaws-Main", "VCLSalFrame"81 "com-sun-javaws-Main", "VCLSalFrame"
80};82};
8183
82const gchar * EXEC_DESKTOP_FILE_OVERRIDE = "--desktop_file_hint";
83
84static void84static void
85on_view_active_changed (BamfView *view, gboolean active, BamfMatcher *matcher)85on_view_active_changed (BamfView *view, gboolean active, BamfMatcher *matcher)
86{86{
@@ -556,6 +556,49 @@
556 return result;556 return result;
557}557}
558558
559char *
560get_env_overridden_desktop_file (guint pid)
561{
562 gchar *environ_file;
563 gchar *environ;
564 gchar *result;
565 gsize file_len;
566 gint i;
567
568 if (pid < 2)
569 return NULL;
570
571 environ = NULL;
572 result = NULL;
573 environ_file = g_strdup_printf ("/proc/%u/environ", pid);
574
575 if (g_file_get_contents (environ_file, &environ, &file_len, NULL))
576 {
577 for (i = 0; i < file_len && environ && environ[i] != '\0'; i += strlen (environ + i) + 1)
578 {
579 const gchar *var = environ + i;
580
581 if (g_str_has_prefix (var, ENV_DESKTOP_FILE_OVERRIDE"="))
582 {
583 const gchar *file_path;
584 file_path = var + sizeof (ENV_DESKTOP_FILE_OVERRIDE);
585
586 if (g_str_has_suffix (file_path, ".desktop") &&
587 g_file_test (file_path, G_FILE_TEST_EXISTS|G_FILE_TEST_IS_REGULAR))
588 {
589 result = g_strdup (file_path);
590 break;
591 }
592 }
593 }
594 }
595
596 g_free (environ);
597 g_free (environ_file);
598
599 return result;
600}
601
559static GList *602static GList *
560pid_parent_tree (BamfMatcher *self, guint pid)603pid_parent_tree (BamfMatcher *self, guint pid)
561{604{
@@ -1670,8 +1713,17 @@
1670 g_free (desktop_file);1713 g_free (desktop_file);
1671 }1714 }
1672 }1715 }
1673 else1716
1717 if (!desktop_files)
1674 {1718 {
1719 gint pid = bamf_legacy_window_get_pid (window);
1720 desktop_file = get_env_overridden_desktop_file (pid);
1721
1722 if (desktop_file)
1723 {
1724 desktop_files = g_list_prepend (desktop_files, desktop_file);
1725 }
1726
1675 const char *exec_string = bamf_legacy_window_get_exec_string (window);1727 const char *exec_string = bamf_legacy_window_get_exec_string (window);
1676 desktop_file = get_exec_overridden_desktop_file (exec_string);1728 desktop_file = get_exec_overridden_desktop_file (exec_string);
16771729
@@ -1679,7 +1731,8 @@
1679 {1731 {
1680 desktop_files = g_list_prepend (desktop_files, desktop_file);1732 desktop_files = g_list_prepend (desktop_files, desktop_file);
1681 }1733 }
1682 else1734
1735 if (!desktop_files)
1683 {1736 {
1684 app_id = bamf_legacy_window_get_hint (window, _GTK_APPLICATION_ID);1737 app_id = bamf_legacy_window_get_hint (window, _GTK_APPLICATION_ID);
16851738
@@ -2197,15 +2250,15 @@
2197}2250}
21982251
2199static void2252static void
2200handle_window_opening (BamfLegacyScreen *screen, const gchar *desktop_id, BamfMatcher *self)2253handle_window_opening (BamfLegacyScreen *screen, const gchar *desktop_id, SnStartupSequence *startup_sequence, BamfMatcher *self)
2201{2254{
2202 bamf_matcher_set_starting_desktop_file (self, desktop_id, TRUE);2255 bamf_matcher_set_starting_desktop_file (self, desktop_id, startup_sequence, TRUE);
2203}2256}
22042257
2205static void2258static void
2206handle_window_opening_finished (BamfLegacyScreen *screen, const gchar *desktop_id, BamfMatcher *self)2259handle_window_opening_finished (BamfLegacyScreen *screen, const gchar *desktop_id, BamfMatcher *self)
2207{2260{
2208 bamf_matcher_set_starting_desktop_file (self, desktop_id, FALSE);2261 bamf_matcher_set_starting_desktop_file (self, desktop_id, NULL, FALSE);
2209}2262}
22102263
2211static void2264static void
@@ -2446,6 +2499,7 @@
2446void2499void
2447bamf_matcher_set_starting_desktop_file (BamfMatcher *self,2500bamf_matcher_set_starting_desktop_file (BamfMatcher *self,
2448 const char *desktop_file,2501 const char *desktop_file,
2502 SnStartupSequence *startup_sequence,
2449 gboolean starting)2503 gboolean starting)
2450{2504{
2451 BamfApplication *app;2505 BamfApplication *app;
@@ -2470,7 +2524,7 @@
24702524
2471 if (BAMF_IS_APPLICATION (app))2525 if (BAMF_IS_APPLICATION (app))
2472 {2526 {
2473 bamf_view_set_starting (BAMF_VIEW (app), starting);2527 bamf_view_set_starting (BAMF_VIEW (app), startup_sequence, starting);
2474 }2528 }
2475}2529}
24762530
24772531
=== modified file 'src/bamf-matcher.h'
--- src/bamf-matcher.h 2016-03-21 15:16:22 +0000
+++ src/bamf-matcher.h 2016-06-30 12:10:12 +0000
@@ -76,6 +76,7 @@
7676
77void bamf_matcher_set_starting_desktop_file (BamfMatcher * self,77void bamf_matcher_set_starting_desktop_file (BamfMatcher * self,
78 const char *desktop_file,78 const char *desktop_file,
79 SnStartupSequence *sequence,
79 gboolean starting);80 gboolean starting);
8081
81const char * bamf_matcher_get_desktop_file_class (BamfMatcher * self,82const char * bamf_matcher_get_desktop_file_class (BamfMatcher * self,
8283
=== modified file 'src/bamf-view.c'
--- src/bamf-view.c 2016-03-29 14:52:33 +0000
+++ src/bamf-view.c 2016-06-30 12:10:12 +0000
@@ -78,6 +78,8 @@
78 gboolean closed;78 gboolean closed;
79 guint starting_timeout;79 guint starting_timeout;
8080
81 SnStartupSequence *startup_sequence;
82
81 /* FIXME: remove this as soon as we move to properties on library as well */83 /* FIXME: remove this as soon as we move to properties on library as well */
82 guint active_changed_idle;84 guint active_changed_idle;
83};85};
@@ -115,6 +117,9 @@
115 guint idle = g_idle_add_full (G_PRIORITY_DEFAULT, on_active_changed_idle, view, NULL);117 guint idle = g_idle_add_full (G_PRIORITY_DEFAULT, on_active_changed_idle, view, NULL);
116 view->priv->active_changed_idle = idle;118 view->priv->active_changed_idle = idle;
117 }119 }
120
121 if (active)
122 bamf_view_set_starting (view, NULL, FALSE);
118}123}
119124
120static void125static void
@@ -152,7 +157,7 @@
152{157{
153 BamfView *view = data;158 BamfView *view = data;
154159
155 bamf_view_set_starting (view, FALSE);160 bamf_view_set_starting (view, NULL, FALSE);
156 view->priv->starting_timeout = 0;161 view->priv->starting_timeout = 0;
157162
158 return FALSE;163 return FALSE;
@@ -197,7 +202,7 @@
197 g_signal_emit_by_name (view, "running-changed", running);202 g_signal_emit_by_name (view, "running-changed", running);
198203
199 if (running)204 if (running)
200 bamf_view_set_starting (view, FALSE);205 bamf_view_set_starting (view, NULL, FALSE);
201}206}
202207
203static void208static void
@@ -213,6 +218,9 @@
213218
214 if (emit)219 if (emit)
215 g_signal_emit_by_name (view, "urgent-changed", urgent);220 g_signal_emit_by_name (view, "urgent-changed", urgent);
221
222 if (urgent)
223 bamf_view_set_starting (view, NULL, FALSE);
216}224}
217225
218void226void
@@ -480,8 +488,33 @@
480488
481void489void
482bamf_view_set_starting (BamfView *view,490bamf_view_set_starting (BamfView *view,
491 SnStartupSequence *startup_sequence,
483 gboolean starting)492 gboolean starting)
484{493{
494 if (!bamf_view_is_starting (view) && starting)
495 {
496 if (view->priv->startup_sequence)
497 {
498 sn_startup_sequence_unref (view->priv->startup_sequence);
499 view->priv->startup_sequence = NULL;
500 }
501
502 if (startup_sequence)
503 {
504 view->priv->startup_sequence = startup_sequence;
505 sn_startup_sequence_ref (view->priv->startup_sequence);
506 }
507 }
508 else if (!starting)
509 {
510 if (view->priv->startup_sequence)
511 {
512 sn_startup_sequence_complete (view->priv->startup_sequence);
513 sn_startup_sequence_unref (view->priv->startup_sequence);
514 view->priv->startup_sequence = NULL;
515 }
516 }
517
485 BAMF_VIEW_SET_BOOL_PROPERTY (view, starting);518 BAMF_VIEW_SET_BOOL_PROPERTY (view, starting);
486}519}
487520
@@ -581,7 +614,7 @@
581 bamf_view_set_name (view, cache->name);614 bamf_view_set_name (view, cache->name);
582 bamf_view_set_icon (view, cache->icon);615 bamf_view_set_icon (view, cache->icon);
583 bamf_view_set_active (view, cache->active);616 bamf_view_set_active (view, cache->active);
584 bamf_view_set_starting (view, cache->starting);617 bamf_view_set_starting (view, NULL, cache->starting);
585 bamf_view_set_running (view, cache->running);618 bamf_view_set_running (view, cache->running);
586 bamf_view_set_user_visible (view, cache->user_visible);619 bamf_view_set_user_visible (view, cache->user_visible);
587 bamf_view_set_urgent (view, cache->urgent);620 bamf_view_set_urgent (view, cache->urgent);
@@ -863,6 +896,12 @@
863 priv->active_changed_idle = 0;896 priv->active_changed_idle = 0;
864 }897 }
865898
899 if (priv->startup_sequence)
900 {
901 sn_startup_sequence_unref (priv->startup_sequence);
902 priv->startup_sequence = NULL;
903 }
904
866 bamf_view_cached_properties_clear (view);905 bamf_view_cached_properties_clear (view);
867 g_dbus_object_skeleton_flush (G_DBUS_OBJECT_SKELETON (view));906 g_dbus_object_skeleton_flush (G_DBUS_OBJECT_SKELETON (view));
868907
@@ -931,6 +970,8 @@
931 self->priv->dbus_iface = _bamf_dbus_item_view_skeleton_new ();970 self->priv->dbus_iface = _bamf_dbus_item_view_skeleton_new ();
932 self->priv->props = g_new0 (BamfViewPropCache, 1);971 self->priv->props = g_new0 (BamfViewPropCache, 1);
933972
973 self->priv->startup_sequence = NULL;
974
934 /* We need to connect to the object own signals to redirect them to the dbus975 /* We need to connect to the object own signals to redirect them to the dbus
935 * interface */976 * interface */
936 g_signal_connect (self, "active-changed", G_CALLBACK (on_view_active_changed), NULL);977 g_signal_connect (self, "active-changed", G_CALLBACK (on_view_active_changed), NULL);
937978
=== modified file 'src/bamf-view.h'
--- src/bamf-view.h 2016-03-29 14:32:40 +0000
+++ src/bamf-view.h 2016-06-30 12:10:12 +0000
@@ -25,6 +25,10 @@
25#include <glib-object.h>25#include <glib-object.h>
26#include <libbamf-private/bamf-private.h>26#include <libbamf-private/bamf-private.h>
2727
28#define SN_API_NOT_YET_FROZEN
29#include <libsn/sn.h>
30#undef SN_API_NOT_YET_FROZEN
31
28#define BAMF_TYPE_VIEW (bamf_view_get_type ())32#define BAMF_TYPE_VIEW (bamf_view_get_type ())
29#define BAMF_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAMF_TYPE_VIEW, BamfView))33#define BAMF_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAMF_TYPE_VIEW, BamfView))
30#define BAMF_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAMF_TYPE_VIEW))34#define BAMF_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAMF_TYPE_VIEW))
@@ -89,7 +93,7 @@
89void bamf_view_set_active (BamfView *view, gboolean active);93void bamf_view_set_active (BamfView *view, gboolean active);
9094
91gboolean bamf_view_is_starting (BamfView *view);95gboolean bamf_view_is_starting (BamfView *view);
92void bamf_view_set_starting (BamfView *view, gboolean starting);96void bamf_view_set_starting (BamfView *view, SnStartupSequence *startup_sequence, gboolean starting);
9397
94gboolean bamf_view_is_running (BamfView *view);98gboolean bamf_view_is_running (BamfView *view);
95void bamf_view_set_running (BamfView *view, gboolean running);99void bamf_view_set_running (BamfView *view, gboolean running);

Subscribers

People subscribed via source and target branches

to all changes: