Add compatibility with GTK+ 2.18
To replace all calls to deprecated code, GTK+ 2.20 is required - add some basic compatibility code, so that it is still possible to build mutter with GTK+ 2.18 when not using -DGSEAL_ENABLE. https://bugzilla.gnome.org/show_bug.cgi?id=595496
This commit is contained in:
parent
5526e91b6e
commit
c6c7b05d7b
@ -124,7 +124,7 @@ if test "x$GCC" = "xyes"; then
|
|||||||
fi
|
fi
|
||||||
changequote([,])dnl
|
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_ARG_ENABLE(gconf,
|
||||||
AC_HELP_STRING([--disable-gconf],
|
AC_HELP_STRING([--disable-gconf],
|
||||||
@ -184,8 +184,8 @@ AM_GLIB_GNU_GETTEXT
|
|||||||
# GRegex requires Glib-2.14.0
|
# GRegex requires Glib-2.14.0
|
||||||
PKG_CHECK_MODULES(ALL, glib-2.0 >= 2.14.0)
|
PKG_CHECK_MODULES(ALL, glib-2.0 >= 2.14.0)
|
||||||
# gtk_window_set_icon_name requires gtk2+-2.6.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_MESSAGE, gtk+-2.0 >= 2.18)
|
||||||
PKG_CHECK_MODULES(MUTTER_WINDOW_DEMO, gtk+-2.0 >= 2.20)
|
PKG_CHECK_MODULES(MUTTER_WINDOW_DEMO, gtk+-2.0 >= 2.18)
|
||||||
|
|
||||||
# Unconditionally use this dir to avoid a circular dep with gnomecc
|
# Unconditionally use this dir to avoid a circular dep with gnomecc
|
||||||
GNOME_KEYBINDINGS_KEYSDIR="${datadir}/gnome-control-center/keybindings"
|
GNOME_KEYBINDINGS_KEYSDIR="${datadir}/gnome-control-center/keybindings"
|
||||||
|
@ -39,6 +39,7 @@ mutter_SOURCES= \
|
|||||||
compositor/mutter-shaped-texture.h \
|
compositor/mutter-shaped-texture.h \
|
||||||
compositor/tidy/tidy-texture-frame.c \
|
compositor/tidy/tidy-texture-frame.c \
|
||||||
compositor/tidy/tidy-texture-frame.h \
|
compositor/tidy/tidy-texture-frame.h \
|
||||||
|
gtk-compat.h \
|
||||||
include/compositor.h \
|
include/compositor.h \
|
||||||
include/mutter-plugin.h \
|
include/mutter-plugin.h \
|
||||||
include/mutter-window.h \
|
include/mutter-window.h \
|
||||||
|
26
src/gtk-compat.h
Normal file
26
src/gtk-compat.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#ifndef __GTK_COMPAT_H__
|
||||||
|
#define __GTK_COMPAT_H__
|
||||||
|
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
/* 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__ */
|
@ -4,6 +4,7 @@ icondir=$(pkgdatadir)/icons
|
|||||||
icon_DATA=mutter-window-demo.png
|
icon_DATA=mutter-window-demo.png
|
||||||
|
|
||||||
INCLUDES=@MUTTER_WINDOW_DEMO_CFLAGS@ @MUTTER_MESSAGE_CFLAGS@ \
|
INCLUDES=@MUTTER_WINDOW_DEMO_CFLAGS@ @MUTTER_MESSAGE_CFLAGS@ \
|
||||||
|
-I$(top_srcdir)/src \
|
||||||
-DMUTTER_ICON_DIR=\"$(pkgdatadir)/icons\" \
|
-DMUTTER_ICON_DIR=\"$(pkgdatadir)/icons\" \
|
||||||
-DMUTTER_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\"
|
-DMUTTER_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\"
|
||||||
|
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "gtk-compat.h"
|
||||||
|
|
||||||
static GtkWidget* do_appwindow (void);
|
static GtkWidget* do_appwindow (void);
|
||||||
|
|
||||||
static gboolean aspect_on;
|
static gboolean aspect_on;
|
||||||
|
@ -35,6 +35,8 @@
|
|||||||
#include "prefs.h"
|
#include "prefs.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
|
|
||||||
|
#include "gtk-compat.h"
|
||||||
|
|
||||||
#ifdef HAVE_SHAPE
|
#ifdef HAVE_SHAPE
|
||||||
#include <X11/extensions/shape.h>
|
#include <X11/extensions/shape.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
#include "gtk-compat.h"
|
||||||
|
|
||||||
static void meta_accel_label_class_init (MetaAccelLabelClass *klass);
|
static void meta_accel_label_class_init (MetaAccelLabelClass *klass);
|
||||||
static void meta_accel_label_init (MetaAccelLabel *accel_label);
|
static void meta_accel_label_init (MetaAccelLabel *accel_label);
|
||||||
static void meta_accel_label_destroy (GtkObject *object);
|
static void meta_accel_label_destroy (GtkObject *object);
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <gdk/gdkx.h>
|
#include <gdk/gdkx.h>
|
||||||
|
#include "gtk-compat.h"
|
||||||
|
|
||||||
struct _MetaResizePopup
|
struct _MetaResizePopup
|
||||||
{
|
{
|
||||||
|
@ -36,6 +36,8 @@
|
|||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#include "gtk-compat.h"
|
||||||
|
|
||||||
#define OUTSIDE_SELECT_RECT 2
|
#define OUTSIDE_SELECT_RECT 2
|
||||||
#define INSIDE_SELECT_RECT 2
|
#define INSIDE_SELECT_RECT 2
|
||||||
|
|
||||||
|
@ -62,6 +62,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#include "gtk-compat.h"
|
||||||
|
|
||||||
#define GDK_COLOR_RGBA(color) \
|
#define GDK_COLOR_RGBA(color) \
|
||||||
((guint32) (0xff | \
|
((guint32) (0xff | \
|
||||||
(((color).red / 256) << 24) | \
|
(((color).red / 256) << 24) | \
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
#include "themewidget.h"
|
#include "themewidget.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#include "gtk-compat.h"
|
||||||
|
|
||||||
static void meta_area_class_init (MetaAreaClass *klass);
|
static void meta_area_class_init (MetaAreaClass *klass);
|
||||||
static void meta_area_init (MetaArea *area);
|
static void meta_area_init (MetaArea *area);
|
||||||
static void meta_area_size_request (GtkWidget *widget,
|
static void meta_area_size_request (GtkWidget *widget,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user