[gtk+/gtk-2-22] Deprecate gdk_display and GDK_DISPLAY
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-22] Deprecate gdk_display and GDK_DISPLAY
- Date: Sat, 11 Sep 2010 02:37:13 +0000 (UTC)
commit a3c3031a0e1b7a6adece0d859f1f682ba7642672
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Sep 10 11:26:16 2010 -0400
Deprecate gdk_display and GDK_DISPLAY
docs/reference/gdk/tmpl/x_interaction.sgml | 2 ++
docs/tools/shooter.c | 6 +++---
docs/tools/widgets.c | 2 +-
gdk/x11/gdkx.h | 4 ++--
modules/other/gail/gailwindow.c | 12 ++++++------
5 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/docs/reference/gdk/tmpl/x_interaction.sgml b/docs/reference/gdk/tmpl/x_interaction.sgml
index 66a5a07..ffc0a97 100644
--- a/docs/reference/gdk/tmpl/x_interaction.sgml
+++ b/docs/reference/gdk/tmpl/x_interaction.sgml
@@ -41,6 +41,8 @@ The current display.
@Returns: an Xlib <type>Display*</type>.
+ Deprecated: 2.22: Use gdk_display_get_default ()
+
<!-- ##### MACRO GDK_WINDOW_XDISPLAY ##### -->
<para>
diff --git a/docs/tools/shooter.c b/docs/tools/shooter.c
index 95555ec..98666a0 100644
--- a/docs/tools/shooter.c
+++ b/docs/tools/shooter.c
@@ -33,7 +33,7 @@ find_toplevel_window (Window xid)
do
{
- if (XQueryTree (GDK_DISPLAY (), xid, &root,
+ if (XQueryTree (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xid, &root,
&parent, &children, &nchildren) == 0)
{
g_warning ("Couldn't find window manager window");
@@ -82,7 +82,7 @@ remove_shaped_area (GdkPixbuf *pixbuf,
gdk_pixbuf_get_height (pixbuf));
gdk_pixbuf_fill (retval, 0);
- rectangles = XShapeGetRectangles (GDK_DISPLAY (), window,
+ rectangles = XShapeGetRectangles (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), window,
ShapeBounding, &rectangle_count, &rectangle_order);
for (i = 0; i < rectangle_count; i++)
@@ -130,7 +130,7 @@ take_window_shot (Window child,
GdkPixbuf *tmp, *tmp2;
GdkPixbuf *retval;
- disp = GDK_DISPLAY ();
+ disp = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
w = GDK_ROOT_WINDOW ();
if (include_decoration)
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index 226db88..6469d45 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -21,7 +21,7 @@ find_toplevel_window (Window xid)
do
{
- if (XQueryTree (GDK_DISPLAY (), xid, &root,
+ if (XQueryTree (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), xid, &root,
&parent, &children, &nchildren) == 0)
{
g_warning ("Couldn't find window manager window");
diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
index 9bc577a..8368890 100644
--- a/gdk/x11/gdkx.h
+++ b/gdk/x11/gdkx.h
@@ -34,7 +34,7 @@
G_BEGIN_DECLS
-#ifndef GDK_MULTIHEAD_SAFE
+#if !defined (GDK_DISABLE_DEPRECATED) && !defined (GDK_MULTIHEAD_SAFE) && defined (GDK_COMPILATION)
extern Display *gdk_display;
#endif
@@ -75,7 +75,7 @@ gint gdk_x11_get_default_screen (void);
#define GDK_IMAGE_XDISPLAY(image) (gdk_x11_image_get_xdisplay (image))
#define GDK_IMAGE_XIMAGE(image) (gdk_x11_image_get_ximage (image))
-#ifndef GDK_MULTIHEAD_SAFE
+#if !defined (GDK_DISABLE_DEPRECATED) && !defined (GDK_MULTIHEAD_SAFE) && defined (GDK_COMPILATION)
#define GDK_DISPLAY() gdk_display
#endif
diff --git a/modules/other/gail/gailwindow.c b/modules/other/gail/gailwindow.c
index 5582b3a..4ae51ad 100644
--- a/modules/other/gail/gailwindow.c
+++ b/modules/other/gail/gailwindow.c
@@ -662,10 +662,10 @@ get_window_desktop (Window window)
if (_net_wm_desktop == None)
_net_wm_desktop =
- XInternAtom (gdk_display, "_NET_WM_DESKTOP", False);
+ XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "_NET_WM_DESKTOP", False);
gdk_error_trap_push ();
- result = XGetWindowProperty (gdk_display, window, _net_wm_desktop,
+ result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), window, _net_wm_desktop,
0, G_MAXLONG,
False, XA_CARDINAL,
&ret_type, &format, &nitems,
@@ -716,11 +716,11 @@ get_stacked_windows (GailScreenInfo *info)
if (_net_client_list_stacking == None)
_net_client_list_stacking =
- XInternAtom (gdk_display, "_NET_CLIENT_LIST_STACKING", False);
+ XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "_NET_CLIENT_LIST_STACKING", False);
gdk_error_trap_push ();
ret_type = None;
- result = XGetWindowProperty (gdk_display,
+ result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
GDK_WINDOW_XWINDOW (info->root_window),
_net_client_list_stacking,
0, G_MAXLONG,
@@ -917,11 +917,11 @@ init_gail_screen (GdkScreen *screen,
get_stacked_windows (&gail_screens [screen_n]);
- XGetWindowAttributes (gdk_display,
+ XGetWindowAttributes (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
GDK_WINDOW_XWINDOW (gail_screens [screen_n].root_window),
&attrs);
- XSelectInput (gdk_display,
+ XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
GDK_WINDOW_XWINDOW (gail_screens [screen_n].root_window),
attrs.your_event_mask | PropertyChangeMask);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]