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 is still possible to build the shell with GTK+ 2.18 when not using -DGSEAL_ENABLE. https://bugzilla.gnome.org/show_bug.cgi?id=618258
This commit is contained in:
parent
8c5bb8655d
commit
6318c8e95b
@ -59,7 +59,7 @@ CLUTTER_MIN_VERSION=1.2.0
|
||||
GOBJECT_INTROSPECTION_MIN_VERSION=0.6.9
|
||||
GJS_MIN_VERSION=0.6
|
||||
MUTTER_MIN_VERSION=2.29.1
|
||||
GTK_MIN_VERSION=2.20.0
|
||||
GTK_MIN_VERSION=2.18.0
|
||||
|
||||
# Collect more than 20 libraries for a prize!
|
||||
PKG_CHECK_MODULES(MUTTER_PLUGIN, gio-unix-2.0 dbus-glib-1
|
||||
|
@ -15,6 +15,7 @@ TRAY_STAMP_FILES = stamp-na-marshal.h
|
||||
|
||||
# please, keep this sorted alphabetically
|
||||
tray_source = \
|
||||
gtk-compat.h \
|
||||
tray/na-tray-child.c \
|
||||
tray/na-tray-child.h \
|
||||
tray/na-tray-manager.c \
|
||||
|
@ -82,6 +82,7 @@ libgnome_shell_la_SOURCES = \
|
||||
$(shell_built_sources) \
|
||||
$(shell_public_headers_h) \
|
||||
gnome-shell-plugin.c \
|
||||
gtk-compat.h \
|
||||
shell-app.c \
|
||||
shell-app-private.h \
|
||||
shell-app-system.c \
|
||||
|
19
src/gtk-compat.h
Normal file
19
src/gtk-compat.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef __GTK_COMPAT_H__
|
||||
#define __GTK_COMPAT_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* Provide a compatibility layer for accessor functions introduced
|
||||
* 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_mapped(w) GTK_WIDGET_MAPPED (w)
|
||||
|
||||
#endif /* GTK_CHECK_VERSION(2, 20, 0) */
|
||||
|
||||
#endif /* __GTK_COMPAT_H__ */
|
@ -6,6 +6,7 @@
|
||||
#include <clutter/x11/clutter-x11.h>
|
||||
|
||||
#include "shell-embedded-window-private.h"
|
||||
#include "gtk-compat.h"
|
||||
|
||||
/* This type is a subclass of GtkWindow that ties the window to a
|
||||
* ShellGtkEmbed; the window is reparented into the stage
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "shell-embedded-window-private.h"
|
||||
#include "gtk-compat.h"
|
||||
|
||||
#include <clutter/glx/clutter-glx.h>
|
||||
#include <clutter/x11/clutter-x11.h>
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "na-tray-child.h"
|
||||
#include "gtk-compat.h"
|
||||
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include <gdk/gdk.h>
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <libintl.h>
|
||||
|
||||
#include "na-tray-manager.h"
|
||||
#include "gtk-compat.h"
|
||||
|
||||
#include <gdkconfig.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
Loading…
Reference in New Issue
Block a user