mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
Add compatibility with GTK+ 2.18
In order to replace calls to deprecated GDK code, the current development version of GTK+ is required. Add some basic compatibility code to allow building mutter with GTK+ 2.18. https://bugzilla.gnome.org/show_bug.cgi?id=587991
This commit is contained in:
parent
c65a24486d
commit
e267a63330
@ -124,7 +124,7 @@ if test "x$GCC" = "xyes"; then
|
||||
fi
|
||||
changequote([,])dnl
|
||||
|
||||
MUTTER_PC_MODULES='gtk+-2.0 >= 2.21.1 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],
|
||||
|
@ -39,6 +39,7 @@ mutter_SOURCES= \
|
||||
compositor/mutter-shaped-texture.h \
|
||||
compositor/tidy/tidy-texture-frame.c \
|
||||
compositor/tidy/tidy-texture-frame.h \
|
||||
gdk-compat.h \
|
||||
gtk-compat.h \
|
||||
include/compositor.h \
|
||||
include/mutter-plugin.h \
|
||||
|
35
src/gdk-compat.h
Normal file
35
src/gdk-compat.h
Normal file
@ -0,0 +1,35 @@
|
||||
#ifndef __GDK_COMPAT_H__
|
||||
#define __GDK_COMPAT_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
/* Provide a compatibility layer for accessor function introduced
|
||||
* in GTK+ 2.22 which we need to build without deprecated GDK symbols.
|
||||
* That way it is still possible to build with GTK+ 2.18 when not
|
||||
* using GDK_DISABLE_DEPRECATED.
|
||||
*/
|
||||
|
||||
#if !GTK_CHECK_VERSION (2, 21, 1)
|
||||
|
||||
#define gdk_window_get_background(w,c) *c = GDK_WINDOW_OBJECT (w)->bg_color
|
||||
#define gdk_visual_get_depth(v) GDK_VISUAL(v)->depth
|
||||
#define gdk_window_get_back_pixmap(w,p,r) \
|
||||
G_STMT_START { \
|
||||
GdkWindowObject *priv = GDK_WINDOW_OBJECT (w); \
|
||||
\
|
||||
if (p != NULL) \
|
||||
{ \
|
||||
if (priv->bg_pixmap == GDK_PARENT_RELATIVE_BG || \
|
||||
priv->bg_pixmap == GDK_NO_BG) \
|
||||
*p = NULL; \
|
||||
else \
|
||||
*p = priv->bg_pixmap; \
|
||||
} \
|
||||
\
|
||||
if (r != NULL) \
|
||||
*r = (priv->bg_pixmap == GDK_PARENT_RELATIVE_BG); \
|
||||
} G_STMT_END
|
||||
|
||||
#endif /*GTK_CHECK_VERSION */
|
||||
|
||||
#endif /* __GDK_COMPAT_H__ */
|
@ -36,6 +36,7 @@
|
||||
#include "ui.h"
|
||||
|
||||
#include "gtk-compat.h"
|
||||
#include "gdk-compat.h"
|
||||
|
||||
#ifdef HAVE_SHAPE
|
||||
#include <X11/extensions/shape.h>
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "theme.h"
|
||||
|
||||
#include "inlinepixbufs.h"
|
||||
#include "gdk-compat.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
Loading…
Reference in New Issue
Block a user