[devilspie] Use gdk_x11_get_default_xdisplay instead of deprecated gdk_display



commit eb3de0d4089489b7d25b7e15b8e036549184a760
Author: Ross Burton <ross linux intel com>
Date:   Tue Jan 4 20:42:16 2011 +0000

    Use gdk_x11_get_default_xdisplay instead of deprecated gdk_display

 src/actions.c |   10 +++++-----
 src/xutils.c  |   23 ++++++++++++-----------
 2 files changed, 17 insertions(+), 16 deletions(-)
---
diff --git a/src/actions.c b/src/actions.c
index 6cb6ac4..31a0b72 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -205,7 +205,7 @@ ESExpResult *func_geometry(ESExp *f, int argc, ESExpResult **argv, Context *c) {
 
   /* try to set new position.. */
   my_wnck_error_trap_push ();
-  XMoveResizeWindow (gdk_display,
+  XMoveResizeWindow (gdk_x11_get_default_xdisplay (),
                      wnck_window_get_xid (c->window),
                      new_xoffset, new_yoffset,
                      new_width, new_height);
@@ -253,7 +253,7 @@ ESExpResult *func_center(ESExp *f, int argc, ESExpResult **argv, Context *c) {
 
   /* Try to set new position.. */
   my_wnck_error_trap_push ();
-  XMoveWindow (gdk_display,
+  XMoveWindow (gdk_x11_get_default_xdisplay (),
                wnck_window_get_xid (c->window),
                xoffset, yoffset);
 
@@ -514,7 +514,7 @@ ESExpResult *func_set_viewport(ESExp *f, int argc, ESExpResult **argv, Context *
   x = ((num - 1) * wnck_screen_get_width (screen)) - viewport_start + x;
 
   my_wnck_error_trap_push ();
-  XMoveResizeWindow (gdk_display,
+  XMoveResizeWindow (gdk_x11_get_default_xdisplay (),
                      wnck_window_get_xid (c->window),
                      x, y, width, height);
   if (my_wnck_error_trap_pop ()) {
@@ -587,7 +587,7 @@ set_decorations (Context *c, gboolean decorate)
   hints.decorations = decorate ? 1 : 0;
 
   /* Set Motif hints, most window managers handle these */
-  XChangeProperty(GDK_DISPLAY(), wnck_window_get_xid (c->window),
+  XChangeProperty(gdk_x11_get_default_xdisplay (), wnck_window_get_xid (c->window),
                   my_wnck_atom_get ("_MOTIF_WM_HINTS"), 
                   my_wnck_atom_get ("_MOTIF_WM_HINTS"), 32, PropModeReplace, 
                   (unsigned char *)&hints, PROP_MOTIF_WM_HINTS_ELEMENTS);
@@ -697,7 +697,7 @@ ESExpResult *func_opacity(ESExp *f, int argc, ESExpResult **argv, Context *c) {
 	}
 	my_wnck_error_trap_push ();
 	v=0xffffffff/100*opacity;
-	XChangeProperty (GDK_DISPLAY(), wnck_window_get_xid(c->window),
+	XChangeProperty (gdk_x11_get_default_xdisplay (), wnck_window_get_xid(c->window),
 		my_wnck_atom_get ("_NET_WM_WINDOW_OPACITY"),
 		XA_CARDINAL, 32, PropModeReplace, (guchar *)&v, 1);
 
diff --git a/src/xutils.c b/src/xutils.c
index bfe339e..8a84827 100644
--- a/src/xutils.c
+++ b/src/xutils.c
@@ -20,6 +20,7 @@
 #include "xutils.h"
 #include <string.h>
 #include <stdio.h>
+#include <gdk/gdkx.h>
 
 static GHashTable *atom_hash = NULL;
 static GHashTable *reverse_atom_hash = NULL;
@@ -40,7 +41,7 @@ my_wnck_atom_get (const char *atom_name)
   retval = GPOINTER_TO_UINT (g_hash_table_lookup (atom_hash, atom_name));
   if (!retval)
     {
-      retval = XInternAtom (gdk_display, atom_name, FALSE);
+      retval = XInternAtom (gdk_x11_get_default_xdisplay (), atom_name, FALSE);
 
       if (retval != None)
         {
@@ -76,7 +77,7 @@ my_wnck_change_state (Screen  *screen,
   xev.xclient.type = ClientMessage;
   xev.xclient.serial = 0;
   xev.xclient.send_event = True;
-  xev.xclient.display = gdk_display;
+  xev.xclient.display = gdk_x11_get_default_xdisplay ();
   xev.xclient.window = xwindow;
   xev.xclient.message_type = my_wnck_atom_get ("_NET_WM_STATE");
   xev.xclient.format = 32;
@@ -84,7 +85,7 @@ my_wnck_change_state (Screen  *screen,
   xev.xclient.data.l[1] = state1;
   xev.xclient.data.l[2] = state2;
 
-  XSendEvent (gdk_display,
+  XSendEvent (gdk_x11_get_default_xdisplay (),
 	      RootWindowOfScreen (screen),
               False,
 	      SubstructureRedirectMask | SubstructureNotifyMask,
@@ -100,7 +101,7 @@ my_wnck_error_trap_push (void)
 int
 my_wnck_error_trap_pop (void)
 {
-  XSync (gdk_display, False);
+  XSync (gdk_x11_get_default_xdisplay (), False);
   return gdk_error_trap_pop ();
 }
 
@@ -122,7 +123,7 @@ my_wnck_get_string_property_latin1 (Window  xwindow,
   
   my_wnck_error_trap_push ();
   property = NULL;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (gdk_x11_get_default_xdisplay (),
 			       xwindow, atom,
 			       0, G_MAXLONG,
 			       False, AnyPropertyType, &type, &format, &nitems,
@@ -144,7 +145,7 @@ my_wnck_get_string_property_latin1 (Window  xwindow,
       pp = (long *)property;  // we can assume (long *) since format == 32
       if (nitems == 1)
         {
-          prop_name = XGetAtomName (gdk_display, *pp);
+          prop_name = XGetAtomName (gdk_x11_get_default_xdisplay (), *pp);
           if (prop_name)
             {
               retval = g_strdup (prop_name);
@@ -157,7 +158,7 @@ my_wnck_get_string_property_latin1 (Window  xwindow,
           prop_names[nitems] = NULL;
           for (i=0; i < nitems; i++)
             {
-              prop_names[i] = XGetAtomName (gdk_display, *pp++);
+              prop_names[i] = XGetAtomName (gdk_x11_get_default_xdisplay (), *pp++);
             }
           retval = g_strjoinv (", ", prop_names);
           for (i=0; i < nitems; i++)
@@ -194,7 +195,7 @@ my_wnck_window_get_xscreen (WnckWindow *window)
    XWindowAttributes attrs;
 
    xid = wnck_window_get_xid (window);
-   XGetWindowAttributes(gdk_display, xid, &attrs);
+   XGetWindowAttributes (gdk_x11_get_default_xdisplay (), xid, &attrs);
 
    return attrs.screen;
 }
@@ -217,7 +218,7 @@ my_wnck_get_cardinal_list (Window   xwindow,
   
   my_wnck_error_trap_push ();
   type = None;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (gdk_x11_get_default_xdisplay (),
                               xwindow,
                               atom,
                               0, G_MAXLONG,
@@ -257,7 +258,7 @@ my_wnck_get_cardinal (Window   xwindow,
   
   my_wnck_error_trap_push ();
   type = None;
-  result = XGetWindowProperty (gdk_display,
+  result = XGetWindowProperty (gdk_x11_get_default_xdisplay (),
                               xwindow,
                               atom,
                               0, G_MAXLONG,
@@ -340,7 +341,7 @@ void my_wnck_window_set_window_type (WnckWindow *window, WnckWindowType wintype)
   }
   my_wnck_error_trap_push ();
 
-  XChangeProperty (GDK_DISPLAY(), wnck_window_get_xid(window),
+  XChangeProperty (gdk_x11_get_default_xdisplay (), wnck_window_get_xid(window),
                    my_wnck_atom_get ("_NET_WM_WINDOW_TYPE"),
                    XA_ATOM, 32, PropModeReplace, (guchar *)&atom, 1);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]