Merge lp:~mterry/indicator-appmenu/gtk3 into lp:indicator-appmenu/0.3

Proposed by Michael Terry
Status: Merged
Approved by: Ted Gould
Approved revision: 124
Merged at revision: 124
Proposed branch: lp:~mterry/indicator-appmenu/gtk3
Merge into: lp:indicator-appmenu/0.3
Diff against target: 106 lines (+41/-6)
4 files modified
configure.ac (+27/-6)
scripts/menu-pusher.c (+4/-0)
src/indicator-appmenu.c (+4/-0)
src/window-menus.c (+6/-0)
To merge this branch: bzr merge lp:~mterry/indicator-appmenu/gtk3
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+63753@code.launchpad.net

Description of the change

Port to gtk3 (needs bamf port merged first)

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

Can't test without the BAMF update but in review this looks fine.

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 2011-04-14 21:09:13 +0000
3+++ configure.ac 2011-06-07 19:42:23 +0000
4@@ -47,16 +47,34 @@
5 ###########################
6
7 GTK_REQUIRED_VERSION=2.12
8+GTK3_REQUIRED_VERSION=3.0
9 GIO_REQUIRED_VERSION=2.26
10 INDICATOR_REQUIRED_VERSION=0.3.19
11 DBUSMENUGTK_REQUIRED_VERSION=0.3.3
12 BAMF_REQUIRED_VERSION=0.2.53
13
14-PKG_CHECK_MODULES(INDICATOR, gtk+-2.0 >= $GTK_REQUIRED_VERSION
15- gio-2.0 >= $GIO_REQUIRED_VERSION
16- indicator >= $INDICATOR_REQUIRED_VERSION
17- dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION
18- libbamf >= $BAMF_REQUIRED_VERSION)
19+AC_ARG_WITH([gtk],
20+ [AS_HELP_STRING([--with-gtk],
21+ [Which version of gtk to use @<:@default=3@:>@])],
22+ [],
23+ [with_gtk=3])
24+
25+AS_IF([test "x$with_gtk" = x3],
26+ [PKG_CHECK_MODULES(INDICATOR, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
27+ gio-2.0 >= $GIO_REQUIRED_VERSION
28+ indicator3 >= $INDICATOR_REQUIRED_VERSION
29+ dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION
30+ libbamf3 >= $BAMF_REQUIRED_VERSION)
31+ ],
32+ [test "x$with_gtk" = x2],
33+ [PKG_CHECK_MODULES(INDICATOR, gtk+-2.0 >= $GTK_REQUIRED_VERSION
34+ gio-2.0 >= $GIO_REQUIRED_VERSION
35+ indicator >= $INDICATOR_REQUIRED_VERSION
36+ dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION
37+ libbamf >= $BAMF_REQUIRED_VERSION)
38+ ],
39+ [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])]
40+)
41
42 AC_SUBST(INDICATOR_CFLAGS)
43 AC_SUBST(INDICATOR_LIBS)
44@@ -94,9 +112,12 @@
45 if test "x$with_localinstall" = "xyes"; then
46 INDICATORDIR="${libdir}/indicators/3/"
47 INDICATORICONSDIR="${datadir}/libindicate/icons/"
48-else
49+elif test "x$with_gtk" = x2; then
50 INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator`
51 INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator`
52+else
53+ INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3`
54+ INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator3`
55 fi
56 AC_SUBST(INDICATORDIR)
57 AC_SUBST(INDICATORICONSDIR)
58
59=== modified file 'scripts/menu-pusher.c'
60--- scripts/menu-pusher.c 2011-01-12 20:08:25 +0000
61+++ scripts/menu-pusher.c 2011-06-07 19:42:23 +0000
62@@ -23,7 +23,11 @@
63 #include <gio/gio.h>
64 #include <libdbusmenu-glib/menuitem.h>
65 #include <libdbusmenu-glib/server.h>
66+#if GTK_CHECK_VERSION(3, 0, 0)
67+#include <libdbusmenu-gtk3/menuitem.h>
68+#else
69 #include <libdbusmenu-gtk/menuitem.h>
70+#endif
71 #include "../src/dbus-shared.h"
72
73 int
74
75=== modified file 'src/indicator-appmenu.c'
76--- src/indicator-appmenu.c 2011-04-07 15:43:16 +0000
77+++ src/indicator-appmenu.c 2011-06-07 19:42:23 +0000
78@@ -680,7 +680,11 @@
79 SubstructureRedirectMask | SubstructureNotifyMask,
80 &xev);
81 gdk_flush ();
82+#if GTK_CHECK_VERSION(3, 0, 0)
83+ gdk_error_trap_pop_ignored ();
84+#else
85 gdk_error_trap_pop ();
86+#endif
87
88 return;
89 }
90
91=== modified file 'src/window-menus.c'
92--- src/window-menus.c 2011-04-15 19:09:56 +0000
93+++ src/window-menus.c 2011-06-07 19:42:23 +0000
94@@ -23,7 +23,13 @@
95 #include "config.h"
96 #endif
97
98+#include <gtk/gtk.h>
99+
100+#if GTK_CHECK_VERSION(3, 0, 0)
101+#include <libdbusmenu-gtk3/menu.h>
102+#else
103 #include <libdbusmenu-gtk/menu.h>
104+#endif
105 #include <glib.h>
106 #include <gio/gio.h>
107

Subscribers

People subscribed via source and target branches