diff --git a/configure.in b/configure.in index dc71a7698..58b88a0b7 100644 --- a/configure.in +++ b/configure.in @@ -124,7 +124,7 @@ if test "x$GCC" = "xyes"; then fi changequote([,])dnl -MUTTER_PC_MODULES='gtk+-2.0 >= 2.20 pango >= 1.2.0' +MUTTER_PC_MODULES='gtk+-2.0 >= 2.18 pango >= 1.2.0' AC_ARG_ENABLE(gconf, AC_HELP_STRING([--disable-gconf], @@ -184,8 +184,8 @@ AM_GLIB_GNU_GETTEXT # GRegex requires Glib-2.14.0 PKG_CHECK_MODULES(ALL, glib-2.0 >= 2.14.0) # gtk_window_set_icon_name requires gtk2+-2.6.0 -PKG_CHECK_MODULES(MUTTER_MESSAGE, gtk+-2.0 >= 2.20) -PKG_CHECK_MODULES(MUTTER_WINDOW_DEMO, gtk+-2.0 >= 2.20) +PKG_CHECK_MODULES(MUTTER_MESSAGE, gtk+-2.0 >= 2.18) +PKG_CHECK_MODULES(MUTTER_WINDOW_DEMO, gtk+-2.0 >= 2.18) # Unconditionally use this dir to avoid a circular dep with gnomecc GNOME_KEYBINDINGS_KEYSDIR="${datadir}/gnome-control-center/keybindings" diff --git a/src/Makefile.am b/src/Makefile.am index a3d892d7d..cc1c3a461 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -39,6 +39,7 @@ mutter_SOURCES= \ compositor/mutter-shaped-texture.h \ compositor/tidy/tidy-texture-frame.c \ compositor/tidy/tidy-texture-frame.h \ + gtk-compat.h \ include/compositor.h \ include/mutter-plugin.h \ include/mutter-window.h \ diff --git a/src/gtk-compat.h b/src/gtk-compat.h new file mode 100644 index 000000000..5e029be4f --- /dev/null +++ b/src/gtk-compat.h @@ -0,0 +1,26 @@ +#ifndef __GTK_COMPAT_H__ +#define __GTK_COMPAT_H__ + +#include + +/* Provide a compatibility layer for accessor function introduces + * in GTK+ 2.20 which we need to build with GSEAL_ENABLE. + * That way it is still possible to build with GTK+ 2.18 when not + * using GSEAL_ENABLE + */ + +#if !GTK_CHECK_VERSION (2, 20, 0) + +#define gtk_widget_get_realized(w) GTK_WIDGET_REALIZED (w) +#define gtk_widget_get_requisition(w,r) (*r = GTK_WIDGET (w)->requisition) +#define gtk_widget_set_mapped(w,m) \ + G_STMT_START { \ + if (m) \ + GTK_WIDGET_SET_FLAGS (w, GTK_MAPPED); \ + else \ + GTK_WIDGET_UNSET_FLAGS (w, GTK_MAPPED); \ + } G_STMT_END + +#endif /* GTK_CHECK_VERSION */ + +#endif /* __GTK_COMPAT_H__ */ diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am index e9c93abaf..c9a47a7f0 100644 --- a/src/tools/Makefile.am +++ b/src/tools/Makefile.am @@ -4,6 +4,7 @@ icondir=$(pkgdatadir)/icons icon_DATA=mutter-window-demo.png INCLUDES=@MUTTER_WINDOW_DEMO_CFLAGS@ @MUTTER_MESSAGE_CFLAGS@ \ + -I$(top_srcdir)/src \ -DMUTTER_ICON_DIR=\"$(pkgdatadir)/icons\" \ -DMUTTER_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" diff --git a/src/tools/mutter-window-demo.c b/src/tools/mutter-window-demo.c index be5584c84..facc8c985 100644 --- a/src/tools/mutter-window-demo.c +++ b/src/tools/mutter-window-demo.c @@ -24,6 +24,8 @@ #include #include +#include "gtk-compat.h" + static GtkWidget* do_appwindow (void); static gboolean aspect_on; diff --git a/src/ui/frames.c b/src/ui/frames.c index 49862a5f2..ba6c81c13 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -35,6 +35,8 @@ #include "prefs.h" #include "ui.h" +#include "gtk-compat.h" + #ifdef HAVE_SHAPE #include #endif diff --git a/src/ui/metaaccellabel.c b/src/ui/metaaccellabel.c index cf6e35eab..565f07ca0 100644 --- a/src/ui/metaaccellabel.c +++ b/src/ui/metaaccellabel.c @@ -37,6 +37,8 @@ #include #include "util.h" +#include "gtk-compat.h" + static void meta_accel_label_class_init (MetaAccelLabelClass *klass); static void meta_accel_label_init (MetaAccelLabel *accel_label); static void meta_accel_label_destroy (GtkObject *object); diff --git a/src/ui/resizepopup.c b/src/ui/resizepopup.c index c9e69fcb2..7efbb24f8 100644 --- a/src/ui/resizepopup.c +++ b/src/ui/resizepopup.c @@ -26,6 +26,7 @@ #include "util.h" #include #include +#include "gtk-compat.h" struct _MetaResizePopup { diff --git a/src/ui/tabpopup.c b/src/ui/tabpopup.c index fe4a36c3d..4aa1e984c 100644 --- a/src/ui/tabpopup.c +++ b/src/ui/tabpopup.c @@ -36,6 +36,8 @@ #include #include +#include "gtk-compat.h" + #define OUTSIDE_SELECT_RECT 2 #define INSIDE_SELECT_RECT 2 diff --git a/src/ui/theme.c b/src/ui/theme.c index 59ff90bfb..3e90f4c4c 100644 --- a/src/ui/theme.c +++ b/src/ui/theme.c @@ -62,6 +62,8 @@ #include #include +#include "gtk-compat.h" + #define GDK_COLOR_RGBA(color) \ ((guint32) (0xff | \ (((color).red / 256) << 24) | \ diff --git a/src/ui/themewidget.c b/src/ui/themewidget.c index 05bd839fa..59f91bb99 100644 --- a/src/ui/themewidget.c +++ b/src/ui/themewidget.c @@ -24,6 +24,8 @@ #include "themewidget.h" #include +#include "gtk-compat.h" + static void meta_area_class_init (MetaAreaClass *klass); static void meta_area_init (MetaArea *area); static void meta_area_size_request (GtkWidget *widget,