Merge lp:~abreu-alexandre/libunity-webapps/2.4-fix-1138473 into lp:libunity-webapps/2.4

Proposed by Alexandre Abreu
Status: Merged
Approved by: Alexandre Abreu
Approved revision: 962
Merged at revision: 962
Proposed branch: lp:~abreu-alexandre/libunity-webapps/2.4-fix-1138473
Merge into: lp:libunity-webapps/2.4
Diff against target: 186 lines (+15/-80)
3 files modified
configure.ac (+8/-3)
src/libunity-webapps/unity-webapps-service.c (+4/-77)
tools/Makefile.am (+3/-0)
To merge this branch: bzr merge lp:~abreu-alexandre/libunity-webapps/2.4-fix-1138473
Reviewer Review Type Date Requested Status
Víctor R. Ruiz (community) Approve
Review via email: mp+151658@code.launchpad.net

Commit message

Fix #1138473: libunity-webapps pulls gtk 3 in to Firefox

To post a comment you must log in.
Revision history for this message
Víctor R. Ruiz (vrruiz) wrote :

Looks ok.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configure.ac'
2--- configure.ac 2013-02-08 17:05:24 +0000
3+++ configure.ac 2013-03-05 00:45:25 +0000
4@@ -25,18 +25,23 @@
5
6 LT_INIT
7
8-PKG_CHECK_MODULES(UNITY_WEBAPPS, [gdk-pixbuf-2.0 glib-2.0 gobject-2.0 gio-2.0
9- gio-unix-2.0 libwnck-3.0 json-glib-1.0 libsoup-2.4 packagekit-glib2 polkit-gobject-1])
10+# Beware: remember that libunity-webapps will be pulled in at runtime in
11+# the browser runtime env. So watch out for bad mix ups in the dependancies/runtimes
12+# e.g. adding some dependancies on gtk3 when chromium & ff are still gtk2 based.
13+PKG_CHECK_MODULES(UNITY_WEBAPPS, [glib-2.0 gobject-2.0 gio-2.0
14+ gio-unix-2.0 json-glib-1.0 libsoup-2.4 packagekit-glib2 polkit-gobject-1])
15 GLIB_GSETTINGS
16
17 PKG_CHECK_MODULES(TELEPATHY_GLIB, [telepathy-glib])
18-PKG_CHECK_MODULES(UNITY_WEBAPPS_DAEMON, [libnotify unity messaging-menu gtk+-3.0 sqlite3])
19+PKG_CHECK_MODULES(UNITY_WEBAPPS_DAEMON, [libnotify unity messaging-menu gtk+-3.0 sqlite3 gdk-pixbuf-2.0 libwnck-3.0])
20
21 PKG_CHECK_MODULES(UNITY_WEBAPPS_WM_PID_TRACKER, [libwnck-3.0])
22 PKG_CHECK_MODULES(GEOCLUE, [geoclue])
23
24 PKG_CHECK_MODULES(UNITY_WEBAPPS_SERVICE_TRACKER, [gtk+-3.0 dbusmenu-glib-0.4 dbusmenu-gtk3-0.4])
25
26+PKG_CHECK_MODULES(UNITY_WEBAPPS_TOOLS, [libwnck-3.0])
27+
28 GOBJECT_INTROSPECTION_CHECK([0.6.7])
29
30 AC_PATH_PROG([GDBUS_CODEGEN], [gdbus-codegen], AC_MSG_ERROR([gdbus-codegen is required but was not found]))
31
32=== modified file 'src/libunity-webapps/unity-webapps-service.c'
33--- src/libunity-webapps/unity-webapps-service.c 2012-09-25 21:58:07 +0000
34+++ src/libunity-webapps/unity-webapps-service.c 2013-03-05 00:45:25 +0000
35@@ -24,13 +24,8 @@
36 *
37 * Client bindings for the Unity Webapps Service daemon.
38 */
39-#define WNCK_I_KNOW_THIS_IS_UNSTABLE
40 #include <stdio.h>
41
42-#include <libwnck/libwnck.h>
43-#include <gtk/gtk.h>
44-#include <gdk/gdkx.h>
45-
46 #include <unistd.h>
47
48 #include "unity-webapps-service.h"
49@@ -41,8 +36,6 @@
50 struct _UnityWebappsServicePrivate {
51 GDBusConnection *connection;
52 UnityWebappsGenService *service_proxy;
53-
54- WnckScreen *screen;
55 };
56
57 G_DEFINE_TYPE(UnityWebappsService, unity_webapps_service, G_TYPE_OBJECT)
58@@ -109,9 +102,6 @@
59
60 return;
61 }
62-
63- service->priv->screen = wnck_screen_get_default ();
64-
65 }
66
67 /**
68@@ -125,7 +115,6 @@
69 UnityWebappsService *
70 unity_webapps_service_new ()
71 {
72- gtk_init (NULL, NULL);
73 return g_object_new (UNITY_WEBAPPS_TYPE_SERVICE, NULL);
74 }
75
76@@ -347,78 +336,16 @@
77 #include "unity-webapps-context.h"
78
79 /**
80- * A proper chromium browser window instance will have a specific property reflecting
81- * its window_id (or session id in chromium). The window_id is accessible
82- * (implicitly) from js and therefore can/is being used as a way to associate
83- * a context to a proper browser window it is being displayed in.
84- *
85- * Here we just list the existing windows searching for this property and its value.
86+ * WARNING: this is only kept part of the "ABI"
87+ * so that ufe still works (jsctypes still tried to bind with it).
88+ * Should be removed ASAP ufe is released.
89 */
90 void
91 unity_webapps_service_set_xid_for_browser_window_id (UnityWebappsService *service,
92 UnityWebappsContext *context,
93 int window_id)
94 {
95- const gchar * const
96- CHROMIUM_LINUX_SESSION_ID_PROPERTY = "CHROMIUM_LINUX_SESSION_ID_PROPERTY";
97-
98- GList *windows, *walk;
99-
100- // TODO find a way to get it from the WnckScreen?
101- GdkDisplay* display = gdk_display_get_default();
102-
103- wnck_screen_force_update (service->priv->screen);
104-
105- windows = wnck_screen_get_windows_stacked (service->priv->screen);
106-
107- for (walk = windows; walk != NULL; walk = walk->next)
108- {
109- WnckWindow *window = WNCK_WINDOW (walk->data);
110-
111- GdkWindow*
112- active_window = gdk_x11_window_foreign_new_for_display (display,
113- wnck_window_get_xid(window));
114-
115- if (NULL == active_window)
116- {
117- g_message ("Could not retrieve GdkWindow for xid %ld", wnck_window_get_xid(window));
118- continue;
119- }
120-
121- g_message ("Checking window name %s",
122- wnck_window_has_name(window)
123- ? wnck_window_get_name(window)
124- : "Uknown");
125-
126- GdkAtom atom;
127- gint format = 0;
128- gint out_length = 0;
129- gint * session_id = NULL;
130- gboolean
131- have_prop = gdk_property_get (active_window,
132- gdk_atom_intern(CHROMIUM_LINUX_SESSION_ID_PROPERTY,
133- FALSE),
134- gdk_atom_intern("CARDINAL", FALSE),
135- 0L,
136- 4,
137- FALSE,
138- &atom,
139- &format,
140- &out_length,
141- (guchar **)&session_id);
142- if (TRUE == have_prop && NULL != session_id && window_id == session_id[0])
143- {
144- g_message ("Found chromium window w/ session id property %d",
145- session_id[0]);
146-
147- unity_webapps_context_set_view_window (context,
148- (guint64) wnck_window_get_xid (window));
149-
150- g_free (session_id);
151-
152- break;
153- }
154- }
155+ g_warning("unity_webapps_service_set_xid_for_browser_window_id: called but empty");
156 }
157
158 void
159
160=== modified file 'tools/Makefile.am'
161--- tools/Makefile.am 2012-09-04 20:50:20 +0000
162+++ tools/Makefile.am 2013-03-05 00:45:25 +0000
163@@ -3,6 +3,7 @@
164 $(UNITY_WEBAPPS_WM_PID_TRACKER_CFLAGS) \
165 $(UNITY_WEBAPPS_SERVICE_TRACKER_CFLAGS) \
166 $(UNITY_WEBAPPS_DEBUG_CFLAGS) \
167+ $(UNITY_WEBAPPS_TOOLS_CFLAGS) \
168 -I$(top_srcdir)/src \
169 -I$(top_srcdir)/src/libunity-webapps \
170 -I$(top_srcdir)/src/context-daemon \
171@@ -47,6 +48,7 @@
172 service_tracker_LDADD = \
173 $(UNITY_WEBAPPS_LIBS) \
174 $(UNITY_WEBAPPS_SERVICE_TRACKER_LIBS) \
175+ $(UNITY_WEBAPPS_TOOLS_LIBS) \
176 $(top_builddir)/src/libunity-webapps/libunity-webapps.la
177
178 webapps_spreader_SOURCES = \
179@@ -55,6 +57,7 @@
180 webapps_spreader_LDADD = \
181 $(UNITY_WEBAPPS_LIBS) \
182 $(UNITY_WEBAPPS_SERVICE_TRACKER_LIBS) \
183+ $(UNITY_WEBAPPS_TOOLS_LIBS) \
184 $(top_builddir)/src/libunity-webapps/libunity-webapps.la
185
186 unity_webapps_installer_SOURCES = \

Subscribers

People subscribed via source and target branches

to all changes: