Merge lp:~unity-team/bamf/bamf.export-pid into lp:bamf/0.4

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: 439
Merged at revision: 451
Proposed branch: lp:~unity-team/bamf/bamf.export-pid
Merge into: lp:bamf/0.4
Diff against target: 143 lines (+60/-1)
5 files modified
lib/libbamf/bamf-window.c (+32/-0)
lib/libbamf/bamf-window.h (+1/-1)
src/bamf-window.c (+22/-0)
src/bamf-window.h (+2/-0)
src/org.ayatana.bamf.view.xml (+3/-0)
To merge this branch: bzr merge lp:~unity-team/bamf/bamf.export-pid
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+93140@code.launchpad.net

Description of the change

Let's make these changes by Jason land ;)

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) :
review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) :
review: Approve
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

This branch broke ABI with:

58 === modified file 'lib/libbamf/bamf-window.h'
59 --- lib/libbamf/bamf-window.h 2012-02-10 19:08:57 +0000
60 +++ lib/libbamf/bamf-window.h 2012-02-15 05:55:22 +0000
61 @@ -104,7 +104,7 @@
62
63 guint32 bamf_window_get_xid (BamfWindow *self);
64
65 -gchar * bamf_window_get_utf8_prop (BamfWindow *self, const char* prop);
66 +guint32 bamf_window_get_pid (BamfWindow *self);

Was that intentional?

Revision history for this message
Michal Hruby (mhr3) wrote :

> Was that intentional?

Desrt just shouted at me for it, so I guess it wasn't, re-adding it to this branch.

lp:~unity-team/bamf/bamf.export-pid updated
438. By Michal Hruby

Re-add a function lost in the void during merges

439. By Michal Hruby

Merge with trunk

Revision history for this message
Michal Hruby (mhr3) wrote :

Merge bot ignoring us?

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/libbamf/bamf-window.c'
2--- lib/libbamf/bamf-window.c 2012-02-10 20:55:38 +0000
3+++ lib/libbamf/bamf-window.c 2012-02-15 05:55:22 +0000
4@@ -52,6 +52,7 @@
5 DBusGConnection *connection;
6 DBusGProxy *proxy;
7 guint32 xid;
8+ guint32 pid;
9 time_t last_active;
10 gint monitor;
11 gchar *application_id;
12@@ -141,6 +142,36 @@
13 return (BamfWindowType) type;
14 }
15
16+guint32 bamf_window_get_pid (BamfWindow *self)
17+{
18+ BamfWindowPrivate *priv;
19+ guint32 pid = 0;
20+ GError *error = NULL;
21+
22+ g_return_val_if_fail (BAMF_IS_WINDOW (self), FALSE);
23+ priv = self->priv;
24+
25+ if (priv->pid != 0)
26+ return priv->pid;
27+
28+ if (!bamf_view_remote_ready (BAMF_VIEW (self)))
29+ return 0;
30+
31+ if (!dbus_g_proxy_call (priv->proxy,
32+ "GetPid",
33+ &error,
34+ G_TYPE_INVALID,
35+ G_TYPE_UINT, &pid,
36+ G_TYPE_INVALID))
37+ {
38+ g_warning ("Failed to fetch pid: %s", error->message);
39+ g_error_free (error);
40+ return 0;
41+ }
42+
43+ return pid;
44+}
45+
46 guint32 bamf_window_get_xid (BamfWindow *self)
47 {
48 BamfWindowPrivate *priv;
49@@ -441,6 +472,7 @@
50 priv = self->priv = BAMF_WINDOW_GET_PRIVATE (self);
51
52 priv->xid = 0;
53+ priv->pid = 0;
54 priv->monitor = -2;
55 priv->maximized = -1;
56
57
58=== modified file 'lib/libbamf/bamf-window.h'
59--- lib/libbamf/bamf-window.h 2012-02-10 19:08:57 +0000
60+++ lib/libbamf/bamf-window.h 2012-02-15 05:55:22 +0000
61@@ -104,7 +104,7 @@
62
63 guint32 bamf_window_get_xid (BamfWindow *self);
64
65-gchar * bamf_window_get_utf8_prop (BamfWindow *self, const char* prop);
66+guint32 bamf_window_get_pid (BamfWindow *self);
67
68 gint bamf_window_get_monitor (BamfWindow *self);
69
70
71=== modified file 'src/bamf-window.c'
72--- src/bamf-window.c 2012-02-10 18:30:25 +0000
73+++ src/bamf-window.c 2012-02-15 05:55:22 +0000
74@@ -115,6 +115,14 @@
75 }
76
77 guint32
78+bamf_window_get_pid (BamfWindow *window)
79+{
80+ g_return_val_if_fail (BAMF_IS_WINDOW (window), 0);
81+
82+ return bamf_legacy_window_get_pid (window->priv->legacy_window);
83+}
84+
85+guint32
86 bamf_window_get_xid (BamfWindow *window)
87 {
88 g_return_val_if_fail (BAMF_IS_WINDOW (window), 0);
89@@ -275,6 +283,17 @@
90 }
91
92 static gboolean
93+on_dbus_handle_get_pid (BamfDBusItemWindow *interface,
94+ GDBusMethodInvocation *invocation,
95+ BamfWindow *self)
96+{
97+ gint pid = bamf_window_get_pid (self);
98+ g_dbus_method_invocation_return_value (invocation, g_variant_new ("(u)", pid));
99+
100+ return TRUE;
101+}
102+
103+static gboolean
104 on_dbus_handle_get_xid (BamfDBusItemWindow *interface,
105 GDBusMethodInvocation *invocation,
106 BamfWindow *self)
107@@ -493,6 +512,9 @@
108 g_signal_connect (self, "monitor-changed", G_CALLBACK (on_monitor_changed), NULL);
109
110 /* Registering signal callbacks to reply to dbus method calls */
111+ g_signal_connect (self->priv->dbus_iface, "handle-get-pid",
112+ G_CALLBACK (on_dbus_handle_get_pid), self);
113+
114 g_signal_connect (self->priv->dbus_iface, "handle-get-xid",
115 G_CALLBACK (on_dbus_handle_get_xid), self);
116
117
118=== modified file 'src/bamf-window.h'
119--- src/bamf-window.h 2012-02-10 18:30:25 +0000
120+++ src/bamf-window.h 2012-02-15 05:55:22 +0000
121@@ -68,6 +68,8 @@
122
123 guint32 bamf_window_get_xid (BamfWindow *window);
124
125+guint32 bamf_window_get_pid (BamfWindow *window);
126+
127 time_t bamf_window_last_active (BamfWindow *window);
128
129 time_t bamf_window_opened (BamfWindow *window);
130
131=== modified file 'src/org.ayatana.bamf.view.xml'
132--- src/org.ayatana.bamf.view.xml 2012-02-10 18:30:25 +0000
133+++ src/org.ayatana.bamf.view.xml 2012-02-15 05:55:22 +0000
134@@ -84,6 +84,9 @@
135 <method name="GetXid">
136 <arg name="xid" type="u" direction="out"/>
137 </method>
138+ <method name="GetPid">
139+ <arg name="pid" type="u" direction="out"/>
140+ </method>
141 <method name="Transient">
142 <arg name="path" type="s" direction="out"/>
143 </method>

Subscribers

People subscribed via source and target branches